openstack kolla添加计算节点

相关配置初始化

修改网卡名称[可选]

由于通过kolla-ansible部署OpenStack时指定了网卡名称,若对应的网卡名称不一致,则需要修改。网卡只需配置管理网段,外部网络对应的网卡不需配置IP,但必须接入网线

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# vi /etc/sysconfig/grub
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root net.ifnames=0 biosdevname=0 rd.lvm.lv=centos/swap rhgb quiet"
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-862.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-862.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-0211e330c7fa475e87b5be8bb60fd7c4
Found initrd image: /boot/initramfs-0-rescue-0211e330c7fa475e87b5be8bb60fd7c4.img
done
# vi /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="0c:c4:7a:2b:71:86", ATTR{type}=="1", KERNEL=="eth*", NAME="enp4s0f0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="0c:c4:7a:2b:71:87", ATTR{type}=="1", KERNEL=="eth*", NAME="enp4s0f1"
# vi /etc/sysconfig/network-scripts/ifcfg-enp4s0f0
NAME=enp4s0f0
DEVICE=enp4s0f0
IPADDR=10.200.111.17
PREFIX=24
GATEWAY=10.200.111.254
DNS1=10.100.1.10
DNS2=114.114.114.114

添加hosts解析

1
2
3
4
5
6
7
8
9
10
# hostnamectl set-hostname compute04
# vi /etc/hosts
10.200.112.49 registry.yealinkops.com
10.200.111.11 control01
10.200.111.12 control02
10.200.111.13 control03
10.200.111.14 compute01
10.200.111.15 compute02
10.200.111.16 compute03
10.200.111.17 compute04

安装相关依赖

1
2
# yum -y install epel-release python-pip python-devel libffi-devel gcc openssl-devel libselinux-python
# pip install docker

安装/配置Docker

安装docker-ce

1
2
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# yum install docker-ce

升级kernel

1
2
3
4
5
6
7
8
9
10
11
12
# rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
# yum -y --enablerepo=elrepo-kernel install kernel-ml-devel kernel-ml

# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
CentOS Linux (4.18.5-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux (3.10.0-862.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-d8f3b1ed35b245d6805ae3dd4acc0586) 7 (Core)
# grub2-set-default "CentOS Linux (4.18.5-1.el7.elrepo.x86_64) 7 (Core)"
# reboot

# uname -r
4.18.5-1.el7.elrepo.x86_64

配置Docker使用overlayfs2

1
2
3
4
5
6
7
8
9
10
11
12
# modprobe overlay
# vi /etc/modules-load.d/overlay.conf
overlay
# lsmod | grep overlay
overlay 49152 0
# vi /lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --storage-driver=overlay
# systemctl daemon-reload
# systemctl restart docker
# docker info
Storage Driver: overlay
Backing Filesystem: xfs

配置docker mountflags

1
2
3
# vim /usr/lib/systemd/system/docker.service
[Service]
MountFlags=shared

配置registry安全性和log-driver

默认情况下,容器输出日志将会写入到/var/lib/docker/containers/<container_id>/<container_id>-json.log的文件中,且不断增大,需要对日志做切割,且保留指定大小。

1
2
3
4
5
6
7
8
9
10
11
# vi /etc/docker/daemon.json
{
"insecure-registries":["registry.yealinkops.com:5555"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m",
"max-file": "3"
}
}
# systemctl daemon-reload
# systemctl restart docker

执行部署[部署节点上执行]

1
2
3
4
# vi /etc/kolla/multinode
[external-compute]
compute04
# kolla-ansible deploy -i /etc/kolla/multinode --limit compute04
坚持原创技术分享,您的支持将鼓励我继续创作!
0%