私有云落地解决方案之openstack高可用(pike版本)-环境配置

来源:互联网 发布:k歌之王65首歌名知乎 编辑:程序博客网 时间:2024/06/13 05:56

作者:【吴业亮】

博客:http://blog.csdn.net/wylfengyujiancheng

1、配置本地源

mkdir /etc/yum.repos.d/bak_repo_bakmv  /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak_repo_bakcat <<END >/etc/yum.repos.d/repo.repo[repo]name=repobaseurl=http://172.16.8.7/CentOS7.3-Mini-Ha-Pike/gpgcheck=0 enabled=1proxy=_none_ENDcat <<END > /etc/yum.repos.d/CentOS-Base.repo[base]name=CentOS-7 - Basebaseurl=http://172.16.8.200/repos/centos/7/os/x86_64/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7[updates]name=CentOS-7 - Updatesbaseurl=http://172.16.8.200/repos/centos/7/updates/x86_64/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7[extras]name=CentOS-7 - Extrasbaseurl=http://172.16.8.200/repos/centos/7/extras/x86_64/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7END注意:172.16.8.200为局域网本地源服务器

更新系统

yum update –y

删除文件

rm -rf /etc/yum.repos.d/CentOS-*

2、关闭防火墙和selinux

service firewalld  stopchkconfig firewalld off sed -i  "s/^SELINUX=enforcing/SELINUX=disabled/g"  /etc/selinux/configsed -i -e 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinuxsetenforce 0

3、修改主机名

hostnamectl set-hostname node1hostnamectl set-hostname node2hostnamectl set-hostname node3hostnamectl set-hostname computer1hostnamectl set-hostname computer2hostnamectl set-hostname computer3

修改hosts文件

# cat <<"EOF">/etc/hosts127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4::1         localhost localhost.localdomain localhost6 localhost6.localdomain6172.16.8.60 node1 172.16.8.61 node2172.16.8.62 node3172.16.8.63 computer1172.16.8.64 computer2172.16.8.65 computer3EOF

配置本地源

4、时间同步NTP

采用局域网NTP

# echo '* * * * * /usr/sbin/ntpdate NTP服务器地址 ' >/var/spool/cron/root

如果控制节点可以上网:

# echo '* * * * * /usr/sbin/ntpdate  202.108.6.95' >/var/spool/cron/root

5、安装一些工具

# yum install -y vim net-tools  # yum install openstack-selinux –y# yum install openstack-selinux python-openstackclient yum-plugin-priorities -y # yum install -y openstack-utils

6、重启机器

reboot 

以为update过程升级了内核,需要重启下使内核生效

附录:

ntp服务器配置

#  yum -y install ntp

修改配置文件/etc/ntp.conf

server 0.centos.pool.ntp.org iburstserver 1.centos.pool.ntp.org iburstserver 2.centos.pool.ntp.org iburstserver 3.centos.pool.ntp.org iburstserver 127.127.1.0fudge 127.127.1.0 stratum 0

启动服务并设置开机启动

# systemctl start ntpd# systemctl enable ntpd

查看ntp状态

# ntpq -p
阅读全文
0 0
原创粉丝点击