..
声明:
本博客欢迎转发,但请保留原作者信息!
博客地址:http://blog.csdn.net/liujiong63
新浪微博:@Jeremy____Liu
内容系本人学习、研究和总结,如有雷同,实属荣幸!
环境:centos7.2.1511
yum install -y epel-release
yum -y update
yum install -y python-pip
pip install –U pip
yum install -y python-devel libffi-devel gcc openssl-devel git
yum -y install docker-io
修改MountFlags选项
vim /usr/lib/systemd/system/docker.service
在service节加上
MountFlags=shared
保存退出,重新加载配置,重启docker服务
systemctl daemon-reload
systemctl restart docker
yum install -y python-docker-py
或者
pip install -U docker-py
ntpdate asia.pool.ntp.org
systemctl stop libvirtd.service
systemctl disable libvirtd.service
yum install -y ansible
或者
pip install ansible
git clone https://git.openstack.org/openstack/kolla -b stable/ocata
pip install -r kolla/requirements.txt -r kolla/test-requirements.txt
pip install kolla/
pip install -U tox
cd kolla/
tox -e genconfig
cp -rv etc/kolla /etc/
yum install http://mirror.centos.org/centos/7/cloud/x86_64/openstack-ocata/centos-release-openstack-ocata-1-1.el7.noarch.rpm -y
yum install python-openstackclient python-neutronclient
kolla-build --base centos --type binary
docker images
OpenStack环境的密码等变量可以在 /etc/kolla/passwords.yml 中指定,为了方便可以使用kolla-genpwd工具自动生成复杂密码。
kolla-genpwd
为了方便,我们修改其中的管理员登陆密码
vim /etc/kolla/passwords.yml
keystone_admin_password: admin
修改/etc/kolla/globals.yml 文件,指定部署的一些信息:
vim /etc/kolla/globals.yml
kolla_base_distro: "centos"
kolla_install_type: "binary"
openstack_release: "4.0.0"
# This should be a VIP, an unused IP on your network that will float between
# the hosts running keepalived for high-availability. When running an All-In-One
# without haproxy and keepalived, this should be the first IP on your
# 'network_interface' as set in the Networking section below.
kolla_internal_vip_address: "192.168.0.112
network_interface: "eno16777736"
neutron_external_interface: "eno16777736"
neutron_plugin_agent: "openvswitch"
openstack_logging_debug: "True"
kolla-ansible prechecks
kolla-ansible deploy
部署成功后查看容器
docker ps
yum install iptables-services -y
iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp -m tcp --dport 6080 -j ACCEPT
service iptables save
因为是在虚拟机中安装,不支持kvm,需要修改虚拟类型为qemu
vim /etc/kolla/nova-compute/nova.conf
[libvirt]
...
virt_type=qemu
若使用单网卡,在部署到 neutron-ovs 容器的时候会断网, 需要配置 br-ex网桥,配置内容如下:
cat /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE=OVSPort
DEVICE=eno16777736
ONBOOT=yes
DEVICETYPE=ovs
OVS_BRIDGE=br-ex
vim /etc/sysconfig/network-scripts/ifcfg-br-ex
DEVICE=br-ex
DEVICETYPE=ovs
TYPE=OVSBridge
BOOTPROTO=static
IPADDR=192.168.0.112
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
重启网络服务:
systemctl restart network
然后就可以通过 kolla_internal_vip_address 访问OpenStack环境