一、安装前的准备
在RHEL7/CentOS7上安装openstack liberty
两台虚拟机,安装centos7系统(准备两个网卡,一个NAT,另一个仅主机)
nat网卡设置ip,可以联网,仅主机的网卡只要我们windows可以通就行,主要是用putty远程连接的
关闭selinux
关闭iptables
systemctl stop firewalld
systemctl disable firewalld
关闭NetworkManager
systemctl stop NetworkManager
systemctl disable NetworkManager
二、配置密码
在部署openstack过程中会在多个地方使用到密码,为了方便管理和安全设置,我们需要提前先定义好密码,使用命令mkpasswd -s 0生成随机字符串
Database password (no variable used) Root password for the database tn1Pi6Ytm
ADMIN_PASS Password of user admin 3qiVpzU2x
CEILOMETER_DBPASS Database password for the Telemetry service Czn3bF1hm
CEILOMETER_PASS Password of Telemetry service user ceilometer abquh12GU
CINDER_DBPASS Database password for the Block Storage service O3bwbpoZ3
CINDER_PASS Password of Block Storage service user cinder hf8LX9bow
DASH_DBPASS Database password for the dashboard 5qBZxnn1g
DEMO_PASS Password of user demo 9TtbgaA1q
GLANCE_DBPASS Database password for Image service Zznky4tP0
GLANCE_PASS Password of Image service user glance Wuyaf4cV6
HEAT_DBPASS Database password for the Orchestration service b7Fk5wjLg
HEAT_DOMAIN_PASS Password of Orchestration domain 7Gotb3eoH
HEAT_PASS Password of Orchestration service user heat eqQ2jLgz0
KEYSTONE_DBPASS Database password of Identity service f6zx0gURv
NEUTRON_DBPASS Database password for the Networking service quidyOC50
NEUTRON_PASS Password of Networking service user neutron mdcGVl29i
NOVA_DBPASS Database password for Compute service RYgv0rg7p
NOVA_PASS Password of Compute service user nova hsSNsqc43
RABBIT_PASS Password of user guest of RabbitMQ o3NXovnz5
SWIFT_PASS Password of Object Storage service user swift 6ci5xWOdk
METADATA_SECRET m8uhmQTu2
三、配置ip(一个nat模式,一个仅主机模式,仅主机的网卡只需要给xshell连接即可)
在controler上
dhclient eno16777736 (nat卡)
dhclient -r
dhclient eno 33554984 (仅主机卡)
ifconfig 查看ip
vim /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=eno16777736
UUID=6612a6a5-090b-43b8-9c87-e43545f800a9
DEVICE=eno16777736
ONBOOT=yes
IPADDR=192.168.163.249
PREFIX=24
GATEWAY=192.168.163.2
PEERDNS=no
在computer上
dhclient eno16777736 (nat卡)
dhclient -r
dhclient eno 33554984 (仅主机卡)
ifconfig 查看ip
vim /etc/sysconfig/network-scripts/ifcfg-eno16777736
vim /etc/resolv.conf
nameserver 218.85.157.99
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
NAME=eno16777736
UUID=a0761a5d-3a3d-420b-82b8-cd5e2919c55a
DEVICE=eno16777736
ONBOOT=yes
IPADDR=192.168.163.246
PREFIX=24
GATEWAY=192.168.163.2
PEERDNS=no
vim /etc/resolv.conf
nameserver 218.85.157.99
四、两台机器,设置hostname,配置时间同步
hostnamectl set-hostname controller
hostnamectl set-hostname computer
编辑/etc/hosts: 192.168.163.249 controller
192.168.163.246 computer
controller上:
yum install -y chrony
vi /etc/chrony.conf
增加或更改: allow 192.168.163.0/24
保存后,执行systemctl enable chronyd.service
systemctl start chronyd.service
compute上:
yum install -y chrony;vi /etc/chrony.conf
增加或更改: server controller iburst
保存后,执行systemctl enable chronyd.service
systemctl start chronyd.service
五、配置yun源升级软件安装openstack需要的包
安装openstack的yum源(两个机器上都操作)
yum install -y centos-release-openstack-liberty
升级所有的包(两个机器上都操作)
yum upgrade
结束后重启系统
安装openstack 客户端和openstack-selinux
yum install -y python-openstackclient openstack-selinux
六、安装sql服务(controler)
yum install -y mariadb mariadb-server MySQL-python
编辑配置文件 vi /etc/my.cnf.d/mariadb_openstack.cnf //加入下面内容
[mysqld]
bind-address = 192.168.163.249
default-storage-engine = innodb
innodb_file_per_table #表示一个表对应一个文件
collation-server = utf8_general_ci
init-connect = ‘SET NAMES utf8‘
character-set-server = utf8
启动mariadb:systemctl enable mariadb.service
systemctl start mariadb.service
安全配置,设置root密码
mysql_secure_installation
设置root密码为 tn1Pi6Ytm #此处密码为第二步用mkpasswd生成的密码
需要确定的全部为y
使用mysql -uroot -ptn1Pi6Ytm 测试是否可以登陆
七、安装nosql(control)如果架构不需要用到可以不安装
nosql数据库被Telemetry service用到
在这里我们安装的是mongodb
yum install -y mongodb-server mongodb
编辑配置文件 vi /etc/mongod.conf //更改如下配置
bind_ip = 192.168.163.249
smallfiles = true
启动服务
systemctl enable mongod.service
systemctl start mongod.service
八、安装消息队列(controler)
rabbitmq消息队列服务在openstack中起到非常关键的作用,它好比是一个交通枢纽,各个组件之间的通信由它来完成。
yum install -y rabbitmq-server
启动rabbitmq-server服务
systemctl enable rabbitmq-server
systemctl start rabbitmq-server
使用ps aux |grep rabbitmg 和netstat -lnp |grep 5672确定有没有启动
添加openstack用户
rabbitmqctl add_user openstack o3NXovnz5
// 密码 o3NXovnz5 用户名为openstack
为openstack用户授权
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
允许openstack用户可以配置,可以写,可以读