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

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值