例1 3A 认证
Local 模式 一般测试使用,只选哟一台物理机即可
GRE 模式,隧道模式,Vlan 数量没有限制,性能有点问题
Vlan 莫斯,vlan 数量有6096 的限制
VXLAN 模式,valan 数量没有限制,性能比GRE 好
Flat 模式,管理员车键租户直接到外网,不需要NAT
3 安装epel 源
yum install epel-release -y
4 配置/etc/hosts
192.168.24.66 xuegod6
5 )[root@xuegod6 ~]# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
6 ) [root@xuegod6 yum.repos.d]# yum install ntp -y
&& systemctl enable ntpd.service
systemctl start ntpd.service
7 ) 创建自己的源
创建目录mkdir ~/.pip
[root@xuegod6 ~]# vim ~/.pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
8 ) 复制ifcfg-ens33 网卡
修改ens38
cp ifcfg-ens33 ifcfg-ens38
TYPE=Ethernet
BOOTPROTO=none
NAME=ens38
DEVICE=ens38
ONBOOT=yes
~
9 ) [root@xuegod6 ~]# yum install python-devel libffi-devel gcc openssl-devel git python-pip -y
升级
pip install -U pip
10 ) [root@xuegod6 ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
关闭 systemctl stop libvirtd && systemctl disable libvirtd
11 ) [root@xuegod6 ~]# yum remove docker docker-io docker-selinux python-docker-py -y
12 ) 添加docker 的yum 源
[root@xuegod6 ~]# sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装docker -ce 社区版本
13 ) [root@xuegod6 ~]# yum -y install docker-ce
14 ) systemctl start docker && systemctl enable docker && systemctl status docker 启动docker 服务
15 )
[root@xuegod6 ~]# mkdir /etc/systemd/system/docker.service.d
[root@xuegod6 ~]# tee /etc/systemd/system/docker.service.d/kolla.conf << 'EOF'
> [Service]
> MountFlags=shared
> EOF
[Service]
MountFlags=shared
16 ) 指定docker 镜像加速器 (很重要,不然后期从国外下载docker ,镜像会直接报错,而且速度慢)
mkdir /etc/docker/
[root@xuegod6 ~]# vim /etc/docker/daemon.json
{
"registry-mirrors":["https://e9yneuy4.mirrors.aliyuncs.com"]
}
17 ) 重启相关服务
systemctl daemon-reload # 修改启动脚本,需要执行
systemctl start docker && systemctl enable docker && systemctl status docker
二 安装kolla-ansible
1 ) yum install ansible -y
2 ) 安装kolla-ansible 的代码
kolla-ansible 可以实现ansible 启动安装OpenStack
cd /root/
[root@xuegod6 ~]# git clone http://git.trystack.cn/openstack/kolla-ansible -b stable/pike
[root@xuegod6 ~]# git clone http://git.trystack.cn/openstack/kolla-ansible -b stable/pike
正克隆到 'kolla-ansible'...
remote: Counting objects: 107426, done.
remote: Compressing objects: 100% (34332/34332), done.
remote: Total 107426 (delta 71845), reused 101787 (delta 67789)
接收对象中: 100% (107426/107426), 15.07 MiB | 84.00 KiB/s, done.
处理 delta 中: 100% (71845/71845), done.
下载安装 3 ) pip install . 当前目录
[root@xuegod6 kolla-ansible]# echo $?
0
4 )复制配置文件
[root@xuegod6 kolla-ansible]# ls etc/kolla/
globals.yml passwords.yml
[root@xuegod6 kolla-ansible]# cp -r etc/kolla/ /etc/kolla
5 )[r
oot@xuegod6 kolla-ansible]# ls ansible/inventory/
all-in-one multinode
[root@xuegod6 kolla-ansible]# ls ansible/inventory/all-in-one
ansible/inventory/all-in-one
[root@xuegod6 kolla-ansible]# cp ansible/inventory/* /etc/kolla/
[root@xuegod6 kolla-ansible]# cd /etc/kolla/
[root@xuegod6 kolla]# ls
all-in-one globals.yml multinode passwords.yml
修改虚拟机类型为qemu
[root@xuegod6 kolla]# mkdir -p /etc/kolla/config/nova
[root@xuegod6 kolla]# cat << EOF > /etc/kolla/config/nova/nova-compute.conf
> [libvirt]
> virt_type=qemu
> cpu_mode = none
> EOF
[root@xuegod6 kolla]# which kolla-genpwd
/bin/kolla-genpwd
[root@xuegod6 kolla]# rpm -qf /bin/kolla-genpwd
文件 /bin/kolla-genpwd 不属于任何软件包
7 )
[root@xuegod6 kolla]# kolla-genpwd
[root@xuegod6 kolla]# vim /etc/kolla/passwords.yml
[root@xuegod6 kolla]# vim globals.yml
4.8 开始基于kolla-ansible 安装OpenStack 私有云
生成 SSH key 并接受节点
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub root@xuegod6
9 ) 开始编辑主机清单
开始补助OpenStack
OpenStack network list
openstack subnet list
ip netns