云计算基础平台iaas(openstack)超级详细搭建(三)安装服务

98 篇文章 19 订阅
49 篇文章 25 订阅

注意:接与上一篇博客内容 进行更新
由于整个开源openstack安装过程过于繁琐,命令太长,太繁琐,于是把整个安装命令写成shell脚本。

脚本数量内容过多,已经推送自我的github源码托管中心了。

这是本篇脚本内容所在的github仓库位置
[root@controller centos]# cd /usr/local/bin/这是所有需要的脚本的整个路径
脚本内容介绍

#/bin/bash
source /etc/xiandian/openrc.sh
# config env network
systemctl  stop firewalld.service
systemctl  disable  firewalld.service >> /dev/null 2>&1
systemctl stop NetworkManager >> /dev/null 2>&1
systemctl disable NetworkManager >> /dev/null 2>&1
sed -i 's/SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
setenforce 0
yum remove -y NetworkManager firewalld
service network restart
#----  ntp  ---------------------------------
yum install ntp  iptables-services  -y
if [ 0  -ne  $? ]; then
        echo -e "\033[31mThe installation source configuration errors\033[0m"
        exit 1
fi
systemctl enable iptables
systemctl restart iptables
iptables -F
iptables -X
iptables -X
service iptables save
# install package
sed -i -e 's/#UseDNS yes/UseDNS no/g' -e 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/g' /etc/ssh/sshd_config
yum upgrade -y
yum -y install openstack-selinux python-openstackclient crudini -y
if [[ `ip a |grep -w $HOST_IP ` != '' ]];then
        hostnamectl set-hostname $HOST_NAME
elif [[ `ip a |grep -w $HOST_IP_NODE ` != '' ]];then
        hostnamectl set-hostname $HOST_NAME_NODE
else
        hostnamectl set-hostname $HOST_NAME
fi
sed -i -e "/$HOST_NAME/d" -e "/$HOST_NAME_NODE/d" /etc/hosts
echo "$HOST_IP $HOST_NAME" >> /etc/hosts
echo "$HOST_IP_NODE $HOST_NAME_NODE" >> /etc/hosts
printf "\033[35mPlease Reboot or Reconnect the terminal\n\033[0m"

1.5通过脚本安装服务

1.6-1.9的基础配置操作命令已经编写成shell脚本,通过脚本进行一键安装。如下:
#Controller节点和Compute节点
执行脚本iaas-pre-host.sh进行安装
# 安装完成后同时重启
[root@controller ~]# reboot


下面是整个安装细节命令(脚本中已经包含该命令)

1.6安装Openstack包
# controller和compute节点
# yum -y install openstack-utils openstack-selinux python-openstackclient
# yum upgrade
1.7配置域名解析
修改/etc/hosts添加一下内容
(1)controller 节点
20.0.0.10   controller
20.0.0.20   compute
(2)compute 节点
20.0.0.10   controller
20.0.0.20   compute
1.8配置防火墙和Selinux
编辑selinux文件
# vi /etc/selinux/config
SELINUX=permissive
关闭防火墙并设置开机不自启
# systemctl stop firewalld.service
# systemctl disable firewalld.service
# yum remove -y NetworkManager firewalld
# yum -y install iptables-services
# systemctl enable iptables
# systemctl restart iptables
# iptables -F
# iptables -X
# iptables -X
# service iptables save
1.9安装ntp服务
(1)controller和compute节点
# yum -y install ntp
(2)配置controller节点
编辑/etc/ntp.conf文件
添加以下内容(删除默认sever规则)
server 127.127.1.0
fudge 127.127.1.0   stratum 10
启动ntp服务器
# service ntpd start 
# chkconfig ntpd on
(3)配置compute节点
# ntpdate controller
# chkconfig ntpdate on

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

抛物线.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值