关于我们
技术分享
技术分享
openstack集群环境准备
openstack集群环境准备
2021-06-08
#0.openstack集群环境准备
#openstack集群环境准备#centos7.4 x86_64 #更改grub启动项,更改等待时间,更改字符界面 [[ `uname -r` = *el6* ]] && { Grubcfg=/boot/grub/grub.cfg; } || { Grubcfg=/boot/grub2/grub.cfg; }echo "修改 $Grubcfg"cp $Grubcfg{,.bak}sed -i 's#timeout=5#timeout=2#g' $Grubcfgsed -i 's#rhgb##g' $Grubcfg #关闭selinux、防火墙 systemctl stop firewalld.service systemctl disable firewalld.service firewall-cmd --statesed -i '/^SELINUX=.*/c SELINUX=disabled' /etc/selinux/configsed -i 's/^SELINUXTYPE=.*/SELINUXTYPE=disabled/g' /etc/selinux/configgrep --color=auto '^SELINUX' /etc/selinux/config setenforce 0#时间同步/usr/sbin/ntpdate ntp6.aliyun.com echo "*/3 * * * * /usr/sbin/ntpdate ntp6.aliyun.com &> /dev/null" > /tmp/crontab crontab /tmp/crontab
#推荐部署几个内网时间同步服务
#chrony时间同步
#NTP时间同步
#设置hostname, 每个节点分别设置 hostnamectl set-hostname controller1 #设置ip NetName=ens37 #网卡名称rm -f /etc/sysconfig/network-scripts/ifcfg-$NetName nmcli con add con-name $NetName ifname $NetName autoconnect yes type ethernet ip4 192.168.58.99/24 \ ipv4.dns "172.16.11.14 172.16.11.13" #ipv4.gateway "192.168.58.1"nmcli connection reload #重新加载网络 #查看本机IP ip add|sed -nr 's#^.*inet (.*)/24.*$#\1#gp'#系统2个网络 #192.168.58.0 内部网络 #10.2.1.0 外部网络 #IP规划,hosts设置echo '10.2.1.10 controller #vip192.168.58.21 controller1192.168.58.22 controller2192.168.58.23 controller3192.168.58.24 cinder1192.168.58.31 computer01192.168.58.32 computer02'>>/etc/hosts# ssh免密验证############################# controller1设置ssh-keygen -t rsa -P '' -f ~/.ssh/id_dsassh-copy-id -i ~/.ssh/id_dsa.pub root@controller2ssh-copy-id -i ~/.ssh/id_dsa.pub root@controller3 #可使用shell脚本批量设置 http://www.cnblogs.com/elvi/p/7681779.html#controller1、controller2、controller3都要设置 #验证ssh controller1 hostnamessh controller2 hostnamessh controller3 hostname############################### #备份默认yum源(不使用自建源就不要操作)mkdir -p ./it/yum.bakmv /etc/yum.repos.d/*.repo ./it/yum.bak/#使用自建yum源非常重要,保证后续添加新的节点,软件版本一致 #自建yum源部署,参考http://www.cnblogs.com/elvi/p/7657770.htmlwget -O /etc/yum.repos.d/Lan7.repo http://172.16.11.25/share/Lan7.repoyum clean all && yum makecache #生成缓存 # #若没自建源,安装OpenStack官方源 # #yum install centos-release-openstack-pike -y ##OpenStack tools 安装yum install -y python-openstackclient openstack-selinux python2-PyMySQL openstack-utils #升级,重启yum update -y && reboot
- 标签:
-
行业资讯
您可能感兴趣的新闻 换一批
热门文章
现在下载,可享30天免费试用