OpenStack安裝與配置(下)

三、Server2


Server2僅運行nova的運算服務。


(一)安裝底層OS


安裝64Ubuntu12.04服務器。


(二)配置網絡


安裝網橋軟件:

sudo apt-get install bridge-utils


編輯 /etc/network/interfaces文件,如下所示:

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static

  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客戶端


安裝NTP軟件包:

sudo apt-get install ntp


編輯 /etc/ntp.conf文件,增加如下內容以同步至server1

server 10.10.10.2


重啓NTP服務使配置生效:

sudo service ntp restart



(四)Nova組件(僅nova-compute


安裝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

--image_service=nova.image.glance.GlanceImageService

--iscsi_ip_prefix=192.168.4

--sql_connection=mysql://novadbadmin:[email protected]/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安裝完畢!



三、Client1


(一)安裝OS


安裝64Ubuntu12.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客戶端


安裝NTP軟件包:

sudo apt-get install -y ntp


編輯 /etc/ntp.conf文件,增加如下內容以同步至server1

server 10.10.10.2


重啓NTP服務使配置生效:

sudo service ntp restart


(四)客戶端工具

如前所述,Ubuntu12.04桌面版用來製作鏡像,同樣它也可以使用nvoaglanceswift命令行工具管理雲。

使用下列命令安裝我們需要的命令行工具:

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


運行novaglance命令查看是否與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 ubuntuimage   qcow2    ovf      

 1471807488


(五)管理面板


打開瀏覽器輸入Server1IP地址,如:http://10.10.10.2,便進入管理面板的登陸頁面。使用用戶名“admin”和密碼“admin”進行登陸來管理您剛建好的OpenStack吧。



現在,全部安裝結束。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章