星期四, 十二月 25, 2008

RDAC安装

1,从IBM网站下载RDAC的安装包。
注意事项:一定要保证软件版本与操作系统版本相匹配。
http://www.lsi.com/rdac/
2,放到服务器上后,开始安装。
假设文件已放到/usr/src/目录下:
cd /usr/src
tar zxvf rdac-LINUX-09.01.B5.55-source.tar.gz
cd /usr/src/linuxrdac-LINUX-09.01.B5.55
make
make install
注意事项:在asianux3下,make会报错。解决办法:修改文件/etc/issue。
修改前的内容:
Asianux Server 3 (Quartet)
Kernel \r on an \m
修改后的内容:
Asianux Server 3 release 5 (Quartet)
Kernel \r on an \m

3,修改启动内核。
vi /boot/grub/menu.lst
vi /boot/grub/menu.lst

#boot=/dev/hda
default=0
timeout=5
#splashimage=(hd0,6)/boot/grub/background.jpg
#hiddenmenu
title Red Flag DC Server 5.0 SP2 (2.6.9-42.7AX)
root (hd0,6)
kernel /boot/vmlinuz-2.6.9-42.7AX ro root=LABEL=/ vga=788
initrd /boot/mpp-2.6.9-42.7AX.img
保存退出并重新启动系统。
4,注意/etc/modprob.conf文件
安装前后该文件会有不少变化。
可能会需要在里添加一行options qla2xxx ql2xfailover=0
5,详细文档请参照解压后目录下的Readme.txt文件。
6,重启电脑前后,能够看到的SAN-LUN数量不一样多,至少有2倍。

附:qlogic驱动安装
1,到qlogic网站下载相应的驱动。
2,解压文件
3,查看README.qla2xxx文件即可安装。
非常简单。
# tar -xvzf *.tgz
# cd qlogic
# ./drvrsetup (this extracts the source files directory into the current directory)
# cd qla2xxx-x.yy.zz
# ./extras/build.sh install
重启后确认已加载的驱动,
# lsmod | grep qla
qla2400 238336 0
qla2xxx 309664 2 qla2400
intermodule 37508 1 qla2xxx
scsi_mod 185400 9 sr_mod,usb_storage,mppVhba,qla2xxx,libata,aacraid,mppUpper,sg,sd_mod

星期五, 十二月 12, 2008

关于日志归档

这两天处理日志导致linux的文件系统过大,记录一下。

关于os标准服务的日志,一般可以用logrotate来处理。
如果是apache的access日志,有3种处理办法。
其1,用logrotate来处理。需要注意代码,/usr/bin/killall -HUP httpd 2> /dev/null || true ,否则可能不会记录新日志。
其2,用rotatelogs,修改httpd.conf文件。
建议写法:CustomLog "|/usr/local/apache/bin/rotatelogs /usr/local/apache/logs/%Y%m%d_access_log 86400 +480" common
其3,用cronolog,修改httpd.conf文件。
程序需要从http://www.cronolog.org/下载。

