基于kolla安装OpenStack Queens版本

33 篇文章 16 订阅
8 篇文章 0 订阅

1. 环境准备

新创建1台虚拟机,配置2张网卡,作为all in one节点。操作系统为centos7.4

1)关闭Selinux

vi /etc/sysconfig/selinux
SELINUX=disabled

2)关闭firewalld

systemctl stop firewalld
systemctl disable firewalld

3)确认节点网卡配置

eth0 网卡作为 API&Management 网络 和 Tenant(VM) 网络,使用的是“NAT模式”,IP地址为 192.168.128.90 。
eth1 网卡作为 外部网络,模拟OpenStack的外网,这里选择“仅主机模式”,不设置IP。

2.安装 docker

1)添加Docker源

cd /etc/yum.repos.d/
vi docker.repo

[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg

2)添加epel源
vi epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel/7/$basearch
        http://mirrors.aliyuncs.com/epel/7/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

3)安装Docker 1.12.6

yum install docker-engine-1.12.6 docker-engine-selinux-1.12.6 -y

4)设置Docker

mkdir /etc/systemd/system/docker.service.d
vi /etc/systemd/system/docker.service.d/kolla.conf

[Service]
MountFlags=shared

5)重启相关服务

systemctl daemon-reload
systemctl enable docker
systemctl restart docker

6)配置阿里云的Docker加速器,加快pull registry镜像

mkdir -p /etc/docker

tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://a5aghnme.mirror.aliyuncs.com"]
}
EOF

重启下服务

systemctl daemon-reload && systemctl restart docker

7)设置代理(如果需要)

创建配置文件/etc/systemd/system/docker.service.d/http-proxy.conf,添加如下配置:

[Service] 
Environment="HTTP_PROXY=http://ip:port/"
Environment="HTTPS_PROXY=http://ip:port/"

重启服务

systemctl daemon-reload && systemctl restart docker

3.安装 kolla

1)安装 pip

yum install python-pip
pip install -U pip -i https://pypi.tuna.tsinghua.edu.cn/simple

2)安装基础软件

yum install python-devel libffi-devel gcc openssl-devel libselinux-python

3)安装 ansible

pip install -U ansible -i https://pypi.tuna.tsinghua.edu.cn/simple

4)安装 kolla-ansible

pip install -U kolla-ansible -i https://pypi.tuna.tsinghua.edu.cn/simple

5)复制相关配置文件

cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/
cp /usr/share/kolla-ansible/ansible/inventory/* /home/

6)生成密码文件

kolla-genpwd

7)编辑 /etc/kolla/passwords.yml文件,配置keystone管理员用户的密码。

keystone_admin_password: admin

同时,也是登录Dashboard,admin使用的密码,你可以根据自己需要进行修改。

8)编辑 /etc/kolla/globals.yml 配置文件

kolla_internal_vip_address: " 192.168.128.90"   //访问Dashboard的地址
openstack_release: "queens"
network_interface: "eth0"                 
neutron_external_interface: "eth1"             //该网卡不配置IP地址
enable_haproxy: "no"

9)部署前检查

kolla-ansible prechecks -i /home/all-in-one

10)先拉取镜像

kolla-ansible pull -i /home/all-in-one

11)安装 Docker python libraries, 否则会报错

pip install -U docker -i https://pypi.tuna.tsinghua.edu.cn/simple

12)部署

kolla-ansible deploy -i /home/all-in-one

等待大约30分钟,部署完成。

13)登录 dashboard
http://192.168.128.90

14)安装客户端

pip install python-openstackclient python-glanceclient python-neutronclient -i https://pypi.tuna.tsinghua.edu.cn/simple

如何使用,请参考以前博客https://blog.csdn.net/dylloveyou/article/details/77148560

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值