Server2僅運行nova的運算服務。html
安裝64位Ubuntu12.04服務器。python
安裝網橋軟件:mysql
sudo apt-get install bridge-utilssql
編輯 /etc/network/interfaces文件,以下所示:ubuntu
auto loswift
iface lo inet loopbackwindows
auto eth0centos
iface eth0 inet staticapi
address 10.10.10.3瀏覽器
netmask 255.255.255.0
broadcast 10.10.10.255
gateway 10.10.10.1
dns-nameservers 10.10.8.3
auto eth1
iface eth1 inet static
address 192.168.3.2
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
重啓網絡:
sudo /etc/init.d/networking restart
安裝NTP軟件包:
sudo apt-get install ntp
編輯 /etc/ntp.conf文件,增長以下內容以同步至server1:
server 10.10.10.2
重啓NTP服務使配置生效:
sudo service ntp restart
安裝Nova及其依賴包:
sudo apt-get install nova-compute
以下所示,編輯 /etc/nova/nova.conf文件。該文件與Server1中的一致:
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--state_path=/var/lib/nova
--lock_path=/run/lock/nova
--allow_admin_api=true
--use_deprecated_auth=false
--auth_strategy=keystone
--scheduler_driver=nova.scheduler.simple.SimpleScheduler
--s3_host=10.10.10.2
--ec2_host=10.10.10.2
--rabbit_host=10.10.10.2
--cc_host=10.10.10.2
--nova_url=http://10.10.10.2:8774/v1.1/
--routing_source_ip=10.10.10.2
--glance_api_servers=10.10.10.2:9292
--p_w_picpath_service=nova.p_w_picpath.glance.GlanceImageService
--iscsi_ip_prefix=192.168.4
--sql_connection=mysql://novadbadmin:novasecret@10.10.10.2/nova
--ec2_url=http://10.10.10.2:8773/services/Cloud
--keystone_ec2_url=http://10.10.10.2:5000/v2.0/ec2tokens
--api_paste_config=/etc/nova/api-paste.ini
--libvirt_type=kvm
--libvirt_use_virtio_for_bridges=true
--start_guests_on_host_boot=true
--resume_guests_state_on_host_boot=true
# vnc specific configuration
--novnc_enabled=true
--novncproxy_base_url=http://10.10.10.2:6080/vnc_auto.html
--vncserver_proxyclient_address=10.10.10.2
--vncserver_listen=10.10.10.2
# network specific settings
--network_manager=nova.network.manager.FlatDHCPManager
--public_interface=eth0
--flat_interface=eth1
--flat_network_bridge=br100
--fixed_range=192.168.4.1/27
--floating_range=10.10.10.2/27
--network_size=32
--flat_network_dhcp_start=192.168.4.33
--flat_injected=False
--force_dhcp_release
--iscsi_helper=tgtadm
--connection_type=libvirt
--root_helper=sudo nova-rootwrap
--verbose
從新啓動Server2上的nova-compute服務:
sudo service restart nova-compute
利用以下命令測試雲中第二個運算節點(即Server2)是否正常運行:
sudo nova-manage service list
Binary Host Zone Status State Updated_At
nova-network server1 nova enabled :-) 2012-04-20 08:58:43
nova-scheduler server1 nova enabled :-) 2012-04-20 08:58:44
nova-volume server1 nova enabled :-) 2012-04-20 08:58:44
nova-compute server1 nova enabled :-) 2012-04-20 08:58:45
nova-cert server1 nova enabled :-) 2012-04-20 08:58:43
nova-compute server2 nova enabled :-) 2012-04-21 10:22:27
若是看到相似結果,則說明安裝已經成功能夠使用。
至此,Server2安裝完畢!
安裝64位Ubuntu12.04桌面版。
以下所示,編輯 /etc/nova/nova.conf文件:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.10.10.4
netmask 255.255.255.0
broadcast 10.10.10.255
gateway 10.10.10.1
dns-nameservers 10.10.8.3
安裝NTP軟件包:
sudo apt-get install -y ntp
編輯 /etc/ntp.conf文件,增長以下內容以同步至server1:
server 10.10.10.2
重啓NTP服務使配置生效:
sudo service ntp restart
如前所述,Ubuntu12.04桌面版用來製做鏡像,一樣它也能夠使用nvoa、glance和swift命令行工具管理雲。
使用下列命令安裝咱們須要的命令行工具:
sudo apt-get install python-novaclient glance-client swift
接着安裝qemu-kvm:
sudo apt-get install qemu-kvm
輸入環境變量,並將其添加進 ~/.bashrc腳本中:
export SERVICE_TOKEN=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_AUTH_URL="http://10.10.10.2:5000/v2.0/"
export SERVICE_ENDPOINT=http://10.10.10.2:35357/v2.0
運行nova和glance命令查看是否與OpenStack正常鏈接:
nova list
+--------------------------------------+------------+--------+----------------------+
| ID | Name | Status | Networks
|
+--------------------------------------+------------+--------+----------------------+
| 25ee9230-6bb5-4eca-8808-e6b4e0348362 | myinstance | ACTIVE | private=192.
168.4.35 |
| c939cb2c-e662-46e5-bc31-453007442cf9 | myinstance1| ACTIVE | private=192.
168.4.36 |
+--------------------------------------+------------+--------+----------------------+
glance index
ID Name Disk Container Size
Format Format
------------------------------------ ------------------------------
----------------
65b9f8e1-cde8-40e7-93e3-0866becfb9d4 windows qcow2 ovf
7580745728
f147e666-990c-47e2-9caa-a5a21470cc4e debian qcow2 ovf
932904960
f3a8e689-02ed-460f-a587-dc868576228f opensuse qcow2 ovf
1072300032
aa362fd9-7c28-480b-845c-85a5c38ccd86 centoscli qcow2 ovf
1611530240
49f0ec2b-26dd-4644-adcc-2ce047e281c5 ubuntup_w_picpath qcow2 ovf
1471807488
打開瀏覽器輸入Server1的IP地址,如:http://10.10.10.2,便進入管理面板的登錄頁面。使用用戶名「admin」和密碼「admin」進行登錄來管理您剛建好的OpenStack吧。
如今,所有安裝結束。