<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d4684235500622716427\x26blogName\x3dCaiwangqin\x27s+blog\x26publishMode\x3dPUBLISH_MODE_HOSTED\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://blog.caiwangqin.com/search\x26blogLocale\x3dzh_CN\x26v\x3d2\x26homepageUrl\x3dhttp://blog.caiwangqin.com/\x26vt\x3d3393395200455623441', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Caiwangqin's blog

Focus on Life, Cloud Service, Smart Hardware, Architecture, Technic and beyond…

我在北京的这一年

2008年1月30日星期三

去年南京,今年北京。没有多少差异,只是城市的名字不同罢了。


技术研究:


1. Ruby on Rails

2. MogileFS


主要作品:


1. http://p1.cn

2. http://uiparty.com


难忘的经历:


1. 3rd cnbloggercon

2. 1st china on rails open course

3. 箭扣长城

4. Skiing travel


生活状况:


1. Jianwai SOHO


走过的城市:


1. 北京

2. 合肥

3. 南京

4. 上海


游过的景点:


1. 玉渊潭公园

2. 长城(箭扣段)

3. 香山

4. 十三陵

5. 朝阳公园

6. 通州樱桃采摘园

7. 中央电视塔


记忆深刻的人:


1. Oscar - 大胡子瑞典人

2. 吕欣欣 - 大家都知道的胖子

3. Webleon - 知名Blogger

4. Stan Chu - Bot

5. Joichi Ito (伊藤穰一)

6. Livid - ChinaonRails.Com Powered by Project Babel and Project Midgard

7. 张涛 - 独立思考

8. LIUMANG珍 - 一起走长城

9. lizyg - 女博士


读过的书:


1. All new books about ruby and ruby on rails from bd7lx through pownce.

2. 《品三国》、《汉代风云人物》、《古金兵器谱》、《夜色》、《47楼207》、《金庸小说集》…


最爱的音乐:


1. 青花瓷 - 周杰伦

2. 黄玫瑰 - 李敏


印象深刻的影视:


1. 集结号(Assembly)

2. 士兵突击


使用的手机:


1. Dopod 585

2. Treo 650


标签:

posted by Caiwangqin, 03:29 | Permalink | 0 comments |

搬迁的谣言有了结果,浠水将建核电站。

2008年1月18日星期五

我出生于湖北浠水巴河,今天又有一位朋友发来消息说罗田,英山,浠水三县大移民? 早在半年前和母亲通电话时,听她说过一次。当时我的回复是,没听说有比三峡大坝还大的工程要在我们那里建啊?一定是谣言。以下资料转自黄冈网谈:搬迁的谣言有了结果,浠水将建核电站。希望在外的老乡看到后安心工作,好好生活,遥言止于智者。



中广核电集团拟将浠水列为核电建设项目选址方案

初步确定兰溪竹马山、清泉胡家湾、绿杨丁家山三个选址方案

  1月8日,浠水县委、县政府召开专题会议研究部署配合中国广东核电集团搞好核电项目环境评估的调查勘测工作,为核电项目选址和规划设计提供服务和后勤保障。


  拟在浠水开发建设核电项目的中国广东核电集团,是国家长特型企业集团。该集团已先后开发建设了广东大亚湾核电站、岭澳核电站和辽宁红沿河核电站、阳江核电站及福建宁德核电站,其核电技术处于世界领先水平,现拥有总资产607亿元。


  去年10月,在中央和省市有关方面的大力支持下,中广核电集团与浠水签订了合作开发建设湖北浠水核电项目框架协议书,预计项目总投资将达500亿元。此前,已完成了浠水地质勘测工作。


  目前,中广核电集团在浠水已初步确定了兰溪镇竹马山、清泉镇三台胡家湾和绿杨乡丁家山三个选址方案。同时正在组织专家和技术人员实地进一步调查勘测,计划在今年9月份前完成初可研报告。


  中国的核电站安全技术和保护措施已在世界得到认可,对周边不会造成核辐射。据了解,如果浠水核电项目开发建设选址一经确定,当地不会出现大范围的搬迁,只是周围1-2公里范围内的居民搬迁。浠水县委常委、常务副县长洪汉宽说,中广核电项目将为浠水发展带来前所未有的发展机遇,同时将推动县域经济的快速增长,是一项造福于人民的工程。(鄂东晚报)



相关新闻





