最近需要做一个Oracle BPM Enterprise for WebLogic Server的VM用于测试,而且操作系统得是Linux x86,而我自己跑x86_64。
虽然根据Configuration Matrix,Ubuntu和Oracle 10g XE不是被支持的组合,但是用于测试,distro根本不会是一个问题。因为一直以来,我怕麻烦一直用Debian或者Ubuntu来作测试了:-)
环境:
OS: Ubuntu 8.10 Intrepid Ibex x86
Kernel: 2.6.27-7-generic
JDK: Sun JDK 1.6.0_10
Weblogic Server 10gR3 on JRockit 1.6.0_05 (R27.6.0-50 linux ia32)
注:我用的是Oracle Service Bus 10gR3的安装介质,包含了Weblogic Server 10gR3。
Oracle 10g XE for Debian/Ubuntu .deb package
注意:为避免权限问题,请用root来安装OBPM和WLS,否则以后启动WLS或者OBPM的时候会碰到权限问题,用一下sudo -s总比之后再用一堆chown/chgrp/chomod好吧?
安装Oracle Service Bus和Oracle BPM 10gR3完毕之后
1. 启动用root启动admin center
/opt/OracleBPMwlHome/bin/./obpmadmcenter
2. Configuration – Directory tab,添加directory,更多信息请看官方安装指南。
通常设置都会自动完成,不像早期的5.7,一切Data Source,JMS modules,Realm都要手工配置,WAR/EAR要手工deploy。
不巧的是,progress bar在70%的时候停住了,叫我去看logs。

看了WLS和BPM Admin Center log之后发现如下的Exception,问题很明显是出在执行WLST的环节上:
java.io.FileNotFoundException: /opt/bea/user_projects/domains/bpm/config/config.xml (Too many open files)
原因很简单,常见的Linux发行版本由于安全原因对每个Terminal session或者用户的max open files默认数值太小导致的,这是WLS部署中常见的问题。
比较流行的发行版本,比如Debian/Ubuntu/Arch Linux/Gentoo的shell session限制都是1024。
大多数Linux发行版本中,正常情况下session中max open files数限制为1024,对于Weblogic Server部署过程来说太小了,必须增大。
临时解决方法:
只对某个Terminal中的session起作用,用以下命令增加该数值。
ulimit -n 2048
继续在此session中启动obpmadmcenter来配置directory和创建新的WLS domain用于部署bpm。如果选择修改一个已经存在的WLS domain的话,在执行启动脚本的Terminal session中需要用同样的方法增加该数值,否则多数会得到同样的错误。
ulimit -a
可以用来查看当前session user的各种限制,当然包括修改过的数值。
永久性解决方法:
1. 修改/etc/security/limits.conf (root)
增加如下
$user hard nofile 2048
$user是用来启动WLS的用户。
2048是建议的数值,若遇到同样问题可能需要再次增加。
或者干脆用*表示所有用户:
* soft nofile 2048
* hard nofile 4096
2. 其他来自Debian GNU/Linux官方文档和Oracle Technology Network的解决方法,直接修改内核参数,无须重启系统。
sysctl -w fs.file-max 65536
或者
echo "65536" > /proc/sys/fs/file-max
两者作用是相同的,前者改内核参数,后者直接作用于参数对应的虚拟文件系统(procfs, psuedo file system)上对应的文件而已。
可以用以下的命令查看新的限制
sysctl -a | grep fs.file-max
或者
cat /proc/sys/fs/file-max
修改内核参数
/etc/sysctl.conf
echo "fs.file-max=65536" >> /etc/sysctl.conf
sysctl -p
查看当前file handles使用情况:
sysctl -a | grep fs.file-nr
或者
cat /proc/sys/fs/file-nr
825 0 65536
另外一个命令:
lsof | wc -l
有点让我困惑的是,以上两个命令获得的结果总是不相同的;-(
此外,用sysctl来修改内核参数fs.file-max和用ulimit的区别,我花了不少时间研究,讨教了Linux/FreeBSD/Solaris/OpenSolaris老鸟Jockey同学,得到点拨之后终于基本弄清楚原委了。
基本上优先级:
soft limit < hard limit < kernel < 实现最大file descriptor数采用的数据结构所导致的限制
The Linux kernel provides the getrlimit and setrlimit system calls to get and set resource limits per process. Each resource has an associated soft and hard limit. The soft limit is the value that the kernel enforces for the corresponding resource. The hard limit acts as a ceiling for the soft limit: an unprivileged process may only set its soft limit to a value in the range from 0 up to the hard limit, and (irreversibly) lower its hard limit. A privileged process (one with the CAP_SYS_RESOURCE capability) may make arbitrary changes to either limit value.
作为测试环境,尤其是用VMWare guest OS的形式,安装OpenSSH Server, webmin, phpsysinfo等工具可以提高效率。
参考:
http://www.debian.org/doc/manuals/reference/ch-kernel.en.html
http://www.oracle.com/technology/pub/articles/smiley-11gr1-install.html
http://www.oracle.com/technology/pub/articles/smiley_10gdb_install.html
http://www.oracle.com/technology/pub/articles/smiley_rac10g_install.html
http://www.oracle.com/technology/pub/articles/hunter_rac10gr2_iscsi_2.htmlg
Related posts:
No Comments Now!
Be the first to comment on this entry.