第一步:安装 scons
OpenNebula 需要使用scons这个软件来生成Makefile文件,并自动编译, 首先必须确认系统已经安装scons。
如果没有安装, 请自行安装。 最简单的办法是使用命令 yum install scons 或者 apt-get install scons
如果这两个自动化的方法都不行, 那自己下载 scons, 我下载的是 scons-2.1.0.tar.gz
解压后进入目录里面
[root@localhost ~]# cd scons-2.1.0 [root@localhost scons-2.1.0]# python setup.py install安装完成后, 进入到 OpenNebula-2.0.1目录继续。
第二步:执行scons进行编译
[root@localhost opennebula-2.0.1]# pwd /root/opennebula-2.0.1 [root@localhost opennebula-2.0.1]# scons scons: Reading SConscript files ... Testing recipe: pkg-config Error calling pkg-config xmlrpc_server_abyss++ --static --libs Testing recipe: xmlrpc-c-config Error calling xmlrpc-c-config c++2 abyss-server --libs --cflags Testing recipe: mixed hardcoded libraries and xmlrpc-c-config (debian lenny) Error calling xmlrpc-c-config c++2 abyss-server --libs --cflags Testing recipe: hardcoded libraries for Mac OS X (installed using port) g++ .xmlrpc_test/xmlrpc_test.27c461.cc -o .xmlrpc_test/xmlrpc_test.27c461.cc.out -I/opt/local/include -L/opt/local/lib -lwwwxml -lxmltok -lxmlparse -lwwwzip -lwwwinit -lwwwapp -lwwwtelnet -lwwwhtml -lwwwnews -lwwwhttp -lwwwmime -lwwwgopher -lwwwftp -lwwwfile -lwwwdir -lwwwcache -lwwwstream -lwwwmux -lwwwtrans -lwwwcore -lwwwutils -lmd5 -ldl -lz -lpthread -lxmlrpc_client++ -lxmlrpc_client -lxmlrpc++ -lxmlrpc -lxmlrpc_util -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_server_abyss++ -lxmlrpc_server++ -lxmlrpc_server_abyss -lxmlrpc_server -lxmlrpc_abyss 1>>.xmlrpc_test/xmlrpc_test.27c461.cc.log 2>&1 Error searching for xmlrpc-c libraries. Please check this things: * You have installed development libraries for xmlrpc-c. One way to check this is calling xmlrpc-c-config that is provided with the development package. * Check that the version of xmlrpc-c is at least 1.06. You can do this also calling: $ xmlrpc-c-config --version * If all this requirements are already met please send log files located in .xmlrpc_test to the mailing list. TypeError: 'str' object is not callable: File "/root/opennebula-2.0.1/SConstruct", line 150: exit(-1)
解决办法如下 :
wget http://centos.karan.org/el5/extras/testing/SRPMS/xmlrpc-c-1.06.18-1.el5.kb.src.rpm rpmbuild --rebuild xmlrpc-c-1.06.18-1.el5.kb.src.rpm cd /usr/src/redhat/RPMS/i386/ rpm -i xmlrpc-c-1.06.18-1.x86_64.rpm rpm -i xmlrpc-c-devel-1.06.18-1.x86_64.rpm
xmlrpc-c 这个包的安装,也可以用源代码来安装。
wget http://sourceforge.net/projects/xmlrpc-c/files/Xmlrpc-c%20Super%20Stable/1.16.34/xmlrpc-c-1.16.34.tgz tar zxf xmlrpc-c-1.16.34.tgz cd xmlrpc-c-1.16.34/ ./configure make && make install
第三步:安装 OpenNebula,并配置
[root@localhost opennebula-2.0.1]# mkdir -p /srv/cloud/one/ [root@localhost opennebula-2.0.1]# ./install.sh -d /srv/cloud/one/ [root@localhost opennebula-2.0.1]# ls /srv/cloud/one/ bin etc include lib share var
# cd /root/ # mkdir .one # cd .one/ # echo "oneadmin:password" > one_auth# vi /etc/one/oned.conf ... IM_MAD = [ name = "im_xen", executable = "one_im_ssh", arguments = "xen" ] VM_MAD = [ name = "vmm_xen", executable = "one_vmm_ssh", arguments = "xen", default = "vmm_ssh/vmm_ssh_xen.conf", type = "xen" ]
下来就可以启动了。[root@localhost .one]# one start oned and scheduler started