参考教程 https://docs.openstack.org/install-guide/openstack-services.html#minimal-deployment-for-queens
使用centos7.1 两台虚拟机 一台控制节点(主机名controller) 一台计算+网络(主机名compute1)
为方便本次所有密码都使用test.2018
Hosts文件
10.0.2.111 controller
10.0.2.112 compute1
yum install net-tools
iptables -F
iptables-save
ntpdate ntp.aliyun.com
*/5 * * * */usr/sbin/ntpdate 203.107.6.88
echo "net.ipv4.ip_forward=1">> /etc/sysctl.conf
echo"net.ipv4.conf.default.rp_filter=0" >> /etc/sysctl.conf
echo"net.ipv4.conf.all.rp_filter=0" >> /etc/sysctl.conf
echo"net.bridge.bridge-nf-call-ip6tables=1" >> /etc/sysctl.conf
echo"net.bridge.bridge-nf-call-iptables=1" >> /etc/sysctl.conf
echo"net.bridge.bridge-nf-call-arptables=1" >> /etc/sysctl.conf
modprobe bridge
systemctl restart network
systemctl stopNetworkManager
systemctl disableNetworkManager
setenforce 0
vim /etc/selinux/config
systemctl stop firewalld.service
systemctl disablefirewalld.service
主机做好SSH互信方便操作
ssh-keygen
ssh-copy-id 10.0.2.111
Yum 更新 要能连接到外网才行
yum installcentos-release-openstack-queens -y
yum upgrade -y
yum installopenstack-selinux -y
安装数据库(只在控制节点安装)
yum install mariadbmariadb-server python2-PyMySQL -y
配置文件
Vim/etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 10.0.2.111
default-storage-engine =innodb
innodb_file_per_table = on
max_connections = 4096
collation-server =utf8_general_ci
character-set-server =utf8
启动服务
systemctl enablemariadb.service
systemctl startmariadb.service
数据据初始化
mysql_secure_installation
安装消息队列(仅控制节点)
yum installrabbitmq-server -y
systemctl enablerabbitmq-server.service
systemctl startrabbitmq-server.service
添加用户rabbitmq用户并授权
rabbitmqctl add_useropenstack test.2018
rabbitmqctlset_permissions openstack ".*" ".*" ".*"
安装Memcached(仅控制节点)
yum install memcachedpython-memcached -y
修改配置文件
vim/etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l127.0.0.1,::1,10.0.2.111"
启动服务
systemctl enablememcached.service
systemctl startmemcached.service
安装ETCD(仅控制节点)
OpenStack服务可能使用Etcd,这是一个分布式可靠的键值存储,用于分布式密钥锁定,存储配置,跟踪服务的实时性和其他场景。
yum install etcd -y
修改配置文件
[root@con01 ~]# cat /etc/etcd/etcd.conf |grep -v ^#
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://10.0.2.111:2380"
ETCD_LISTEN_CLIENT_URLS="http://10.0.2.111:2379"
ETCD_NAME="controller"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.2.111:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://10.0.2.111:2379"
ETCD_INITIAL_CLUSTER="con01=http://10.0.2.111:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new"
systemctl enable etcd
systemctl restart etcd