使用kolla部署OpenStack Ocata单节点

..
声明:
本博客欢迎转发,但请保留原作者信息!
博客地址:http://blog.csdn.net/liujiong63
新浪微博:@Jeremy____Liu
内容系本人学习、研究和总结,如有雷同,实属荣幸!


环境:centos7.2.1511

安装epel源并升级pip

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

安装docker

yum -y install docker-io

配置docker

修改MountFlags选项

vim /usr/lib/systemd/system/docker.service

在service节加上

MountFlags=shared

保存退出,重新加载配置,重启docker服务

systemctl daemon-reload
systemctl restart docker

安装最新版docker-py

yum install -y python-docker-py

或者

pip install -U docker-py

配置时间同步

ntpdate asia.pool.ntp.org

禁用libvirt

systemctl stop libvirtd.service
systemctl disable libvirtd.service

安装ansible

yum install -y ansible

或者

pip install ansible

克隆kolla仓库stable/ocata分支

git clone https://git.openstack.org/openstack/kolla -b stable/ocata

安装kolla及其依赖

pip install -r kolla/requirements.txt -r kolla/test-requirements.txt
pip install kolla/

安装tox,生成配置文件

pip install -U tox
cd kolla/
tox -e genconfig
cp -rv etc/kolla /etc/

安装client

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

添加iptables

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环境

你可能感兴趣的:(OpenStack,OpenStack技术专栏)