湖北10年核电梦中国内陆第一座核电站落户之迷


  新华网(2003-06-24 13:27:11)来源:21世纪经济报道  


  咸宁市核电领导小组


  6月19日下午2时至6时,湖北省咸宁市政府一直在开会,议题只有一个:如何配合湖北省积极准备中的核电站项目,并争取成为最后的核电站选址。


  会议最后决定,成立咸宁市核电项目领导小组,由市委书记担任总顾问,市长任小组组长。同时成立咸宁市核电项目办公室(以下简称”核电办”),由该市计委主任出任核电办主任。


  ”我们的具体工作就是负责文字材料、接待等所有前期事宜。”咸宁市政府办公室经济科一位官员说。


  据其介绍,领导小组成员几乎囊括了咸宁市计委、经委、供电、国土等相关部门的负责人,其主要工作就是对该项目最后落实的争取,并全面协调该项目的前期准备事宜。而核电办更像一个临时的执行机构。


  据《楚天都市报》6月中旬的消息,今年六月,中国电力投资集团(以下简称”中电投”)副总经理张小鲁前往湖北,与湖北省常务副省长周坚卫签署了湖北核电项目合作开发协议。6月13日、14日,张小鲁一行前往实地进行两天的考察以后,将咸宁市通山县高坑乡被初步定为”优先候选厂址”之一。


  报道称,”中电投”副总经理张小鲁一行实地考察后认为:高坑乡地质构造简单,受地震影响较小;水文地质条件简单;取水距离近,具备建厂水源条件;临近长江、京珠高速公路、京广铁路,交通方便……符合核电站选址要求。


  14日,张小鲁表示,将积极争取使湖北核电项目早日纳入国家规划。同日,湖北省常务副省长周坚卫要求保护好初选厂址。


  由于目前中国已经建设成功的秦山核电站和大亚湾核电站分别位于浙江省和广东省,均为经济发达的沿海省份。如果此次湖北方面的努力获得成功,将成为内陆首家核电站。


  但是,湖北省有关方面对相关情况三缄其口。18日,记者致电湖北省计委电力处,该处一位”专门对此发言”的女性官员拒绝发布任何公开消息。


  10年核电梦


  至今,湖北的核电梦已经整整做了十年。


  ”目前的优选地址高坑乡就是上次的优选厂址之一。”湖北省电力公司一位知情人士说。


  1993年2月,《湖北电力报》披露说,1989年,湖北省就成立了一个核电站前期工作委员会,由当时的副省长徐鹏航挂帅。同年,省有关部门下达开展湖北省核电站前期预可行性研究的任务,由省电力开发公司拨款21万元作为研究经费。中南电力设计院和核工业总公司105所等方面承担研究任务并组建踏勘选厂工作组。


  1989年末到1990年初,工作组风尘仆仆地踏勘了9个县市的20个点,最后确定了通山县高坑乡以及位于浠水、英山、罗田三县交界处的白莲河、阳新县黄峡口、薪春县高家湾、嘉鱼县邻工山等五个优选厂址。


  1991年6月,《湖北省核电站工程初步可行性研究中间报告》(以下简称”《报告》”)及5个专题报告完成,正式报送省政府和有关部门。


  《报告》提出,根据湖北省用电负荷增长情况,核电站规划容量初步可按240-360万千瓦考虑。一期工程先按2×60万千瓦国产设备考虑,并争取在2005年前投产。


  但是这个《报告》在报送有关部门以后,没了下文。”具体原因不详。”那位知情人士说。


  湖北的核电梦并未因此停止。预选厂址所在地区的态度积极而明确,黄冈、咸宁地区行政公署于1990年和1991年相继致函省有关部门,请求将湖北核电站定址本区。


  1993年,湖北电机工程学会在东湖梨园举办学术报告会,报告的专题就是”湖北核电工程初步可行性研究”。


  当时的电力专家们认为,从该省的国民经济发展状况和全省远景能源结构等方面来看,湖北核电站不是要不要建的问题,而是什么时候着手建,也不是建一座的问题,而是如何加强规划,有计划地逐步扩大规模,最终形成湖北省的核电站群。


  湖北省的核电梦与该省的实际情况有关。湖北省电力公司一位专家对记者分析说:”首先湖北没有煤,三峡工程一上,水电的比重就非常大了,如果没有火电或核电,就会缺乏常规电源的平衡,特别是在峰枯期,电力供应有很大的压力。”


  ”如果火电多了铁路的压力又会很大。”这位专家说,”考虑到这些具体情况,湖北想搞核电是符合逻辑的”。


  湖北电力部门的统计显示,2002年,湖北省全社会用电量为562亿千瓦时,其中1~9月用电量增速6.17%,10~12月份增速为12%,今年1~3月增速达到了17.54%,预计今年内夏季湖北主网用电量最大负荷将突破1000万千瓦。


  由于全省火电比例的不均衡和可调峰水电机组的缺乏,湖北省经贸委电力处副主任刘文忠此前接受采访时说,”我们的问题是调峰调值的问题:丰水期缺高峰电力,枯水期缺电量。”


  单相思?


  6月18日,湖北省电力公司一位专家对记者说:”社会和民间的反响会对这个工程产生很多微妙的影响。”


  据这位专家所了解的情况,核电工程目前也只是一种想法,能不能列入国家计划,”我看难度是非常大的”。


  ”中下游其他地区是否同意?协调难度应该非常大。”这位专家说。


  6月19日,中科院核设备安全与可靠性中心副主任刘振林对记者分析说,从安全角度来说,目前要在内陆搞核电站已经不是问题。因为,在海边主要是考虑到利用海水冷却的问题,而在内地,有许多大江或者大河,也可以达到这个目的。而在沿海建立核电站的另一个原因,是因为沿海经济比较发达,能源需求量比较大,不仅是从安全角度考虑。


  刘振林介绍,在美国,核电占了全国电量的20%,而法国更高,达到50%,在比利时占到70%。”很多核电站都建在内河的沿岸。”他认为,在中国西部地区,拥有丰富的大江大河,湖北在这方面也有优势。


  但刘认为,湖北要搞核电,应该考虑更多因素。”核电站是一个投资大、周期较长的项目,是一个系统工程。”刘说。


  今年1月,中国核工业集团公司副总经理孙勤曾透露,自十八年前开工建设秦山核电站至今,中国境内已建成和在建的核电站已达六座共十一台机组,总装机容量为八百七十万千瓦,其全年发电量已占全国发电总量的百分之二以上。


  这六座核电站分别为浙江省的秦山(一期)核电站、秦山核电二期工程和秦山核电三期工程,广东省的大亚湾核电站和岭澳核电站,以及江苏省的田湾核电站,其中有四座共八台机组是于”九五”期间开工建设的。


  核电站投资大,建设周期长,但核电成本比火电低20%~40%。据专家分析,核电与煤电的投资比大体为1∶1.5或1∶1.6。但是核原料价格便宜,仅占发电成本的20%左右。煤电燃料则占发电成本的80%。


  而从燃料运输的角度来看,核电的诱惑力更为突出。一座100万千瓦的燃煤电厂,每年消耗300万吨原煤。平均每天要卸一艘万吨轮,或是120节运煤车皮。同等容量的核电厂,每年只需要补充约30吨核燃料,运输费用微不足道。


  ”而且因为核电站建设周期长,是一个涉及到很多行业的工程,”周振林分析说,”如果湖北搞核电站,可以拉动当地的经济,比如像武汉锅炉厂等肯定都将从中获益。”


  20日,记者致电国家发展和改革委员会,得到的回答是:”对于项目我们拒绝透露。”而记者当日从中电投公司一位发言人处得到消息,项目合作的另一方,中国电力投资公司目前并未向有关部门递交相关立项报告。


  这位发言人表示:”此前中电投与湖北省签定的只是一个意向性协议,做不做现在还完全不知道,获得国家批准是一个前提。”



