Nimbus安装
类似亚马逊的EC2架构的IAAS云平台实现。
http://www.nimbus.com/
软件环境前提:
java 1.5以上
python 2.5以上,必须支持sqlite3:
$ python -c “import sqlite3” 不报错。
gcc
python-dev库和libssl-dev库。
apache ant 1.7以上。
随os的dhcp,可以:yum install dhcp
建立Nimbus需要的linux用户:
# groupadd nimbus
# useradd -m -d /home/nimbus -g nimbus -G root -s /bin/bash nimbus
# passwd nimbus
nimbus
# su – nimubs
$ vi ~/.bash_profile
export NIMBUS_HOME=/home/nimbus/nimbus-iaas-2.8
$ . ~/.bash_profile
安装Nimbus Services:
$ tar -zxvf nimbus-iaas-2.8-src.tar.gz
$ cd nimbus-iaas-2.8-src
$ ./install $NIMBUS_HOME
启动和停止:
$ cd $NIMBUS_HOME
$ ./bin/nimbus-iaas-2.8/bin/nimbus-version
Nimbus Version: 2.8
Documentation: http://www.nimbusproject.org/docs/2.8/admin/z2c/
Git: 043b28a50189b0528f2ed6adeca5229f3ba479cd
$ ./bin/nimbusctl stop
$ ./bin/nimbusctl start
Launching Nimbus services… OK
Launching Cumulus services… OK
$ ps axf |grep nimbus
29340 pts/3 Sl 0:38 /usr/java/default/bin/java -Dlog4j.configuration=container-log4j.properties -Dorg.newsclub.net.unix.library.path=/home/nimbus/nimbus-iaas-2.8/services/lib-native -DGLOBUS_LOCATION=/home/nimbus/nimbus-iaas-2.8/services/ -Djava.endorsed.dirs=/home/nimbus/nimbus-iaas-2.8/services//endorsed -DX509_CERT_DIR=/home/nimbus/nimbus-iaas-2.8/var/ca/trusted-certs -Djava.security.egd=file:///dev/urandom -classpath /home/nimbus/nimbus-iaas-2.8/services//lib/bootstrap.jar:/home/nimbus/nimbus-iaas-2.8/services//lib/cog-url.jar:/home/nimbus/nimbus-iaas-2.8/services//lib/axis-url.jar org.globus.bootstrap.Bootstrap org.globus.wsrf.container.ServiceContainer -p 8443
29444 pts/3 S 0:00 /home/nimbus/nimbus-iaas-2.8/ve/bin/python /home/nimbus/nimbus-iaas-2.8/ve/bin/cumulus
配置和启动DHCPD:
$ vi $NIMBUS_HOME/services/etc/nimbus/workspace-service/network-pools/public
…
# DNS server IP address (or ‘none’)
8.8.8.8
…
# hostname ipaddress gateway broadcast subnetmask [MAC]
pub02 10.24.1.180 10.24.1.1 none 255.255.255.0
pub03 10.24.1.181 10.24.1.1 none 255.255.255.0
pub04 10.24.1.182 10.24.1.1 none 255.255.255.0
pub05 10.24.1.183 10.24.1.1 none 255.255.255.0
$ vi $NIMBUS_HOME/services/etc/nimbus/workspace-service/network-pools/private
# DNS IP address (or ‘none’):
8.8.8.8
# hostname ipaddress gateway broadcast subnetmask [MAC]
priv002 10.24.1.180 10.24.1.1 none 255.255.255.0
priv003 10.24.1.181 10.24.1.1 none 255.255.255.0
priv004 10.24.1.182 10.24.1.1 none 255.255.255.0
priv005 10.24.1.183 10.24.1.1 none 255.255.255.0
$ ./bin/nimbusctl stop
$ ./bin/nimbusctl start
$ su – root
# cp /usr/share/doc/dhcp-*/dhcpd.conf.sample /etc/dhcpd.conf
# vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 10.24.1.0 netmask 255.255.255.0 {
option routers 10.24.1.1;
option subnet-mask 255.255.255.0;
option nis-domain “nimbus.org”;
option domain-name “nimbus.org”;
option domain-name-servers 8.8.8.8;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 10.24.1.40;
# option netbios-name-servers 10.24.1.40;
# — Selects point-to-point node (default is hybrid). Don’t change this unless
# — you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 10.24.1.100 10.24.1.254;
default-lease-time 21600;
max-lease-time 43200;
include “/home/nimbus/nimbus-iaas-2.8/services/var/nimbus/dhcpd.entries”;
}
注意:有些系统只能读取/etc/目录下的文件,不能读别的目录,这时候需要拷贝到/etc/下面。
# su – nimbus
$
查看Log:
$ vi $NIMBUS_HOME/var/cumulus.log
$ vi $NIMBUS_HOME/var/cumulus.log
建立Nimbus下的用户,跟上面的linux用户是没关系的:
$ mkdir $NIMBUS_HOME/home
$ ./bin/nimbus-list-users %
$ ./bin/nimbus-edit-user max.shu.cn@gmail.com
$ ./bin/nimbus-remove-user max.shu.cn@gmail.com
$ ./bin/nimbus-new-user -d $NIMBUS_HOME/home/maxshu max.shu.cn@gmail.com
cert : /home/nimbus/nimbus-iaas-2.8/home/maxshu/usercert.pem
key : /home/nimbus/nimbus-iaas-2.8/home/maxshu/userkey.pem
dn : /O=Auto/OU=NimbusCA/CN=max.shu.cn@gmail.com
canonical id : 901deb2a-14b8-11e1-831d-001e4f1bd705
access id : bIZXZO1ZMfubA5InmemVY
access secret : d4SpPDKQvyS18FEWO87ZJi4PB3BI8FomtkT0xYKXMM
url : None
web id : None
cloud properties : /home/nimbus/nimbus-iaas-2.8/home/maxshu/cloud.properties
安装客户端,这里假定跟services在同一台机器上,当然也可以不在同一台机器上:
$ tar -zxvf nimbus-cloud-client-020.tar.gz
$ cp $NIMBUS_HOME/home/maxshu/cloud.properties nimbus-cloud-client-020/conf/
$ cp $NIMBUS_HOME/var/ca/trusted-certs/* nimbus-cloud-client-020/lib/certs/
$ mkdir ~/.nimbus/
$ cp $NIMBUS_HOME/home/maxshu/*.pem ~/.nimbus/
$ cd nimbus-cloud-client-020
$ ./bin/cloud-client.sh –status
Querying for ALL instances.
There’s nothing running on this cloud that you own.
$ ./bin/cloud-client.sh –list
No files.
以上输出表示nimbus服务已经正常了。
客户端这里未完,待续。。。