Centos8最小化部署安装OpenStack Ussuri的详细教程

Centos8最小化部署安装OpenStack Ussuri的教程如下所示:

#!/bin/bash

#Centos8最小化部署安装OpenStack Ussuri
#共两台主机,分别是一台控制节点,一台计算节点
#1、控制节点内存4096M。双网卡,分别为eth0:10.0.0.11,eth1:10.0.0.12
#2、计算节点内存2048M。双网卡,分别为eth0:10.0.0.31,eth1:10.0.0.32

#设置阿里云yum源
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
rm -f /etc/yum.repos.d/CentOS-AppStream.repo /etc/yum.repos.d/CentOS-PowerTools.repo /etc/yum.repos.d/CentOS-centosplus.repo /etc/yum.repos.d/CentOS-Extras.repo && rm -rf /var/cache/yum && yum makecache && yum -y update && yum -y autoremove

#关闭防火墙
systemctl stop firewalld && systemctl disable firewalld

#关闭SELinux
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

#关闭swap分区
swapoff -a
sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab

#设置内核
modprobe bridge
modprobe br_netfilter
cat > /etc/sysconfig/modules/neutron.modules <<EOF
#!/bin/bash
modprobe -- bridge
modprobe -- br_netfilter
EOF
chmod 755 /etc/sysconfig/modules/neutron.modules && bash /etc/sysconfig/modules/neutron.modules
echo "vm.max_map_count=262144" >> /etc/sysctl.conf
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-iptables=1" >> /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-ip6tables=1" >> /etc/sysctl.conf
sysctl -p

#设置时间同步
yum install -y chrony && yum -y autoremove
sed -i '/^pool/d' /etc/chrony.conf
sed -i '/^server/d' /etc/chrony.conf
echo "pool ntp.aliyun.com iburst" >> /etc/chrony.conf
systemctl start chronyd.service && systemctl enable chronyd.service

#控制节点 设置hostname
hostnamectl set-hostname controller

#计算节点 设置hostname
hostnamectl set-hostname compute1

#添加host
echo "10.0.0.11 controller" >> /etc/hosts
echo "10.0.0.31 compute1" >> /etc/hosts

#安装基础组件
yum install -y centos-release-openstack-ussuri
yum config-manager --set-enabled PowerTools
yum upgrade -y
yum install -y python3-openstackclient

#控制节点 安装Mariadb
yum install -y mariadb mariadb-server python2-PyMySQL
tee /etc/my.cnf.d/openstack.cnf <<-'EOF'
[mysqld]
bind-address = 10.0.0.11
default-storage-engine = innodb
innodb_file_per_table =
ETCD_LISTEN_PEER_URLS="http://10.0.0.11:2380"
ETCD_LISTEN_CLIENT_URLS="http://10.0.0.11:2379"
ETCD_NAME="controller"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.11:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.11:2379"
ETCD_INITIAL_CLUSTER="controller=http://10.0.0.11:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new"
EOF
systemctl enable etcd && systemctl start etcd

#控制节点 安装Identity service
mysql -uroot -p123456 -e "CREATE DATABASE keystone"
mysql -uroot -p123456 -e "GRANT ALL PRIVILEGES>总结

到此这篇关于Centos8最小化部署安装OpenStack Ussuri的详细教程的文章就介绍到这了,更多相关Centos8最小化部署安装OpenStack Ussuri内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!

Centos8最小化部署安装OpenStack Ussuri的详细教程

扫一扫手机访问