标签:

posted by Caiwangqin, 07:01 | Permalink | 0 comments |

收到了魔派寄来的新年贺卡

2008年1月10日星期四


收到了魔派寄来的新年贺卡,行书不错,很潇洒。第一次对魔派有印象时我还在广州,那是2005年中期,看到了他洋洋洒洒的对UUZone的评论,然后终于在2006年杭州中文网志年会上见了面。有”与君初相识,犹如故人归”的感觉,只是他的Blog两年多来每一篇都是洋洋洒洒,我没办法全部看完,放心吧,新的一年我仍是你的忠实订阅者,用GR.


谢谢这个老男人,祝你新的一年好运!


标签:

posted by Caiwangqin, 02:44 | Permalink | 0 comments |

Install MogileFS on Debian Sarge (Complete version)

2008年1月7日星期一

先转一篇网上的指引,我的安装过程是在这篇文章下进行的。由于这篇唯一的在Debian平台上安装MogielFS的文档被GFW了,全文转发一下(如果你也需要在Debian上安装MogileFS,建议看完本篇BLOG再进行,后面有补充):



Another How to Install MogileFS - Debian Sarge


This is created from a bunch of sources. You may notice that some of it comes from the other How To. I have tested this many times and it works great!


Doug Kersten


INSTALLING MOGILEFS