列举一下logrotate的配置方法。
可以编辑/etc/logrotate.conf文件来处理,也可以在/etc/logrotate.d/目录下新增一个文件。
例如:
vi /etc/logrotate.d/rflogview.zjs
/var/log/rflogview/system_info /var/log/rflogview/system_errors /var/log/rflogview/secure_info /var/log/rflogview/secure_errors {
#create 0600 root root
nocompress
notifempty
weekly
rotate 5
size 10M

sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

vi /etc/logrotate.d/admin
# This configuration is from VBird 2005/10/24
/var/log/admin.log {
monthly
size=10M
rotate 5
nocompress
sharedscripts
prerotate
/usr/bin/chattr -a /var/log/admin.log
endscript
sharedscripts
postrotate
/usr/bin/killall -HUP syslogd
/usr/bin/chattr +a /var/log/admin.log
endscript
}

星期二, 十一月 25, 2008

居然会遇到java的bug

在程序里用到了com.oreilly.servlet.multipart.BufferedServletInputStream的一段源码,居然会在运行的时候偶尔出现exeception,很是奇怪,跟踪了几次都无法找到原因,在google的时候,发现已经有人遇到此问题了,好像是jre或者application server的问题。不管是哪个层面的问题,反正已经超出我们能够理解的范畴了,记录一下。

根据http://www.servlets.com/soapbox/bugs.html网站的描述,已经确认是servlet的bug了。
Bug: File upload does not work with Apache JServ when uploading large binary files
Symptoms: When handling a file upload the com.oreilly.servlet.MultipartRequest class throws an ArrayIndexOutOfBoundsException.
Reason: JServ supports the older Servlet API 2.0 and in the API 2.0 source code for javax.servlet.ServletInputStream there's a bug in the readLine(byte[] buf, int off, int len) method where the len parameter is ignored, and as a result reading input lines that exceed the buf length will throw an ArrayIndexOutOfBoundsException.
Workaround: The com.oreilly.servlet library has implemented its own buffering to work around this issue. If you're using another library, upgrade to a server that supports Servlet API 2.1 or later.

http://www.javafaq.nu/java-example-code-1017.html
/**
* A BufferedServletInputStream wraps a
* ServletInputStream in order to provide input buffering and to
* avoid calling the the readLine method of the wrapped
* ServletInputStream.
*


* This is necessary because some servlet containers rely on the default
* implementation of the readLine method provided by the Servlet
* API classes, which is very slow. Tomcat 3.2, Tomcat 3.1, the JSWDK 1.0 web
* server and the JSDK2.1 web server are all known to need this class for
* performance reasons.
*


* Also, it may be used to work around a bug in the Servlet API 2.0
* implementation of readLine which contains a bug that causes
* ArrayIndexOutOfBoundsExceptions under certain conditions.
* Apache JServ is known to suffer from this bug.
*
* @author Geoff Soutter
* @version 1.1, 2001/05/21, removed block of commented out code
* @version 1.0, 2000/10/27, initial revision
*/


http://www.cs.unc.edu/Courses/jbs/documentation/oreilly/multipartparser/doc/com.oreilly.servlet.multipart.BufferedServletInputStream.html
java.lang.Object

+----java.io.InputStream

+----javax.servlet.ServletInputStream

+----com.oreilly.servlet.multipart.BufferedServletInputStream
public class BufferedServletInputStream
extends ServletInputStream A BufferedServletInputStream wraps a ServletInputStream in order to provide input buffering and to avoid calling the the readLine method of the wrapped ServletInputStream.
This is necessary because some servlet containers rely on the default implementation of the readLine method provided by the Servlet API classes, which is very slow. Tomcat 3.2, Tomcat 3.1, the JSWDK 1.0 web server and the JSDK2.1 web server are all known to need this class for performance reasons.
Also, it may be used to work around a bug in the Servlet API 2.0 implementation of readLine which contains a bug that causes ArrayIndexOutOfBoundsExceptions under certain conditions. Apache JServ is known to suffer from this bug.
Version:
1.1, 2001/05/21, removed block of commented out code
Author:
Geoff Soutter

星期二, 十月 28, 2008

这次是鸡蛋,下次是什么

看了这个新闻很是不爽,鸡蛋也出现问题了。正当我们还在因“三聚氰胺奶粉事件”而心有余悸时,一向被认为很安全的鸡蛋却又被查出含有三聚氰胺。
http://news.sina.com.cn/c/2008-10-28/020516535703.shtml

而这次首当其冲的竟然是咯咯哒。据其网站称,“咯咯哒”系列绿色营养鸡蛋出自优良生态环境,严格按绿色食品生产标准组织生产,无抗生素和药物残留、无激素及重金属残留。

其价格是一般菜市场上鸡蛋的2倍。

一直以来,我都认为普通鸡蛋可能含激素过多,不肯给mumu吃,都是在能买得起的范围内,买最好的吃,一般价格都比较高,也自认为会相对安全些。

没想到的,其实也该想得到。

也买过德青源的鸡蛋,开始也很贵,后来在沃尔玛会员店买大包装的,和普通鸡蛋的价差可以很小。

在三鹿奶粉事件中,其实问题也很简单。日产100顿的奶源基地,能卖出150顿牛奶出去,自然是加了水,加水太稀了,就加点别的东西以符合检测效果。

这次鸡蛋问题,也差不多。有关人士分析韩伟集团鸡蛋出事,有可能是有一部分鸡蛋是从市场上收购而来,并非韩伟集团自产。市场上的一般鸡蛋成本价在每枚3毛钱左右,而如集团养殖选用较高档次的鸡饲料,每枚鸡蛋成本在7毛钱左右。虽然成本上要低很多,但由于饲料品质、养殖过程不可控,可能导致收购来的鸡蛋质量不符合要求。

作为奥运赞助商的伊利牛奶可以出问题,号称国内最大蛋鸡饲养企业也就不难出问题了。

在市场经济的初期,不能指望生产者都那么自律,可是作为市场监管者的zf为啥不能给俺们一点希望呢。

在食品安全和医药安全面前,我们还能相信什么?!

如果你有足够的心理准备,可以看看这里,不保证这个链接能长期有效。
http://blog.sina.com.cn/s/blog_4c79cbab0100b82q.html

星期一, 十月 20, 2008

丑闻年

娱乐社会,如有雷同,纯属巧合。

什么叫幸福,幸福就是元旦没进乌鲁木齐,二月没去郴州,三月没逛拉萨,四月没到山东,五月没在汶川,六月没在贵州瓮安,七月没在上海当警察,八月没在新疆当兵……当然当然,最最幸福的就是今年没买房子,没买车子,没进股市,否则宝马进去,自行车出来;西服进去,三点式出来;老板进去,打工仔出来;博士进去,痴呆出来;姚明进去,潘长江出来;鳄鱼进去,壁虎出来;蟒蛇进去,蚯蚓出来;老虎进去,小猫出来;牵狗进去,被狗牵出来;男人进去,太监出来; 少女进去,老太婆出来;王石进去,王八出來;北京进去,汶川出来; 站着进去,躺着出来;巴西足球队进去,中国足球队出来;黄世仁进去,杨白劳出来;陈冠希进去,艳照门出来;总之,就是地球进去也是乒乓球出来。

星期一, 十月 06, 2008

两岁的mumu

木木会说哇好多人哦。
还会说肚子不舒服。
木木在麦当劳里边的儿童乐园里边玩,那里有个通道,通道上有三个洞,木木以前喜欢爬到那儿后探出脑袋和爸爸乐(藏猫猫),现在他喜欢躺里边把脚伸出来玩,爸爸探头过去找他玩还是挺高兴。
我在木木腿上吹响,说木木放了个屁,他就厥起屁股真的对我放了个屁。
可以挂在单杠上吊着玩。
自己会斜眼,会噘嘴,会耸肩膀,逗大人玩。
可以自己吃一点饭,但还不能快速喂饱自己。
木木喜欢看维尼跳跳虎,猫老鼠,天线宝宝。
木木吃了晚饭后,会关灯、关电视,拉着你的手去换鞋,说:出去玩。
简单说,木木长大了不少。




http://picasaweb.google.com/zhangjiansheng/2008Sep



http://picasaweb.google.com/zhangjiansheng/2008Oct

星期二, 九月 16, 2008

多美滋奶粉

由于近期令人头大的婴幼儿奶粉导致“肾结石三聚氰胺”事件,偶昨天(2008.09.15)很不放心的在超市又详细查看了一下多美滋奶粉的包装。

发现已然是达能旗下品牌了,很不解,印象里达能有一次新闻事件,回来一查才知道两个都是对的。多美滋已经被达能买下,达能也和娃哈哈闹过强行并购。

主要是担心多美滋的奶源问题,据售货员介绍,多美滋不是原装进口,而是进口奶粉(已经配好的)在上海包装。这年头家长需要学习的太多,真的担心这帮家伙在包装的时候重新进行配置,寄希望于大型跨国公司的品牌意识吧,人家这123亿欧元也不想打水漂啊。

好像纯进口的婴幼儿配方奶粉有这么几个:美素佳儿、恩贝尔、雅培、惠氏。

据说这些是合资国产:美赞臣、多美滋、雀巢、森永、味全、明治、澳优、万朝、施恩。

=============================
多美滋或纳入达能麾下
发布日期:2007-07-13
  达能两天前宣称将斥123亿欧元并购荷兰皇家纽密科乳品。倘若交易成功,那么去年加入皇家纽密科的英特尔多美滋将纳入达能麾下。
  达能集团与皇家纽密科已达成交易意向,达能同意以每股55欧元的高价收购皇家纽密科发行的所有流通股,共计123亿欧元。
  此举意味着达能或将重返潜力巨大的中国奶粉市场。早前达能曾在中国经营过奶粉业务,但由于多方面原因中途即告退出。
  皇家纽密科是全球最大婴儿食品制造集团,主品牌包括纽迪希亚、美乐宝、多美滋等。“多美滋”已连续三年夺得国内婴幼儿配方奶粉冠军。
  英特尔食品中国负责人表示,目前正在等待总部消息,尚不清楚多美滋中国策略是否变化。