OpenStack環境搭建


實驗環境

CentOS-7-x86_64-Minimal-1708.iso

openstack_N.tar.gz

創建虛擬機

controller部署

computer網絡配置

OpenStack環境准備

controller節點和cpmputer節點執行相同過程

關閉/禁用firewalld

[root@controller ~]# systemctl stop firewalld
[root@controller ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
View Code

關閉/禁用NetworkManager

[root@controller ~]# systemctl stop NetworkManager
[root@controller ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
View Code

禁用SELINUX

[root@controller ~]# cat /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disable
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 
View Code

修改hosts

[root@controller ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.80.10 controller controller.cac.com
192.168.80.20 computer computer.cac.com
View Code

創建本地yum源

[root@controller yum.repos.d]# cat openstack.repo 
[openstack]
name=openstack
enable=1
gpgcheck=0
baseurl=file:///openstack
View Code

OpenStack自動化部署

首先安裝自動化軟件openstack-packstack,利用openstack-packstack生成應答文件,修改應答文件,再依據應答文件進行安裝

yum search centos
View Code
yum -y install centos-release-openstack-newton
View Code

安裝完畢后,會在/etc/yum.repos.d/又生成幾個repo文件,我們安裝不需要聯網,將新生成的repo移入bak

[root@controller yum.repos.d]# ls
bak  CentOS-Ceph-Jewel.repo  CentOS-OpenStack-newton.repo  CentOS-QEMU-EV.repo  openstack.repo
[root@controller yum.repos.d]# mv C* bak/
[root@controller yum.repos.d]# ls
bak  openstack.repo
View Code

安裝openstack-packstack 

yum -y install openstack-packstack
View Code

生成應答文件(只在controller節點執行)

[root@controller yum.repos.d]# packstack --gen-answer-file=openstack.txt
Packstack changed given value  to required value /root/.ssh/id_rsa.pub
View Code

修改應答文件

首先修改如下選項

CONFIG_DEFAULT_PASSWORD=111111

CONFIG_SWIFT_INSTALL=n

CONFIG_NAGIOS_INSTALL=n

CONFIG_COMPUTE_HOSTS=192.168.80.20

CONFIG_NETWORK_HOSTS=192.168.80.20

CONFIG_CINDER_VOLUMES_SIZE=1G

CONFIG_PROVISION_DEMO=n

CONFIG_LBAAS_INSTALL=y

CONFIG_NEUTRON_FWAAS=y

CONFIG_NEUTRON_VPNAAS=y
View Code

執行grep -vE "^#|^$" openstack.txt發現有很多密碼設置,修改密碼為111111。

sed -i -r 's/(.+_PW)=.+/\1=111111/' openstack.txt
View Code

依據應答文件進行安裝

packstack --answer-file=openstack.txt
View Code

安裝過程中報錯

failure: repodata/repomd.xml from centos-ceph-jewel: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/storage/x86_64/ceph-jewel/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
++ t
++ exit 1

Please check log file /var/tmp/packstack/20181003-012303-VTSG5d/openstack-setup.log for more information
Additional information:
 * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
View Code

原因:再computer節點上/etc/yum.repos.d目錄下有生產了新的repo文件,將repo移入bak目錄,再次安裝

安裝過程大約20min

tail -f /var/log/messages可以查看安裝日志

 

查看是否安裝rabbitmq

rpm -qa | grep rabbitmq-server
View Code

查看rabbitmq狀態

systemctl status rabbitmq-server
View Code

啟用rabbitmq管理服務

rabbitmq-plugins list
rabbitmq-plugins enable rabbitmq_management
View Code

檢查是否啟動成功

netstat -antlp | grep 15672
View Code

安裝完成

 **** Installation completed successfully ******

Additional information:
 * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
 * File /root/keystonerc_admin has been created on OpenStack client host 192.168.80.10. To use the command line tools you need to source the file.
 * To access the OpenStack Dashboard browse to http://192.168.80.10/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
 * The installation log file is available at: /var/tmp/packstack/20181003-012556-L2HCU0/openstack-setup.log
 * The generated manifests are available at: /var/tmp/packstack/20181003-012556-L2HCU0/manifests
View Code

登陸RabbitMQ,dashboard

http://192.168.80.10/dashboard/

http://192.168.80.10:15672

 

 

 





 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM