check

Kolla installation Openstack

A dare
2019.03.22 18:42:10 number of words 648 read 1,471

common problem

1.Cannot uninstall 'ipaddress'. It is a distutils installed project and thus we can not accurately determine which files belong to it which would lead to only a partial uninstall.
Such problems can be forced to upgrade this installation package. (It has been found PyYAML, ipaddress)
PIP install --ignore-Installed ipaddress

2.ImportError: cannot import name decorate
pip install -U decorator

Preparing the Environment

Start the virtual machine

Configuration is as follows:

Memory: 8G (propose to high)
Processor: 2 core (after open nested virtualization, virtual machines created to function properly, do not open here does not affect the temporary deployment)
when 100G (system tray) + 20GB (create cinder lvm: hard disk use)
network: two nat network, an IP, IP is not a

[root@localhost ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:50:56:b8:28:4a brd ff:ff:ff:ff:ff:ff
    inet 172.16.3.110/21 brd 172.16.7.255 scope global noprefixroute ens32
       valid_lft forever preferred_lft forever
    inet6 fe80::5392:1c67:1013:ad96/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:50:56:b8:d3:01 brd ff:ff:ff:ff:ff:ff

Configuration accelerate source

yum acceleration source (centos7 Ali source)
yum install -y wget
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
docker acceleration source (Ali source)
wget -P /etc/yum.repos.d/ https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce
mkdir /etc/docker
cat > /etc/docker/daemon.json << EOF
{
  "registry-mirrors": ["https://iw3lcsa3.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload && systemctl enable docker && systemctl restart docker
Generate and copy key
ssh-keygen 
ssh-copy-id controller 
Turn off the firewall
setenforce 0

vim /etc/selinux/config
SELINUX=disabled

systemctl stop firewalld && systemctl disable firewalld
systemctl stop libvirtd.service && systemctl disable libvirtd.service
Modify hostname
hostnamectl set-hostname kolla

kolla-ansible department

Installing the software environment
yum install -y epel-release 
yum install -y python-pip
pip install -U pip
yum install -y python-devel libffi-devel gcc openssl-devel libselinux-python
yum install -y ansible
pip install kolla-ansible


yum install -y epel-release && yum install -y python-pip &&  pip install -U pip && yum install -y python-devel libffi-devel gcc openssl-devel libselinux-python && yum install -y ansible  && pip install kolla-ansible
Error Resolution
Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.


rm -rf /usr/lib64/python2.7/site-packages/PyYAML*
Copy globals.yml and passwords.yml to / etc / kolla directory
cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/kolla/
Copy the all-in-one and multinode inventory file to the current directory.

This place giant pit, a place to keep separate, subsequent commands to use this place all-in-one


cp /usr/share/kolla-ansible/ansible/inventory/* /root/

If no command git, manually install yum install -y git

And get Kolla Kolla-Ansible repository
cd /usr/local/src
git clone https://github.com/openstack/kolla
git clone https://github.com/openstack/kolla-ansible
Kolla-ansible stored in the etc / kolla configuration files (globals.yml and passwords.yml) to copy the configuration file / etc / kolla directory
cp -r kolla-ansible/etc/kolla /etc/kolla/
Kolla-ansible inventory files (all-in-one and multinode) stored in the ansible / inventory in.
The list of documents will now be copied to the current directory
cp kolla-ansible/ansible/inventory/* /usr/local/src

Ready to deploy OpenStack single node on the host (if it is a multi-node configuration required multinode file)

The password is stored for use in the deployment /etc/kolla/passwords.yml file.
#通过运行下面命令生成随机密码:

kolla-genpwd

After initialization, you can change keystone_admin_password password manually (OpenStack password)

vim /etc/kolla/passwords.yml
keystone_admin_password:admin
Edit the configuration file /etc/kolla/globals.yml
kolla_base_distro: "centos"
# binary使用像apt或yum这样的软件仓库,source使用原始源代码归档,git存储库或本地源代码目录

kolla_install_type: "source"  
openstack_release: "queens"  # 使用的版本

network_interface: "ens32"  # OpenStack使用的网络接口
ens32属于NAT网络里,设置的IP是:172.16.3.110,Horizon访问就是通过这个IP地址

# 第二个接口专用于Neutron外部(或公共)网络,可以是vlan或flat,取决于网络的创建方式。
# 这个接口应该是活动的,没有IP地址。否则,实例将无法访问外部网络
neutron_external_interface: "ens33"
#ens33桥接模式,ip其实是dhcp分配,这个其实是让neutron的br-ex 绑定使用,虚拟机是通过这块网卡访问外网
kolla_internal_vip_address: "172.16.3.111"  # 与eth32IP同网段且未被使用的IP

Begin deployment

''' 1、带有kolla的引导服务器部署依赖关系''' 
kolla-ansible -i ./all-in-one bootstrap-servers

''' 2、对主机执行预部署检查''' 
kolla-ansible -i ./all-in-one prechecks

''' 3、执行OpenStack部署'''
kolla-ansible -i ./all-in-one deploy

After installing OpenStack execute command-line error

ImportError: cannot import name decorate

pip install decorate

Use OpenStack

OpenStack need a openrc file, in which the admin user credentials.
To generate this file, run the following command:
kolla-ansible post-deploy
. /etc/kolla/admin-openrc.sh
The basic installation of OpenStack CLI client:
--ignore-installed

pip install python-openstackclient python-glanceclient python-neutronclient decorate
Run the script to create a sample network and images
. /usr/share/kolla-ansible/init-runonce

Due to an error, you might need to deploy many times, and some redeployment error is not corrected, it is necessary to clean up the environment:

    /usr/share/kolla-ansible/tools/cleanup-containers                #可用于从系统中移除部署的容器
    /usr/share/kolla-ansible/tools/cleanup-host                      #可用于移除由于残余网络变化引发的docker启动的neutron-agents主机
    /usr/share/kolla-ansible/tools/cleanup-images                    #可用于从本地缓存中移除所有的docker image

ImportError: cannot import name decorate

Directly to the file, comment out the line to import

解决方法:
/usr/lib/python2.7/site-packages/dogpile/cache/region.py  文件中的 from decorator import decorate  注释

问题:kolla "Waiting for virtual IP to appear"

/etc/kolla/globals.yml
keepalived_virtual_router_id: "250"

Internet connection

iptables -A INPUT -i br-ex -j ACCEPT #注意内核转发问题(INPUT都需要允许才行)
iptables -t nat -A POSTROUTING -s 10.0.2.0/255.255.255.0  -j SNAT --to-source 10.8.250.57

ifconfig br-ex 10.0.2.1/24

Examples according to the size of disk space to mount


 
image.png

Create a mirror

   openstack image create --disk-format qcow2 --container-format bare --public \
    --property os_type=linux --file /root/windows_XP_64_20G  windows_XP


/usr/lib/python2.7/site-packages/requests/init.py:80: RequestsDependencyWarning: urllib3 (1.22)

解决方案,制裁urllib3  和chardet

sudo pip uninstall urllib3
sudo pip uninstall chardet

然后,再安装
sudo pip install requests

*qcow2镜像启动问题

openstack image create --disk-format qcow2 --container-format bare --public  --property hw_disk_bus=ide   --property hw_vif_model=rtl8139   --property os_type=linux --file /root/windows_XP_64_20G windows_XP_64_20G

--property hw_disk_bus=ide   #硬盘问题
--property hw_vif_model=rtl8139  #网卡问题(参数可修改为e1000)

多节点安装

yum install docker-engine-1.12.6 docker-engine-selinux-1.12.6 -y
yum list installed|grep docker
yum remove docker-selinux.x86_64 -y

环境问题解决

docker volume rm mariadb
cd /var/lib/docker/volumes 
删除 除 metadata.db所有文件
 
 
1人点赞
 
 
"小礼物走一走,来简书关注我"
还没有人赞赏,支持一下
总资产20 (约2.03元) 共写了5.0W字 获得47个赞 共40个粉丝

Guess you like

Origin www.cnblogs.com/tcpblog/p/12081868.html