If you haven’t already done so add user mogilefsd:


adduser mogilefsd


mkdir /etc/mogilefs


cd /etc/mogilefs


Apt-get install subversion


svn checkout http://code.sixapart.com/svn/mogilefs/trunk/

now you have the code.


apt-get install liblinux-aio-perl


apt-get install libbsd-resource-perl


apt-get install libcompress-zlib-perl


apt-get install libnet-netmask-perl

apt-get install libio-stringy-perl

apt-get install libwww-perl


perl -MCPAN -e shell;


Answer default to all questions until you get to the location information and then choose your country and then your default ftp site.


at the > prompt do this:


install X::Y


Do this with the following:


install Danga::Socket


install DBI


Where X::Y is the name of the missing module. You may have to do this several


times.


exit


Install PerlBal


Mkdir /etc/perlbal


cd /etc/perlbal


svn checkout http://code.sixapart.com/svn/perlbal/trunk


cd /etc/perlbal/trunk


perl Makefile.PL


make

make test


make install


Install MogileFS (mogilefsd and mogstored)


cd /etc/mogilefs/trunk/server


perl Makefile.PL


make


make install


now as root


mkdir /var/mogdata/dev1

As you add more devices add more of these directories


Now for the interesting part.


Install Mogadm (Mogile Utilities):


cd /etc/mogilefs/trunk/utils


perl Makefile.PL


make


make install


CREATE MYSQL DATABASE


You should have mysql installed. I’m going to assume you do.


Using phpadmin create a mog user (mog_user)


create a password for mog user (mogpass)


OR


Grant access to remote user by doing:

$> mysql -u root -prootpassword


$> GRANT usage ON . to mog_user@www.domainname.com (put the correct user/domain(source) here)

$> IDENTIFIED BY ‘mogpassword’;


$> GRANT ALL PRIVILEGES


$> ON . TO mog_uer@www.domainname.com WITH GRANT OPTION;


exit


/etc/init.d/mysql restart


Automatically create a database for the mogilefs:


cd etc/mogilefs/trunk/server


vi mogdbsetup


edit the following:


dbhost => “localhost”,


dbname => “mogilefs”,


dbrootuser => “root”,


dbrootpass => “root_password”,


dbuser => “mog_user”,


dbpass => “mogpass”,


save and run /etc/mogilefs/trunk/server/mogdbsetup


you will be asked a series of questions. Answer yes to them all.


The mogilefs database should be created. Check in phpmyadmin to verify.


Remove the id and password information when you are finished from mogdbsetup.


YOU MUST DO THIS it solves errors about lib path when running mogadm are solved by the following:


Do this - to set up MogileFS.pm go to the /etc/mogilefs/trunk/api/perl directory and do


perl Makefile.PL


make


make test


make install (assuming all goes well).


You may have to cpan install something based on the errors from perl Makefile.PL.


Install Mogilefs utils:


cd /etc/mogilefs/trunk/utils


perl Makefile.PL


make


make test


make install


Configure Mogstored:


On each storage server, create a configuration file at /etc/mogilefs/mogstored.conf with the following:


httplisten=0.0.0.0:7500


mgmtlisten=0.0.0.0:7501


docroot=/var/mogdata


Startup Mogstored:


open a putty session as root and type mogstored. Mogstored should start.


Configure MogileFS:


edit the bold areas of the mogilefsd.conf file:


cp /etc/mogilefs/trunk/server/conf/mogilefsd.conf
/etc/mogilefs/mogilefsd.conf


#daemonize = 1


db_dsn = DBI:mysql:mogilefs:host=127.0.0.1


db_user = mog_user


db_pass = dbpass


conf_port = 7001


listener_jobs = 10


delete_jobs = 1


replicate_jobs = 5


mog_root = var/mogdata


reaper_jobs = 1


launch new putty session ( I use putty: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html


for my ssh sessions to the server.).


login as mogilefsd


at the command prompt run mogilefsd


Use ‘mogadm’ to add each storage server to the database.

The following example would add the host mogilestorage.yourdomain.com as a storage server, assuming that mogilestorage.yourdomain.com had an IP address of 192.168.42.3 (listening on port 7500) and your tracker had an IP address of 192.168.42.1 (listening on port 6001):


