首页 > 代码库 > Kolla安装单节点Ocata

Kolla安装单节点Ocata

安装源配置

# cat /etc/yum.repos.d/centos.repo

[base]

name=CentOS-$releasever

enabled=1

baseurl=http://mirrors.aliyun.com/centos/7.3.1611/os/x86_64/

gpgcheck=0

 

[updates]

name=CentOS-$releasever

enabled=1

baseurl=http://mirrors.aliyun.com/centos/7.3.1611/updates/x86_64/

gpgcheck=0

 

[extras]

name=CentOS-$releasever

enabled=1

failovermethod=priority

baseurl=http://mirrors.aliyun.com/centos/7.3.1611/extras/x86_64/

gpgcheck=0

 

 

 

# cat /etc/yum.repos.d/epel.repo

[epel]

name=Extra Packages for Enterprise Linux 7- $basearch

enabled=1

baseurl=https://mirrors.aliyun.com/epel/7/x86_64/

gpgcheck=0

 

 

 

 

# tee /etc/yum.repos.d/docker.repo <<‘EOF‘

[dockerrepo]

name=Docker Repository

baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/

enabled=1

gpgcheck=1

gpgkey=https://yum.dockerproject.org/gpg

EOF

 

 

 

# yum update -y

 

装包

# yuminstall python-devel libffi-devel gcc openssl-devel git python-pip -y

# yuminstall docker-engine-1.12.5 docker-engine-selinux-1.12.5 -y

# yum install ansible

# pip install -U pip

 

配置

# mkdir/etc/systemd/system/docker.service.d

# tee /etc/systemd/system/docker.service.d/kolla.conf<< ‘EOF‘

[Service]

MountFlags=shared

EOF

 

#systemctl daemon-reload

# systemctl enable docker

#systemctl restart docker

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

#ExecStart=/usr/bin/dockerd

ExecStart=/usr/bin/dockerd--insecure-registry 192.168.252.132:4000

 

# systemctl daemon-reload

# systemctl restart docker

 

Registry 服务器

# docker run -d -v/opt/registry:/var/lib/registry -p 4000:5000 \

--restart=always --name registry registry:2


# wgethttp://tarballs.openstack.org/kolla/images/centos-source-registry-ocata.tar.gz

# tar zxvf centos-source-registry-ocata.tar.gz -C /opt/registry/

 

 

kolla-ansible

# cd /home

# git clone http://git.trystack.cn/openstack/kolla-ansible-b stable/ocata

 


# cd kolla-ansible

# pip install .

# cp -r etc/kolla/etc/kolla/

# cp ansible/inventory/*/home/

 

# mkdir -p /etc/kolla/config/nova

cat << EOF > /etc/kolla/config/nova/nova-compute.conf

[libvirt]

virt_type=qemu

cpu_mode = none

EOF

# kolla-genpwd

# vim /etc/kolla/passwords.yml

keystone_admin_password: Abcd1234          ##必须字母,纯数字不行

 

 

# vim /etc/kolla/globals.yml

kolla_internal_vip_address: "192.168.252.133"

kolla_install_type: "source"

openstack_release: "4.0.3"    ###通过docker imgaes确定

docker_registry: "192.168.252.132:4000"

docker_namespace:"lokolla"

network_interface: "ens33"

neutron_external_interface: "ens34"

# kolla-ansibleprechecks -i /home/all-in-one

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

 

验证

# pip install python-openstackclient

# kolla-ansiblepost-deploy     ###自动创建/etc/kolla/admin-openrc.sh

# . /etc/kolla/admin-openrc.sh

# openstack service list

# vim  /usr/share/kolla-ansible/init-runonce

 

IMAGE_URL=http://download.cirros-cloud.net/0.3.5/

IMAGE=cirros-0.3.5-x86_64-disk.img

IMAGE_NAME=cirros

 

EXT_NET_CIDR=‘192.168.102.0/24‘

EXT_NET_RANGE=‘start=192.168.102.114,end=192.168.102.119‘

EXT_NET_GATEWAY=‘192.168.102.254‘

 

# cd /usr/share/kolla-ansible

./init-runonce

#


 参考沙克老师的文章

http://www.chenshake.com/kolla-installation/

 


Kolla安装单节点Ocata