基礎環境準備
1.禁用selinux
2.卸載firewalld
3.卸載 NetworkManager
4.配置主機IP地址
5.配置主機yum客戶端
6.建立cinder-volumes的卷組
7.導入公鑰
8.安裝依賴軟件包node
配置卷組
[root@node1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 200G 0 disk
└─vda1 253:1 0 16G 0 part /
vdb 253:16 0 20G 0 disk
安裝卷組管理軟件
[root@node1 ~]# yum -y install lvm2
建立卷組
[root@node1 ~]# pvcreate /dev/vdb
Physical volume "/dev/vdb" successfully created.
建立卷組名爲clinder-volumes
[root@node1 ~]# vgcreate clinder-volumes /dev/vdb
Volume group "clinder-volumes" successfully created
查詢卷組信息
[root@node1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
clinder-volumes 1 0 0 wz--n- <20.00g <20.00g
導入公鑰
[root@nova ~]# rpm --import RPM-GPG-KEY-CentOS-7
兩臺虛擬機安裝額外軟件包
[root@nova ~]# yum install -y qemu-kvm libvirt-client libvirt-daemon
libvirt-daemon-driver-qemu python-setuptools
配置packstack
• 安裝packstack
[root@vh02 ~]# yum install -y openstack-packstack
修改yum源簽名驗證
[root@node1 ~]#vim /etc/yum.repos.d/base.repo
[base]
name=centos
baseurl=ftp://192.168.1.254/centos 物理機ftp yum源
gpgcheck=1
enabled=1
建立應答文件
[root@node1 ~]# packstack --gen-answer-file answer.ini
修改應答文件
[root@node1 ~]# vim answer.ini
11行 CONFIG_DEFAULT_PASSWORD=Taren1
42 CONFIG_SWIFT_INSTALL=n
75 CONFIG_NTP_SERVERS=192.168.1.254
98 CONFIG_COMPUTE_HOSTS=192.168.1.20,192.168.1.30 兩臺虛擬機IP
102 CONFIG_NETWORK_HOSTS=192.168.1.20,192.168.1.30
554 CONFIG_CINDER_VOLUMES_CREATE=n
840 CONFIG_NEUTRON_ML2_TYPE_DRIVERS=flat,vxlan
876 CONFIG_NEUTRON_ML2_VXLAN_GROUP=239.1.1.5
910 CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex
921 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth0
936 CONFIG_NEUTRON_OVS_TUNNEL_IF=eth1
1179 CONFIG_PROVISION_DEMO=n
一鍵部署Openstack
[root@node1 ~]# packstack --answer-file answer.ini
ERROR : The cinder server should contain a cinder-volumes volume group
報錯提示,沒有卷組,卷組名錯誤,正確的應該爲: cinder-volumes
[root@node1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
clinder-volumes 1 0 0 wz--n- <20.00g <20.00g
修改卷組名稱
[root@node1 ~]# vgrename clinder-volumes cinder-volumes
Volume group "clinder-volumes" successfully renamed to "cinder-volumes"
修改完成後查詢
[root@node1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
cinder-volumes 1 0 0 wz--n- <20.00g <20.00g
從新部署Openstack
[root@node1 ~]# packstack --answer-file answer.ini
Welcome to the Packstack setup utilitypython
The installation log file is available at: /var/tmp/packstack/20180630-163406-78uc5o/openstack-setup.loglinux
Installing:
Clean Up [ DONE ]
Discovering ip protocol version [ DONE ]
Setting up ssh keys [ DONE ]
Preparing servers [ DONE ]
Pre installing Puppet and discovering hosts' details [ DONE ]
Preparing pre-install entries [ DONE ]
Installing time synchronization via NTP [ DONE ]
Setting up CACERT [ DONE ]
Preparing AMQP entries [ DONE ]
Preparing MariaDB entries [ DONE ]
Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
Preparing Keystone entries [ DONE ]
Preparing Glance entries [ DONE ]
Checking if the Cinder server has a cinder-volumes vg[ DONE ]
Preparing Cinder entries [ DONE ]
Preparing Nova API entries [ DONE ]
Creating ssh keys for Nova migration [ DONE ]
Gathering ssh host keys for Nova migration [ DONE ]
Preparing Nova Compute entries [ DONE ]
Preparing Nova Scheduler entries [ DONE ]
Preparing Nova VNC Proxy entries [ DONE ]
Preparing OpenStack Network-related Nova entries [ DONE ]
Preparing Nova Common entries [ DONE ]
Preparing Neutron LBaaS Agent entries [ DONE ]
Preparing Neutron API entries [ DONE ]
Preparing Neutron L3 entries [ DONE ]
Preparing Neutron L2 Agent entries [ DONE ]
Preparing Neutron DHCP Agent entries [ DONE ]
Preparing Neutron Metering Agent entries [ DONE ]
Checking if NetworkManager is enabled and running [ DONE ]
Preparing OpenStack Client entries [ DONE ]
Preparing Horizon entries [ DONE ]
Preparing Gnocchi entries [ DONE ]
Preparing MongoDB entries [ DONE ]
Preparing Redis entries [ DONE ]
Preparing Ceilometer entries [ DONE ]
Preparing Aodh entries [ DONE ]
Preparing Puppet manifests [ DONE ]
Copying Puppet modules and manifests [ DONE ]
Applying 192.168.1.20_controller.pp
192.168.1.20_controller.pp: [ DONE ]
Applying 192.168.1.30_network.pp
Applying 192.168.1.20_network.pp
192.168.1.20_network.pp: [ DONE ]
192.168.1.30_network.pp: [ DONE ]
Applying 192.168.1.30_compute.pp
Applying 192.168.1.20_compute.pp
192.168.1.20_compute.pp: [ DONE ]
192.168.1.30_compute.pp: [ DONE ]
Applying Puppet manifests [ DONE ]
Finalizing [ DONE ]apache
Installation completed successfully **vim
Additional information:centos
配置br-ex爲外部OVS網橋
[root@node1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-br-ex
ONBOOT=yes
IPADDR=192.168.1.20
PROFIX=24
GATEWAY=192.168.1.254
DEVICE=br-ex
NAME=br-ex
DEVICETYPE=ovs
OVSBOOTPROTO="static"
TYPE=OVSBridge瀏覽器
配置外部OVS網橋端口
[root@node1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
NAME=eth0
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ex
ONBOOT=yes
BOOTPROTO=none
驗證OVS配置
[root@node1 ~]# ovs-vsctl show
fabfec4c-7acf-4f34-9083-64e2557417a7
Manager "ptcp:6640:127.0.0.1"
is_connected: true
Bridge br-ex
Controller "tcp:127.0.0.1:6633"
is_connected: true
fail_mode: secure
Port phy-br-ex
Interface phy-br-ex
type: patch
options: {peer=int-br-ex}
Port "eth0"
Interface "eth0"
...............
2.[root@node1 ~]# ip -o addr show
...............
8: br-ex inet 192.168.1.20/24 brd 192.168.1.255 scope global br-ex\ valid_lft forever preferred_lft forever
配置Horizon
安裝雖然沒有報錯,但默認沒法打開Horizon,這是一個軟件的配置BUG
咱們修改配置文件
[root@node1 ~]# vim /etc/httpd/conf.d/15-horizon_vhost.conf
WSGIApplicationGroup %{GLOBAL} #在文件內添加這一行
從新載入配置文件
[root@node1 ~]# apachectl graceful
使用瀏覽器打開頁面192.168.1.20
http://192.168.1.20/dashboard/auth/login/?next=/dashboard/
打開後就能夠看到登陸頁面了
初始化環境變量
[root@node1 ~]# source ~/keystonerc_admin
[root@node1 ~(keystone_admin)]# env |grep OS
HOSTNAME=node1
OS_REGION_NAME=RegionOne
OS_PASSWORD=50e519fda73a40eb #默認密碼在這
OS_AUTH_URL=http://192.168.1.20:5000/v2.0
OS_USERNAME=admin #默認管理員帳戶名
OS_TENANT_NAME=admin
可使用openstack help查詢命令信息
[root@node1 ~(keystone_admin)]# openstack helpssh