環境:centos7
IP地址: 192.168.199.100
1、修改主機名,然後修改/etc/hosts文件解析
[root@test ~]# hostnamectl set-hostname test.fxkj.cn

[root@test ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.199.100 test.fxkj.cn test

2、關閉selinux
[root@test ~]# vim /etc/selinux/config
改為: SELINUX=disabled
3、關閉防火牆
[root@test ~]# firewall-cmd --set-default-zone=trusted
Warning: ZONE_ALREADY_SET: trusted
success
4、關閉NetworkManager
[root@test ~]# systemctl stop NetworkManager
[root@test ~]# systemctl disable NetworkManager
5、配置阿里雲的鏡像
[root@test ~]# yum install -y centos-release-openstack-pike
由於RDO的源一般下載速度比較慢,容易由於安裝超時導致失敗,可以替換成阿里的源
[root@test ~]# vim /etc/yum.repos.d/CentOS-OpenStack-pike.repo
name=CentOS-7 - OpenStack pike
baseurl=http://mirrors.aliyun.com/centos/7/cloud/$basearch/openstack-pike/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud
[root@test ~]# yum clean all
[root@test ~]# yum makecache
[root@test ~]# yum update –y
更新一下軟件,系統
[root@test ~]# reboot
重啟
6、安裝packstack
[root@ftest ~]# yum -y install openstack-packstack
【以應答文件的方式安裝 !!!!!】
先創建一個應答文件出來,根據自己的需求來修改
[root@test ~]# packstack --gen-answer-file=test.text
Packstack changed given value to required value /root/.ssh/id_rsa.pub
(test.text 是自定義命名的應答文件,會在root 用戶家目錄下自動生成)
[root@test ~]#ls
anaconda-ks.cfg test.text
[root@test~]#vim test.text
修改對應的參數
CONFIG_DEBUG_MODE=n
# Server on which to install OpenStack services specific to the
# controller role (for example, API servers or dashboard).
CONFIG_CONTROLLER_HOST=192.168.199.100
# List the servers on which to install the Compute service.
CONFIG_COMPUTE_HOSTS=192.168.199.100
# List of servers on which to install the network service such as
# Compute networking (nova network) or OpenStack Networking (neutron).
CONFIG_NETWORK_HOSTS=192.168.199.100
CONFIG_PROVISION_DEMO=n
CONFIG_NEUTRON_ML2_TYPE_DRIVERS=flat,vxlan
CONFIG_NEUTRON_ML2_FLAT_NETWORKS=datacentre
CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=datacentre:br-ex
使用sed修改所有的密碼都為redhat
[root@test ~]# sed -i.bak -r 's/(.+_PW)=[0-9a-z]+/\\1=redhat/g' test.text
【然後使用應答文件進行安裝】
[root@test ~]# packstack --answer-file=test.text
然後等待半個小時或者更長的時間如果沒有出現紅色字體據說明安裝成功了
黃色是警告提示 紅色是錯誤。
輸入本機的ip就可以登陸進去了
如下圖所示:
如果是安裝紅帽的或者是其它二次開發的版本登陸界面是相當的漂亮的!!!
Date:2018/12/30 23:20
---運維小弟---
閱讀更多 運維小弟 的文章