1.环境准备
环境准备:
系统:centos7.8
1台控制节点(6C18G100G): 2nic
1台网络节点(4C8G80G) : 3nic
2台计算节点(6C18G100G): 3nic
eth0: 管理网段,可上网,下载安装包
eth1: provider网卡,(桥接模式),up with no ip
eth2: 内部vxlan网段
------------+---------------------------+---------------------------+------------------------------+---------------------------------------+
| | | | |
eth0|10.0.0.10 eth0|10.0.0.25 eth0|10.0.0.41 eth0|10.0.0.42 eth0|10.0.0.35
+-----------+-----------+ +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ +-----------+-----------+
| [ Control Node ] | | [ Network Node ] | | [ Compute Node1 ] | | [ Compute Node1 ] | | [nfs] |
| | | | | | | | | |
| MariaDB RabbitMQ | | Open vSwitch | | Libvirt | | Libvirt | | |
| Memcached httpd | | L2 Agent | | Nova Compute | | Nova Compute | | |
| Keystone Glance | | L3 Agent | | Open vSwitch | | Open vSwitch | +-----------------------+
| Nova API | | Metadata Agent | | L2 Agent | | L2 Agent |
| Neutron Server | | | | Cinder-Volume | | Cinder-Volume |
| Metadata Agent | | | | iSCSI Target | | iSCSI Target |
| Cinder API
| |
|
+-----------------------+ +--++---------------+---+ +-------------------+---+ +------------------+----+
|| | | |
|| eth2 10.10.10.25 eth2 10.10.10.41 eth2 10.10.10.42
|| | | |
|| +---------------------------------------------------------------------------
||
eth 1 (UP with no IP)
2.系统初始化
###1.下载基础工具
yum install -y vim wget net-tools telnet
###2.关闭fw
systemctl stop firewalld && systemctl disable firewalld
sed -ri 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
###3.更改上海时间
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
###4.源更新+train源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum -y install centos-release-openstack-train
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-OpenStack-train.repo
yum update -y && yum install -y upgrade
###5.密钥
ssh-keygen -t dsa -f ~/.ssh/id_dsa -P ""
3.基础配置(controller节点)
###1.hosts更新
echo "
10.0.0.10 controller
10.0.0.41 compute01
10.0.0.42 compute02
10.0.0.25 network" > /etc/hosts
###2. 免密登录
ssh-copy-id compute01
ssh-copy-id compute02
ssh-copy-id network
###3.同步hosts 和 chrony
scp /etc/hosts compute01:/etc/
scp /etc/hosts compute02:/etc/
scp /etc/hosts network:/etc/
scp /etc/chrony.conf compute01:/etc/
scp /etc/chrony.conf compute02:/etc/
scp /etc/chrony.conf network:/etc/
for line in compute01 compute02 network
do
echo $line
ssh $line "systemctl start chronyd && systemctl enable chronyd"
done
4.controller节点 环境安装
###1.mysql
yum --enablerepo=centos-openstack-train -y install mariadb-server
####add into [mysqld] section
[root@controller ~]# egrep -v "^$|^#" /etc/my.cnf.d/mariadb-server.cnf
[server]
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mariadb/mariadb.log
pid-file=/run/mariadb/mariadb.pid
max_connections=4096
character-set-server=utf8
[galera]
[embedded]
[mariadb]
[mariadb-10.3]
###2.memcache , rabbitmq
yum --enablerepo=centos-openstack-train -y install rabbitmq-server memcached
#### vi /etc/sysconfig/memcached
#### line 5: change (listen all)
OPTIONS="-l 0.0.0.0,::"
###add openstack user
rabbitmqctl add_user openstack password
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
####重启服务
systemctl restart mariadb rabbitmq-server memcached
systemctl enable mariadb rabbitmq-server memcached