GunSik2 / engineering_qna

Software Engineering Problem and Solving
0 stars 0 forks source link

centos7-kolla #8

Open GunSik2 opened 4 years ago

GunSik2 commented 4 years ago

Install dependencies¶

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

Install dependencies using a virtual environment

sudo yum install python-virtualenv
mkdir kolla-env; virtualenv kolla-env
. kolla-env/bin/activate

pip install -U pip
pip install ansible

Install Kolla-ansible

pip install kolla-ansible

sudo mkdir -p /etc/kolla
sudo chown $USER:$USER /etc/kolla
cp -r kolla-env/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
cp kolla-env/share/kolla-ansible/ansible/inventory/* .

Configure Ansible

vi /etc/ansible/ansible.cfg
[defaults]
host_key_checking=False
pipelining=True
forks=100

Prepare initial configuration

# vi multinode

# ansible -i multinode all -m ping
# kolla-genpwd
# vim /etc/kolla/globals.yml
openstack_release: "train"

Deployment

kolla-ansible -i ./multinode bootstrap-servers
kolla-ansible -i ./multinode prechecks
kolla-ansible -i ./multinode deploy

Using OpenStack

pip install python-openstackclient
kolla-ansible post-deploy
. /etc/kolla/admin-openrc.sh

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

Reference

GunSik2 commented 4 years ago

sudo yum install https://releases.hashicorp.com/vagrant/2.2.7/vagrant_2.2.7_x86_64.rpm

vagrant plugin install vagrant-hostmanager vagrant plugin install --plugin-version ">= 0.0.31" vagrant-libvirt sudo gpasswd -a ${USER} libvirt newgrp libvirt

sudo firewall-cmd --zone=internal --add-interface=virbr0 sudo firewall-cmd --zone=internal --add-interface=virbr1 sudo firewall-cmd --permanent --zone=internal --add-service=nfs sudo firewall-cmd --permanent --zone=internal --add-service=rpc-bind sudo firewall-cmd --permanent --zone=internal --add-service=mountd sudo firewall-cmd --permanent --zone=internal --add-port=2049/udp sudo firewall-cmd --permanent --add-port=2049/tcp sudo firewall-cmd --permanent --add-port=111/udp sudo firewall-cmd --permanent --add-port=111/tcp

sudo firewall-cmd --reload sudo systemctl restart firewalld sudo firewall-cmd --list-all sudo firewall-cmd --zone=internal --list-all

// enable udp

vi /etc/nfs.conf

[nfsd] udp=y

sudo systemctl start nfs-server sudo systemctl start rpcbind.service sudo systemctl enable nfs-server sudo systemctl enable rpcbind.service

sudo systemctl start libvirtd sudo systemctl enable libvirtd


- create vm using vagrant

mkdir kolla; cd kolla; git clone https://opendev.org/openstack/kolla-cli -b stable/train git clone https://opendev.org/openstack/kolla-ansible -b stable/train git clone https://opendev.org/openstack/kolla -b stable/train

sudo yum install -y python3-pip sudo ln -s /bin/python3 /bin/python // sudo alternatives --set python /bin/python3

cd kolla-ansible/contrib/dev/vagrant && vagrant up vagrant status


- ssh to operator vm and deploy kolla-ansible to multiple vm nodes

vagrant ssh operator

sudo rm /etc/yum.repos.d/docker.repo // fix sudo yum install epel-release sudo yum install ansible

sudo pip install --upgrade pip sudo yum install -y epel-release python-pip sudo pip install -r kolla/requirements.txt -r kolla/test-requirements.txt

sudo pip install "kolla-ansible==5.0.0"

kolla-genpwd sudo kolla-ansible deploy -i /usr/share/kolla-ansible/ansible/inventory/multinode kolla-ansible post-deploy . /etc/kolla/admin-openrc.sh openstack user list



# Reference
- https://docs.openstack.org/tacker/latest/install/kolla.html
GunSik2 commented 4 years ago
yum install python-devel libffi-devel gcc openssl-devel libselinux-python

yum install python-virtualenv
virtualenv kolla-env
source kolla-env/bin/activate
(kolla-env) git clone https://github.com/openstack/kolla-ansible.git -b stable/train
(kolla-env) cd kolla-ansible
(kolla-env) pip install -r requirements.txt
(kolla-env) pip install --upgrade pip
(kolla-env) python setup.py install
(kolla-env) pip install "kolla-ansible==9.0.1"

(kolla-env) kolla-genpwd
(kolla-env) kolla-ansible deploy -i /etc/kolla/inventory/all-in-one
/root/kolla-env/bin/kolla-ansible: line 28: ansible-playbook: command not found

(kolla-env) kolla-ansible post-deploy
(kolla-env) docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Names}}"