# mogadm –lib=/usr/local/share/perl/5.8.4 –trackers=192.168.42.1:6001 host add mogilestorage –ip=192.168.42.3 –port=7500 –status=alive


You can confirm that your host(s) were added with the following command;


# mogadm –lib=/usr/local/share/perl/5.8.4 –trackers=192.168.42.1:6001 host list


You also need to add devices for each storage host. If you don’t provide a device id mogadm is supposed to do it for you… in practice I find it dies with an error, so you will need to manually add a unique device id after the host:

# mogadm –lib=/usr/local/share/perl/5.8.4 –trackers=192.168.42.1:6001 device add mogilestorage 1


Finally, add the correctly-name device (folder) to each storage host. I have been unable to get the tools to handle this well, so I am probably doing something wrong. As a workaround, I used the modadm device list command to see what device names were assigned and then I added the folders to my storage hosts. Run the following command:


# mogadm –lib=/usr/local/share/perl/5.8.4 –trackers=192.168.42.1:6001 device list


It will list each host and the device name followed by its status and storage available. Here is example output:


mogilestorage 1: alive


used(G) free(G) total(G)


dev1: alive 0.892 67.772 68.664


This means “mogilestorage” has a host id of “1″ and it has one device named “dev1″ on it and that device is in the “alive” state (your other statistics will probably be zeros). Using the example output above, you would simply create the directory on mogilestorage.yourdomain.com:

You can also test using mogadm:


mogadm –trackers=127.0.0.1:7001 check


use mogadm to add the host:

mogadm –trackers=127.0.0.1:7001 host add host1

domain:

mogadm –trackers=127.0.0.1:7001 domain add storage

and class:

mogadm –trackers=127.0.0.1:7001 class add storage files.


Go into phpmyadmin, open the hosts table and change the host status to alive and add a device with device id 1, host id 1 and status = alive in the device table.


OR


mogadm –trackers=127.0.0.1:7001 device add device1 1


and mark the device alive


mogadm –trackers=127.0.0.1:7001 device mark host1,cin 1 alive


check your devices:


mogadm –trackers=127.0.0.1:7001 device list


Check it out:


mogadm –trackers=127.0.0.1:7001 check


If everything checks out ok you will see the following:


Checking trackers…


127.0.0.1:7001 … OK


Checking hosts…


1 host1 … OK


Checking devices…


host device size(G) used(G) free(G) use%



1 dev1 138.236 0.143 138.094 0.10%



total: 138.236 0.143 138.094 0.10%


Once everything is working you can daemonize mogilefsd:


edit the mogilefsd.conf file and remove the # in front of daemonize:


vi /etc/mogilefs/mogilefsd.conf


daemonize = 1


db_dsn = DBI:mysql:mogilefs:host=127.0.0.1


db_user = mog_user


db_pass = dbpass


conf_port = 7001


listener_jobs = 10


delete_jobs = 1


replicate_jobs = 5


mog_root = var/mogdata


reaper_jobs = 1


To start mogstored as a daemon type:


mogstored -d


To test and see if it’s mogstored that’s messed up or something along


the way, try telnetting to your mogstored (port 7500 by default) and


doing this:


PUT /dev1/test HTTP/1.0


Content-length: 4


test


See if that creates the ‘test’ file in your /var/mogdata/dev1 directory.


If it works, good, if it doesn’t, you should get back a 404/something with


a more detailed error message.


Now put a file onto mogstored via mogilefsd (tracker):


cd /etc


mogtool –trackers=127.0.0.1:7001 –domain=domainname –class=classname inject motd motd


check /var/mogdata/dev1/0/000/000 for a file named xxxxxxxxxx.fid . If the file exists everything is successful.


Now delete the file:


mogtool –trackers=127.0.0.1:7001 –domain=domainname –class=classname delete motd


check /var/mogdata/dev1/0/000/000 and the file should be gone.


It’s all good!



在以上安装过程需要补充以下几点:



  • 使用cpan安装 String::CRC32 库,这是依赖项(感谢Yupoo的Zola Zhou):


> cpan String::CRC32




  • 在docroot目录下手动建立device目录,如:


# mkdir -p /vag/mogdata/dev1




  • 使用mogadm管理host, device时,先要设置host alive, 才能设置该host下的device为alive:


mogadm –trackers=127.0.0.1:7001 device mark host1,cin 1 alive



标签:

posted by Caiwangqin, 02:53 | Permalink | 0 comments |