准备工作
3台虚拟机,操作系统为CentOS8,分别作为控制节点,计算节点,存储节点。
一 控制节点
1.配置网卡/IP
修改网卡配置文件/etc/sysconfig/network-scripts/ifcfg/eth0进行配置
2.关闭防火墙
#更改selinux策略
vi /etc/selinux/config
###
SELINUX=disabled
###
#关闭firewalld
systemctl stop firewalld
systemctl disable firewalld
3.加载br_netfilter模块
echo br_netfilter > /etc/modules-load.d/br_netfilter.conf
4.配置yum源
sed -i -e "s|mirrorlist=|#mirrorlist=|g" -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" -e 's|http://vault.centos.org/$contentdir/$releasever/|https://mirrors.aliyun.com/centos-vault/8.5.2111/|g' /etc/yum.repos.d/*
5.安装chrony
yum install -y chrony
systemctl enable chronyd.service
systemctl start chronyd.service
6.安装openstack yum源和相关基础组件
yum install -y centos-release-openstack-victoria
sed -i -e "s|mirrorlist=|#mirrorlist=|g" -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" -e 's|http://vault.centos.org/[^/]*/[^/]*/|https://mirrors.aliyun.com/centos-vault/8.5.2111/|g' /etc/yum.repos.d/*
7.安装openstack相关基础组件
yum config-manager --set-enabled powertools
yum install -y python3-openstackclient
yum install -y openstack-selinux
8.安装mariadb
yum install -y mariadb mariadb-server python3-PyMySQL
#创建并编辑文件,修改bind-address为本节点IP地址
vi /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.134.101
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
#启用mariadb服务
systemctl enable mariadb.service
systemctl start mariadb.service
#进行数据库初始化,接下来根据提示配置root密码等信息
#mysql_secure_installation
9. 安装rabbitmq
#安装rabbitmq组件,并启用服务
yum install -y rabbitmq-server
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
#创建openstack用户,并赋予其权限
rabbitmqctl add_user openstack awcloud
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
10.安装memcached
#安装memcached组件
yum install -y memcached python3-memcached
#修改配置文件(OPTIONS中添加本节点IP地址)
vi /etc/my.cnf.d/openstack.cnf
OPTIONS="-l 127.0.0.1,::1,192.168.134.101"
#启用memcached服务
systemctl enable memcached.service
systemctl start memcached.service
11. 安装etcd
#安装etcd组件
yum install -y etcd
# 修改配置文件(将
ETCD_INITIAL_CLUSTER, ETCD_INITIAL_ADVERTISE_PEER_URLS, ETCD_ADVERTISE_CLIENT_URLS, ETCD_LISTEN_CLIENT_URLS和ETCD_LISTEN_PEER_URLS中的ip设置为本节点ip)
vi /etc/etcd/etcd.conf
#[Member]
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://192.168.134.101:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.134.101:2379"
ETCD_NAME="controller"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.134.101:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.134.101:2379"
ETCD_INITIAL_CLUSTER="controller=http://192.168.134.101:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new"
#启用etcd服务
systemctl enable etcd
systemctl start etcd
重启系统