Ubuntu 12.04 Openstack Essex 安装(多节点)

参考http://www.chenshake.com/ubuntu-12-04-openstack-essex-multinode-installation/

 

 

一:准备

安装bridge和iscsi相关,虚拟机使用nova-volume服务

apt-get -y install open-iscsi open-iscsi-utils bridge-utils

重启网络服务

/etc/init.d/networking restart

2:设置环境变量

cat >/root/novarc <<EOF
export CONTROLLER_IP=10.1.199.17
export MASTER="$(/sbin/ifconfig eth0 | awk '/inet addr/ {print $2}' | cut -f2 -d ":")"
EOF

你需要根据你的情况,调整控制节点的IP。调整完后,运行下面命令,设置自己的变量

source novarc
echo "source novarc">>.bashrc

2:设置NTP

apt-get -y install ntp

编辑 /etc/ntp.conf, 指向控制节点的ntp服务器

# Use Ubuntu's ntp server as a fallback.
#server ntp.ubuntu.com
server 10.1.199.17

或者运行下面命令

sed -i -e " s/server ntp.ubuntu.com/server $CONTROLLER_IP/g" /etc/ntp.conf

 

 

 

 

二:安装Openstack

1:安装软件

计算节点,至少是需要安装nova-api,nova-network,nova-compute,还需要安装keystone client,

apt-get install -y nova-api  nova-common nova-compute \
nova-compute-kvm  nova-network  \
python-nova python-novaclient \
python-keystone python-keystoneclient 

2: 编辑 /etc/nova/api-paste.ini , 修改末尾3行

#admin_tenant_name = %SERVICE_TENANT_NAME%
#admin_user = %SERVICE_USER%
#admin_password = %SERVICE_PASSWORD%
admin_tenant_name = service
admin_user = nova
admin_password = password

或者运行下面命令,直接复制控制节点的文件过来就可以。

scp root@$CONTROLLER_IP:/etc/nova/api-paste.ini /etc/nova/

3:编辑/etc/nova/nova.conf 文件,

这个文件和控制节点区别不大,就是vnc的地方,需要调整一下。

scp root@$CONTROLLER_IP:/etc/nova/nova.conf /etc/nova/nova.conf

修改vnc设置

###### NOVNC CONSOLE
novnc_enabled=true
novncproxy_base_url= http://10.1.199.17:6080/vnc_auto.html
vncserver_proxyclient_address=10.1.199.18
vncserver_listen=10.1.199.18

或者直接使用下面命令实现修改,其实就是用eth0的IP替换。

sed -i 's/^vncserver_proxyclient_address.*$/vncserver_proxyclient_address='"$(/sbin/ifconfig eth0 | awk '/inet addr/ {print $2}' | cut -f2 -d ":")"'/g' /etc/nova/nova.conf
sed -i 's/^vncserver_listen.*$/vncserver_listen='"$(/sbin/ifconfig eth0 | awk '/inet addr/ {print $2}' | cut -f2 -d ":")"'/g' /etc/nova/nova.conf

4:设置目录权限

chown -R nova:nova /etc/nova
 
nova.conf内容如下:

[DEFAULT] ###### LOGS/STATE #verbose=True verbose=False

###### AUTHENTICATION auth_strategy=keystone

###### SCHEDULER #--compute_scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler scheduler_driver=nova.scheduler.simple.SimpleScheduler

###### VOLUMES volume_group=nova-volumes volume_name_template=volume-%08x iscsi_helper=tgtadm

###### DATABASE sql_connection=mysql://nova:password@192.168.241.100/nova

###### COMPUTE libvirt_type=kvm #libvirt_type=qemu connection_type=libvirt instance_name_template=instance-%08x api_paste_config=/etc/nova/api-paste.ini allow_resize_to_same_host=True libvirt_use_virtio_for_bridges=true start_guests_on_host_boot=true resume_guests_state_on_host_boot=true

###### APIS osapi_compute_extension=nova.api.openstack.compute.contrib.standard_extensions allow_admin_api=true s3_host=192.168.241.100 cc_host=192.168.241.100

###### RABBITMQ rabbit_host=192.168.241.100

###### GLANCE image_service=nova.image.glance.GlanceImageService glance_api_servers=192.168.241.100:9292

###### NETWORK network_manager=nova.network.manager.FlatDHCPManager force_dhcp_release=True dhcpbridge_flagfile=/etc/nova/nova.conf dhcpbridge=/usr/bin/nova-dhcpbridge firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver public_interface=eth0 flat_interface=eth1 flat_network_bridge=br100 fixed_range=192.168.22.0/24 multi_host=true

###### NOVNC CONSOLE novnc_enabled=true novncproxy_base_url= http://192.168.241.100:6080/vnc_auto.html vncserver_proxyclient_address=192.168.241.100 vncserver_listen=192.168.241.100

########Nova logdir=/var/log/nova state_path=/var/lib/nova lock_path=/var/lock/nova

#####MISC use_deprecated_auth=false root_helper=sudo nova-rootwrap

 

5:重启服务

service libvirt-bin restart
service nova-network restart
service nova-compute restart
service nova-api restart

创建一个脚本,这样比较方便。restart.sh

#!/bin/bash
for a in libvirt-bin nova-network  nova-compute \
nova-api ; do service "$a" stop; done
for a in libvirt-bin nova-network  nova-compute \
nova-api ; do service "$a" start; done

root@node18:~# chmod +x restart.sh 

root@node18:~# ./restart.sh 
libvirt-bin stop/waiting
nova-network stop/waiting
nova-compute stop/waiting
nova-api stop/waiting
libvirt-bin start/running, process 4642
nova-network start/running, process 4662
nova-compute start/running, process 4673
nova-api start/running, process 4688

这时候大功告成。

可以运行 nova-manage service list 查看结果

 

5:重启服务
service libvirt-bin restart
service nova-network restart
service nova-compute restart
service nova-api restart
创建一个脚本,这样比较方便。restart.sh
#!/bin/bash
for a in libvirt-bin nova-network  nova-compute \
nova-api ; do service "$a" stop; done
for a in libvirt-bin nova-network  nova-compute \
nova-api ; do service "$a" start; done
root@node18:~# chmod +x restart.sh 

root@node18:~# ./restart.sh 
libvirt-bin stop/waiting
nova-network stop/waiting
nova-compute stop/waiting
nova-api stop/waiting
libvirt-bin start/running, process 4642
nova-network start/running, process 4662
nova-compute start/running, process 4673
nova-api start/running, process 4688
这时候大功告成。
可以运行 nova-manage service list 查看结果
 
 
发现计算节点没有加载进来。卸载nova-api,计算节点能加进来,再安装上nova-api,计算节点也可以加进来,原因未知。
 
另一个同事是这么安装的计算节点,没有出现过上述问题,下次可以按照这个实验一下:
apt-get -y install open-iscsi open-iscsi-utils bridge-utils
apt-get install -y nova-api  nova-common nova-compute nova-compute-kvm  nova-network python-nova python-novaclient python-keystone python-keystoneclient
 
 
 
 
 
 
 
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值