opnstack 多节点yum安装
[root@xuegod63 ~]# vi /etc/selinux/config
SELINUX=disabled
systemctl stop firewalld && systemctl disable firewalld && systemctl status firewalld
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.63 master63.cn master63
192.168.1.62 node62.cn node62
192.168.1.61 node61.cn node61
vi /etc/hosts
yum install ntp -y && systemctl enable ntpd.service && systemctl start ntpd.service
rm /etc/localtime #删除link
ln -vs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #软件link
yum install ntpdate -y
ntpdate time.nist.gov
配置xuegod63上 pip 软件包源,方便快速下载python库(这一步很重要)
[root@xuegod63 ~]# mkdir ~/.pip
[root@xuegod63 ~]# vi /root/.pip/pip.conf #写入下以内容
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
ens192 -主网卡
ens224-空网卡
cd /etc/sysconfig/network-scripts/
cp ifcfg-ens192 ifcfg-ens224
vi ifcfg-ens224
TYPE="Ethernet"
PROXY_METHOD="none"
NAME="ens224"
DEVICE="ens224"
ONBOOT="yes"
service network restart
yum install epel-release -y
[root@xuegod63 network-scripts]# yum install python-devel libffi-devel gcc openssl-devel git python-pip -y
[root@xuegod63 ~]# pip install -U pip #升级一下pip,不然后,后期安装会报警告
[root@xuegod63 ~]# yum install -y yum-utils device-mapper-persistent-data lvm2 # 2上也装
[root@xuegod63 ~]# yum install ansible -y #安装ansible
三台执行
systemctl stop libvirtd.service && systemctl disable libvirtd.service && systemctl status libvirtd.service
yum remove docker docker-io docker-selinux python-docker-py
yum -y install yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@xuegod63 ~]# yum -y install docker-ce
systemctl start docker && systemctl enable docker && systemctl status docker
mkdir /etc/systemd/system/docker.service.d
[root@xuegod63 ~]# tee /etc/systemd/system/docker.service.d/kolla.conf << 'EOF'
[Service]
MountFlags=shared
EOF
设置 docker 镜像加速器
[root@xuegod63 ~]# vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://e9yneuy4.mirror.aliyuncs.com"]
}
重启相关服务
[root@xuegod63 ~]# systemctl daemon-reload
[root@xuegod63 ~]# systemctl enable docker && systemctl restart docker && systemctl status docker
61.存储节点操作
6.1.4 xuegod61 storage配置cinder存储信息
[root@xuegod61 ~]# ls /dev/sdb
/dev/sdb
yum install -y yum-utils device-mapper-persistent-data lvm2
[root@xuegod61 ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.
[root@xuegod61 ~]# vgcreate cinder-volumes /dev/sdb #创建一个名字为cinder-volumes的卷组,给后期cinder使用
Volume group "cinder-volumes" successfully created
[root@xuegod61 ~]# systemctl enable lvm2-lvmetad.service
[root@xuegod61 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
cinder-volumes 1 0 0 wz--n- <20.00g <20.00g
63上操作
pip install kolla-ansible 如果报错用下面命令安装提示少什么忽略什么 之前用这个pip install kolla-ansible --ignore-installed pyparsing后面会报错不要用
pip install --ignore-installed PyYAML
pip install kolla-ansible
2、复制kolla-ansible的相关配置文件
[root@xuegod63 ~]# cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/
[root@xuegod63 ~]# cp /usr/share/kolla-ansible/ansible/inventory/* /etc/kolla/
[root@xuegod63 kolla-ansible]# ls /etc/kolla/
all-in-one globals.yml multinode passwords.yml
注:all-in-one #安装单节点openstack的ansible自动安装配置文件,就是ansible主机清单文件
multinode #安装多节点openstack的ansible自动安装配置文件,就是ansible主机清单文件
globals.yml #部署openstack的自定义配置文件
4、修改虚拟机类型为qemu
注:如果是在虚拟机里装kolla,希望可以在虚拟机中再启动虚拟机,那么你需要把virt_type=qemu,默认是kvm。如果vmware开了“虚拟化Intel VT”功能,就不用写这个了。为了不报错三台都装
[root@xuegod63 kolla-ansible]# mkdir -p /etc/kolla/config/nova
[root@xuegod63 kolla-ansible]# cat << EOF > /etc/kolla/config/nova/nova-compute.conf
[libvirt]
virt_type=qemu
cpu_mode = none
EOF
6.3 自定义kolla-ansible安装openstack的相关配置文件
1、自动生成openstack各服务的密码文件
[root@xuegod63 kolla-ansible]# kolla-genpwd
[root@xuegod63 ~]# vi /etc/kolla/passwords.yml
改:162 keystone_admin_password: HsPbEQHxTqmewKYNoRPpIOyQNdEYpHy36OX67TG3
为:keystone_admin_password: 123456
注:这是登录Dashboard,admin使用的密码,你可以根据自己需要进行修改。
2、编辑 /etc/kolla/globals.yml 自定义openstack中部署事项
[root@xuegod63 ~]# vi /etc/kolla/globals.yml #配置openstack安装中的参数
改:15 #kolla_base_distro: "centos" #选择下载的镜像为基于centos版本的镜像
为: kolla_base_distro: "centos"
改:18 #kolla_install_type: "binary" #去了前面的#号,使用yum安装二进制包安装,源码安装,指的是使用git clone源码安装
为:18 kolla_install_type: "binary"
改:21 #openstack_release: ""
为:openstack_release: "pike" #指定安装pike版本的openstack,后期下载的openstack相关的docker镜像的tag标记也都为pike
改:24 #node_custom_config: "/etc/kolla/config" #配置文件的位置
为:24 node_custom_config: "/etc/kolla/config" #去了前面的#号,因为我对nova节点做了自定义。如:我自定义virt_type 虚拟化类型为qemu,默认是kvm。
改:31 kolla_internal_vip_address: "10.10.10.254"
为:31 kolla_internal_vip_address: "192.168.1.63" # 我们没有启用高可用,所以这里的IP可以和ens33一样,也可以独立写一个和ens33同网段的IP。
注:如果配置了高可用,这里要使用一个没被占用的IP。这个IP是搭建HA高可用的浮动IP。 此IP将由keepalived管理以提供高可用性,应设置为和network_interface ens33 同一个网段的地址。
改:85 #network_interface: "eth0"
为: network_interface: "ens33" #设置OpenStack所以节点内部通信使用的网络接口。这是openstack内部多个管理类型网络的默认接口。这里我们以ens33作为内部通信网络
改: 把前面的#号去了
89 #kolla_external_vip_interface: "{{ network_interface }}"
90 #api_interface: "{{ network_interface }}"
91 #storage_interface: "{{ network_interface }}"
92 #cluster_interface: "{{ network_interface }}"
93 #tunnel_interface: "{{ network_interface }}"
94 #dns_interface: "{{ network_interface }}"
为:
89 kolla_external_vip_interface: "{{ network_interface }}"
90 api_interface: "{{ network_interface }}"
91 storage_interface: "{{ network_interface }}"
92 cluster_interface: "{{ network_interface }}"
93 tunnel_interface: "{{ network_interface }}"
94 dns_interface: "{{ network_interface }}"
注:这样所有内部通信网络都走network_interface ,即ens33
改:100 #neutron_external_interface: "eth1"
为:100 neutron_external_interface: "ens38" # ens38作为外部网络,所需的第二个接口专用于Neutron外部(或公共)网络,可以是vlan或flat,取决于网络的创建方式。 此接口应在没有IP地址的情况下处于活动 如果不是,云主机实例将无法访问外部网络。 所以ens38不能有IP,只要网卡启动着,就可以了。
改:150 #enable_cinder: "no"
为:150 enable_cinder: "yes" #删除最前面的#号,并改no为yes。 启用cinder
改:155 #enable_cinder_backend_lvm: "no"
为:155 enable_cinder_backend_lvm: "yes" #删除最前面的#号,并改no为yes。cinder后端用lvm
改:167 #enable_haproxy: "yes"
为:167 enable_haproxy: "no" #删除最前面的#号,并改yes为no。关闭高可用
改:319 #cinder_volume_group: "cinder-volumes"
为:319 cinder_volume_group: "cinder-volumes" #取消前面的#号,这个卷组的名字是我们在xuegod62上创建的
ssh node61
ssh node62
ssh master63
vi /etc/kolla/multinode
node61
node62
master63
[root@xuegod63 kolla]# kolla-ansible -i /etc/kolla/multinode prechecks
kolla-ansible -i /etc/kolla/multinode pull 拉取镜像
kolla-ansible -i /etc/kolla/multinode deploy 开始部署
yum install python-devel libffi-devel gcc openssl-devel git python-pip -y
解决:在xuegod62和xuegod64上执行:
[root@xuegod64 ~]# pip uninstall docker
[root@xuegod64 ~]# pip uninstall docker-py
[root@xuegod64 ~]# pip install -U docker --ignore-installed requests
kolla-ansible -i /etc/kolla/multinode deploy
kolla-ansible -i /etc/kolla/multinode pull
kolla-ansible -i /etc/kolla/all-in-one pull
netstat -antup
docker images
docker ps
kolla-ansible -i /etc/kolla/multinode bootstrap-servers
FAILED - RETRYING: Waiting for nova-compute service up (18 retries left).
FAILED - RETRYING: Waiting for nova-compute service up (17 retries left).
FAILED - RETRYING: Waiting for nova-compute service up (16 retries left).
如果报这个错误是因为执行了这个可是最后还是不行 可能是esxi6.5的虚拟环境有地方需要调整,用clone方式正常部署
pip install kolla-ansible --ignore-installed pyparsing
pip uninstall kolla-ansible

浙公网安备 33010602011771号