S1_搭建分布式OpenStack集群_02 虚拟机环境配置
一、配置主机名及hosts和防火墙(只演示一台,其他机器配置方式一样)
vim /etc/hosts 加入
10.10.11.11 controller
10.10.11.12 compute1
10.10.11.13 neutron
10.10.11.14 cinder
修改主机名
hostnamectl set-hostname controller
hostnamectl set-hostname compute1
hostnamectl set-hostname neutron
hostnamectl set-hostname cinder
关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
关闭网络管理NetworkManager
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
关闭selinux
# vim /etc/selinux/config
SELINUX=disabled
二、所有主机配置网卡,这里只演示controller
2.1 配置eth0 (仅限controller)
controller ~]# cd /etc/sysconfig/network-scripts/
controller network-scripts]# vim ifcfg-eth0
DEVICE="eth0"
ONBOOT="yes"
IPV6INIT="no"
IPV4_FAILURE_FATAL="no"
NM_CONTROLLED="no"
TYPE="Ethernet"
BOOTPROTO="static"
IPADDR="10.10.10.11"
PREFIX="24"
GATEWAY="10.10.10.1"
controller network-scripts]# systemctl restart network
controller network-scripts]# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.11 netmask 255.255.255.0 broadcast 10.10.10.255
inet6 fe80::5054:ff:fec3:e842 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:c3:e8:42 txqueuelen 1000 (Ethernet)
RX packets 1821 bytes 95276 (93.0 KiB)
RX errors 0 dropped 1785 overruns 0 frame 0
TX packets 92 bytes 6164 (6.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2.2 配置eth1
controller network-scripts]# cp ifcfg-eth0 ifcfg-eth1
controller network-scripts]# vim ifcfg-eth1
DEVICE="eth1"
ONBOOT="yes"
IPV6INIT="no"
IPV4_FAILURE_FATAL="no"
NM_CONTROLLED="no"
TYPE="Ethernet"
BOOTPROTO="static"
IPADDR="10.10.11.11"
PREFIX="24"
(GATEWAY="10.10.11.1" 非controller节点都要添加,controller不加)
controller network-scripts]# systemctl restart network
controller network-scripts]# ifconfig eth1
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.11.11 netmask 255.255.255.0 broadcast 10.10.11.255
inet6 fe80::5054:ff:fe21:6a50 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:21:6a:50 txqueuelen 1000 (Ethernet)
RX packets 2505 bytes 132478 (129.3 KiB)
RX errors 0 dropped 2353 overruns 0 frame 0
TX packets 57 bytes 3674 (3.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2.3 配置eth2
controller network-scripts]# cp ifcfg-eth1 ifcfg-eth2
controller network-scripts]# vim ifcfg-eth2
DEVICE="eth2"
ONBOOT="yes"
IPV6INIT="no"
IPV4_FAILURE_FATAL="no"
NM_CONTROLLED="no"
TYPE="Ethernet"
BOOTPROTO="static"
IPADDR="10.10.12.11"
PREFIX="24"
controller network-scripts]# systemctl restart network
controller network-scripts]# ifconfig eth2
eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.12.11 netmask 255.255.255.0 broadcast 10.10.12.255
inet6 fe80::5054:ff:feaa:a8a prefixlen 64 scopeid 0x20<link>
ether 52:54:00:aa:0a:8a txqueuelen 1000 (Ethernet)
RX packets 2434 bytes 127542 (124.5 KiB)
RX errors 0 dropped 2372 overruns 0 frame 0
TX packets 64 bytes 3648 (3.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2.4 查看DNS
controller network-scripts]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 10.10.10.1
ping以下百度:证明eth0网卡已启用
controller network-scripts]# ping www.baidu.com
PING www.a.shifen.com (61.135.169.121) 56(84) bytes of data.
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=1 ttl=54 time=22.0 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=2 ttl=54 time=22.3 ms
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 22.099/22.201/22.304/0.180 ms
2.5 检查controller网卡:
2.6 所有节点配置完成后,检测节点互通:
三、配置集群yum源
3.1 yum节点网卡配置:
yum ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
ONBOOT="yes"
IPV6INIT="no"
IPV4_FAILURE_FATAL="no"
NM_CONTROLLED="no"
TYPE="Ethernet"
BOOTPROTO="static"
IPADDR="10.10.11.200"
PREFIX="24"
GATEWAY="10.10.11.1"
yum ~]# systemctl restart network
yum ~]# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.11.200 netmask 255.255.255.0 broadcast 10.10.11.255
inet6 fe80::5054:ff:fefa:2719 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:fa:27:19 txqueuelen 1000 (Ethernet)
RX packets 227 bytes 12116 (11.8 KiB)
RX errors 0 dropped 215 overruns 0 frame 0
TX packets 66 bytes 3732 (3.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ping controller节点:
yum ~]# ping 10.10.11.11
PING 10.10.11.11 (10.10.11.11) 56(84) bytes of data.
64 bytes from 10.10.11.11: icmp_seq=1 ttl=64 time=0.339 ms
64 bytes from 10.10.11.11: icmp_seq=2 ttl=64 time=0.255 ms
--- 10.10.11.11 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.255/0.297/0.339/0.042 ms
yum ~]# ping 10.10.11.12
PING 10.10.11.12 (10.10.11.12) 56(84) bytes of data.
64 bytes from 10.10.11.12: icmp_seq=1 ttl=64 time=0.249 ms
--- 10.10.11.12 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.249/0.249/0.249/0.000 ms
3.2 搭建FTP本地yum源:
下载163源到本地 http://mirrors.163.com/centos/7.6.1810/
yum ~]# ls /var/ftp/
dvd every extrals mini pub queens updates
这样,除了pub文件夹之外,其余都是本地yum源了
yum ~]# vim /etc/yum.repos.d/all.repo
[dvd]
name=dvd
baseurl=ftp://10.10.11.200/dvd
gpgcheck=1
enable=0
priority=3
[every]
name=every
baseurl=ftp://10.10.11.200/every
gpgcheck=0
enable=0
priority=3
[mini]
name=mini
baseurl=ftp://10.10.11.200/mini
gpgcheck=0
enable=0
priority=3
[queens]
name=queens
baseurl=ftp://10.10.11.200/queens
gpgcheck=0
enable=0
priority=1
[extrals]
name=extrals
baseurl=ftp://10.10.11.200/extrals
gpgcheck=0
enable=0
priority=3
[updates]
name=updates
baseurl=ftp://10.10.11.200/updates
gpgcheck=0
enable=0
priority=2
查看yum:
yum ~]# yum clean all
yum ~]# yum repolist | grep repolist
repolist: 18,246
3.3 其他主机同步yum源
controller ~]# rm -rf /etc/yum.repos.d/*
compute1 ~]# rm -rf /etc/yum.repos.d/*
neutron ~]# rm -rf /etc/yum.repos.d/*
cinder ~]# rm -rf /etc/yum.repos.d/*
yum ~]# cd /etc/yum.repos.d/
yum.repos.d]# ls
all.repo repo RPM-GPG-KEY-CentOS-7 RPM-GPG-KEY-CentOS-Testing-7
yum.repos.d]# for i in 1 2 3 4
> do
> scp all.repo RPM-GPG-KEY-CentOS-* root@10.10.11.1$i:/etc/yum.repos.d/
> done
登陆其他任何一个节点查看:
neutron ~]# yum clean all
neutron ~]# yum repolist | grep repolist
repolist: 20,097
由于怕yum源冲突及保持openstack queen yum源的优先权,每个节点安装 yum-plugin-priorities
controller ~]# yum -y install yum-plugin-priorities
其他节点也安装.
四、时间同步配置
在所有节点安装chrony
# yum install chrony –y
4.1 配置controller为时间同步服务器
controller ~]# vim /etc/chrony.conf
更新这几处:
server ntp1.aliyun.com iburst
allow 0/0
local stratum 10
controller ~]# systemctl restart chronyd
controller ~]# chronyc sources -v
^* 120.25.115.20
出现 “^*” 表示同步成功。
4.2 配置其他节点同步controller的时间同步服务(以compute为例)
compute1 ~]# vim /etc/chrony.conf
修改为:
server 10.10.11.11 iburst
compute1 ~]# chronyc sources -v
^* controller...
出现 “^*” 表示同步成功。
4.3 将所有节点的chronyd服务设为开机自启(以controller为例)
controller ~]# systemctl enable chronyd
五、安装openstack软件仓库(所有服务器)
yum安装Q版仓库(以controller为例)
controller ~]# yum -y install centos-release-openstack-queens
安装open stack client端:
controller ~]# yum install python-openstackclient -y
安装open stack的selinux(如果关闭了服务器selienx可以不装)
controller ~]# yum install openstack-selinux -y
由于我提前关闭了,所以此处我没有安装。
S1_搭建分布式OpenStack集群_02 虚拟机环境配置的更多相关文章
- S1_搭建分布式OpenStack集群_11 虚拟机创建
一.创建网络环境环境变量生效一下创建一个网络:# openstack network create --share --external \--provider-physical-network ph ...
- S1_搭建分布式OpenStack集群_07 nova服务配置 (计算节点)
一.服务安装(计算节点)安装软件:# yum install openstack-nova-compute -y 编辑/etc/nova/nova.conf文件并设置如下内容:# vim /etc/n ...
- S1_搭建分布式OpenStack集群_05 glance安装配置
一.基本简介 镜像服务(glance)使用户能够发现,注册和检索虚拟机镜像. 它提供了一个REST API,使您可以查询虚拟机镜像元数据并检索实际镜像. 您可以将通过镜像服务提供的虚拟 ...
- S1_搭建分布式OpenStack集群_06 nova服务配置 (控制节点)
一.创建数据库(控制节点)创建数据库以及用户:# mysql -uroot -p12345678MariaDB [(none)]> CREATE DATABASE nova_api;MariaD ...
- S1_搭建分布式OpenStack集群_01 准备虚拟机
Openstack版本:openstack-queen 版本 一.环境准备 网络规划: Management + API Network:10.10.11.0/24 eth1 网桥:br1 VM ...
- S1_搭建分布式OpenStack集群_03 Mysql、MQ、Memcached、ETCD安装配置
一.安装mysql(contorller)controller ~]# yum -y install mariadb mariadb-server python2-PyMySQL 配置my.cnf文件 ...
- S1_搭建分布式OpenStack集群_10 cinder 存储节点配置
一.安装配置lvm2安装LVM包:# yum install -y lvm2 启动LVM元数据服务,并将其配置为在系统启动时启动:# systemctl enable lvm2-lvmetad.ser ...
- S1_搭建分布式OpenStack集群_09 cinder 控制节点配置
一.创建数据库创建数据库以及用户:# mysql -uroot -p12345678MariaDB [(none)]> CREATE DATABASE cinder;MariaDB [(none ...
- S1_搭建分布式OpenStack集群_08 网络服务(neutron)安装部署
一.数据库配置(控制节点)创建数据库以及用户:# mysql -uroot -p12345678MariaDB [(none)]> CREATE DATABASE neutron;MariaDB ...
随机推荐
- C# vb .net实现透视反射效果
在.net中,如何简单快捷地实现Photoshop滤镜组中的透视反射效果呢?答案是调用SharpImage!专业图像特效滤镜和合成类库.下面开始演示关键代码,您也可以在文末下载全部源码: 设置授权 第 ...
- QLineEdit 按键Tab键时 显示历史记录
#LineEdit添加历史记录功能,按下回车添加至历史中 class LineEditWithHistory(QtWidgets.QLineEdit): def __init__(self, pare ...
- Jest did not exit one second after the test run has completed.
使用 Jest 进行单元测试时出现如下问题: Jest did not exit one second after the test run has completed. This usually m ...
- 用weexplus从0到1写一个app(2)-页面跳转和文章列表及文章详情的编写
说明 结束连续几天的加班,最近的项目终于告一段落,今天抽点时间开始继续写我这篇拖了很久的<用weexplus从0到1写一个app>系列文章.写这篇文章的时候,weexplus的作者已经把w ...
- Python学习资料收集
1.Learn Python the hard way 2.Google's Python lesson 3.Python最佳实践 4.Full Stack Python 5.explore flas ...
- 部署---Apache服务器安装SSL证书
在云服务器的证书控制台下载Apache版本证书,下载到本地的是一个压缩文件. 解压后里面包含: _public.crt文件是证书文件, _chain.crt是证书链(中间证书)文件, .key文件是证 ...
- 无法将文件“E:\NetWorkPace\Permission\packages\EntityFramework.6.1.1\lib\net45\EntityFramework.xml”复制到“bin\EntityFramework.xml”。对路径“bin\EntityFramework.xml”的访问被拒绝。
无法将文件“E:\NetWorkPace\Permission\packages\EntityFramework.6.1.1\lib\net45\EntityFramework.xml”复制到“bin ...
- C# is与 java instanceof 作用相同
c#中 is 检查对象是否与给定类型兼容. 例如,下面的代码可以确定对象是否为 MyObject 类型的一个实例,或者对象是否为从 MyObject 派生的一个类型: if (obj is MyObj ...
- Python——模块合集
标准库模块 ● Python——OS(系统操作模块) ● Python——MD5(加密模块) ● Python——time(时间模块) ● Python——re(正则表达式) ● Python——sy ...
- CM的私有仓库搭建
CM的私有仓库搭建 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 我们有时候会因为网络不稳定的因素,导致安装某些服务直接失败.当安装包比较大的时候,我们就得考虑自建私有仓库 ...