您好,登錄后才能下訂單哦!
小編給大家分享一下openstackM centos7中如何多節點安裝Packstack,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
環境準備
Hostname Ip func hcy-node1 192.168.7.80 controller hcy-node2 192.168.7.81 compute hcy-node3 192.168.7.82 compute
/etc/hostname都要改 /etc/hosts增加:
192.168.7.80 hcy-node1 192.168.7.81 hcy-node2 192.168.7.82 hcy-node3
將網卡配置成開機啟動:
/etc/sysconfig/network-scripts/ifcfg-eth0中,將ONBOOT=no改為yes
在三個節點安裝packstack: 在這里最好先設置網易的源,下載速度快
cd /etc/yum.repos.d mv CentOS-Base.repo CentOS-Base.repo.backup wget http://mirrors.163.com/.help/CentOS7-Base-163.repo mv CentOS7-Base-163.repo CentOS-Base.repo yum clean all
這里可能找不到 openstack-packstack,建議直接
yum install https://repos.fedorapeople.org/repos/openstack/openstack-mitaka/rdo-release-mitaka-6.noarch.rpm
在下載完之后,安裝過程中可能有什么key錯誤,去/etc/yum.repos.d/CentOS-Base.repo中將centos6 改成 centos7,因為我是centos7版本安裝的
yum install openstack-packstack -y
生成answer-file:
packstack --gen-answer-file=hcloud.txt
修改hcloud.txt中的如下配置:
這里node2,node3上的hcloud.txt都和node1上的一樣,指定node1為控制節點,node2,node3為計算節點
(1)修改計算節點和網絡節點IP
[root@hcy-node1 ~]# grep HOST ./hcloud.txt CONFIG_CONTROLLER_HOST=192.168.7.80 CONFIG_COMPUTE_HOSTS=192.168.7.80改為:CONFIG_COMPUTE_HOSTS=192.168.7.81,192.168.7.82 CONFIG_NETWORK_HOSTS=192.168.7.80 CONFIG_VCENTER_HOST= CONFIG_STORAGE_HOST=192.168.7.80改為:CONFIG_STORAGE_HOST=192.168.7.81,192.168.7.82 CONFIG_SAHARA_HOST=192.168.7.80 CONFIG_AMQP_HOST=192.168.7.80 CONFIG_MARIADB_HOST=192.168.7.80
(2)不安裝cirros鏡像 另外將CONFIG_PROVISION_DEMO=y改為n 部署之前再檢查一下/etc/hostname和/etc/hosts:
節點1:
[root@hcy-node1 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.7.80 hcy-node1 192.168.7.81 hcy-node2 192.168.7.82 hcy-node3
節點2:
[root@hcy-node2 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.7.80 hcy-node1 192.168.7.81 hcy-node2 192.168.7.82 hcy-node3
節點3:
[root@hcy-node3 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.7.80 hcy-node1 192.168.7.81 hcy-node2 192.168.7.82 hcy-node3
再次檢查hcloud.txt:
[root@hcy-node1 ~]# grep HOST ./hcloud.txt CONFIG_CONTROLLER_HOST=192.168.7.80 CONFIG_COMPUTE_HOSTS=192.168.7.81,192.168.7.82 CONFIG_NETWORK_HOSTS=192.168.7.80 CONFIG_VCENTER_HOST= CONFIG_STORAGE_HOST=192.168.7.81,192.168.7.82 CONFIG_SAHARA_HOST=192.168.7.80
還有如下選項:
[root@hcy-node1 ~]# grep CONFIG_PROVISION_DEMO ./hcloud.txt CONFIG_PROVISION_DEMO=n
開始部署,只在控制節點執行即可:
# yum install screen # screen packstack --answer-file=hcloud.txt
Welcome to the Packstack setup utility The installation log file is available at:/var/tmp/packstack/20160509-021808-zfHLVi/openstack-setup.log Installing: Clean Up [DONE ] Discovering ip protocol version [ DONE ] 這里需要手動輸入三臺節點的密碼,接下來一直等待直到部署完成: root@192.168.7.80'spassword: root@192.168.7.81'spassword: root@192.168.7.82'spassword: Setting up ssh keys [ DONE ] 部署成功后,出現如下信息: **** Installation completed successfully****** Additional information: *File /root/keystonerc_admin has been created on OpenStack client host192.168.7.80. To use the command line tools you need to source the file. * Toaccess the OpenStack Dashboard browse to http://192.168.7.80/dashboard . Please, find your login credentials storedin the keystonerc_admin in your home directory.
到此就部署成功了,horizon登陸密碼在 /root/keystonerc_admin 的export OS_PASSWORD參數中。 source keystonerc_admin
在horizon修改admin密碼的時候,(最好先把初始密碼記下來,因為要先去horizon user修改)也要在這個文件中修改export OS_PASSWORD參數為修改后的admin密碼
安裝好的openstack是沒有鏡像和網絡的。網絡自己隨便創建一個子網。 上傳鏡像到/mnt/image目錄下,執行:openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public 到此,可以成功創建云主機
基本服務檢查:
看完了這篇文章,相信你對“openstackM centos7中如何多節點安裝Packstack”有了一定的了解,如果想了解更多相關知識,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。