openstack stein 部署大数据容器及prometheus

[root@kolla ~]# cat /etc/selinux/config
SELINUX=disabled

关闭防火墙
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
firewall-cmd --state

[root@kolla ~]# yum install epel-release -y
[root@kolla ~]# cat /etc/hostname
kolla
[root@kolla ~]# cat /etc/hosts
127.0.0.1 localhost
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.229.141 kolla

[root@kolla ~]# yum install ntp -y
systemctl enable ntpd.service
systemctl start ntpd.service
ntpdate 0.centos.pool.ntp.org
[root@kolla ~]# reboot

[root@kolla ~]# yum install python-devel libffi-devel gcc openssl-devel git python-pip -y
[root@kolla ~]# 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
[root@kolla ~]# yum install docker-engine docker-engine-selinux -y
[root@kolla ~]# mkdir /etc/systemd/system/docker.service.d
[root@kolla ~]# tee /etc/systemd/system/docker.service.d/kolla.conf << 'EOF'
[Service]
MountFlags=shared
EOF

[root@kolla ~]# cat /etc/docker/daemon.json
{
  "registry-mirrors": ["https://w8u7tu0n.mirror.aliyuncs.com"]
}
[root@kolla ~]#

重启相关服务
systemctl daemon-reload
systemctl enable docker
systemctl restart docker
下载openstack镜像stein版本
[root@kolla ~]# cat images.txt
kolla/centos-source-ceph-osd                            stein               19184f21541f        3 days ago          730MB
kolla/centos-source-horizon                             stein               6de0c693fcb4        4 days ago          1.22GB
kolla/centos-source-bifrost-deploy                      stein               dad6ec9c442f        4 days ago          1.74GB
kolla/centos-source-glance-api                          stein               25f46864a138        4 days ago          1.08GB
kolla/centos-source-bifrost-base                        stein               4b6db41882cd        4 days ago          1.7GB
kolla/centos-source-swift-rsyncd                        stein               2d4fba98d5ba        4 days ago          1.04GB
kolla/centos-source-nova-compute                        stein               c15b455a572c        4 days ago          1.7GB
kolla/centos-source-cinder-volume                       stein               0c7e0b02a350        4 days ago          1.22GB
kolla/centos-source-keystone-fernet                     stein               6c761eaca03b        4 days ago          1.09GB
kolla/centos-source-glance-registry                     stein               c4b2c40e74f3        4 days ago          1.04GB
kolla/centos-source-keystone                            stein               322a0b43b21d        4 days ago          1.09GB
kolla/centos-source-swift-container                     stein               249fa0638440        4 days ago          1.01GB
kolla/centos-source-swift-object-expirer                stein               c839c56d067d        4 days ago          1.01GB
kolla/centos-source-cinder-backup                       stein               7a7d62fba06f        4 days ago          1.21GB
kolla/centos-source-swift-account                       stein               c21b81f1731c        4 days ago          1.01GB
kolla/centos-source-swift-object                        stein               ccc0a87990fc        4 days ago          1.01GB
kolla/centos-source-swift-proxy-server                  stein               d716f75244db        4 days ago          1.01GB
kolla/centos-source-gnocchi-metricd                     stein               6949db40f688        4 days ago          1.18GB
kolla/centos-source-gnocchi-statsd                      stein               5eae32613217        4 days ago          1.18GB
kolla/centos-source-gnocchi-api                         stein               016a579ca691        4 days ago          1.18GB
kolla/centos-source-keystone-ssh                        stein               5badb2868cad        4 days ago          1.09GB
kolla/centos-source-cloudkitty-api                      stein               d5f1db975f5d        4 days ago          1.04GB
kolla/centos-source-cinder-api                          stein               699ded043c7b        4 days ago          1.24GB
kolla/centos-source-panko-api                           stein               e2f778761f17        4 days ago          1.04GB
kolla/centos-source-manila-data                         stein               c37b3c37c7ed        4 days ago          1.07GB
kolla/centos-source-cloudkitty-processor                stein               1da2a137352d        4 days ago          975MB
kolla/centos-source-manila-api                          stein               8b4c98fb0175        4 days ago          1.1GB
kolla/centos-source-manila-share                        stein               39d27afd4d56        4 days ago          1.15GB
kolla/centos-source-freezer-api                         stein               f7b72bdc0ac0        4 days ago          1.11GB
kolla/centos-source-cinder-scheduler                    stein               6775ac628540        4 days ago          1.18GB
kolla/centos-source-sahara-api                          stein               5b47b81f424f        4 days ago          1.07GB
kolla/centos-source-sahara-engine                       stein               f5842be7d479        4 days ago          1.1GB
kolla/centos-source-designate-pool-manager              stein               24befdc0de36        4 days ago          1.03GB
kolla/centos-source-manila-scheduler                    stein               f50f3fb9dd46        4 days ago          1.04GB
kolla/centos-source-designate-worker                    stein               72db21787a4b        4 days ago          1.03GB
kolla/centos-source-designate-backend-bind9             stein               d731015448f2        4 days ago          1.03GB
kolla/centos-source-freezer-scheduler                   stein               e3dded68a8a6        4 days ago          1.05GB
kolla/centos-source-zun-compute                         stein               be59b2a510be        4 days ago          1.12GB
kolla/centos-source-zun-api                             stein               270dd8f6e22c        4 days ago          1.12GB
kolla/centos-source-murano-api                          stein               1f11ecc18edf        4 days ago          977MB
kolla/centos-source-murano-engine                       stein               80454a07fe8d        4 days ago          977MB
kolla/centos-source-monasca-persister                   stein               2ee4e11d2694        4 days ago          1.07GB
kolla/centos-source-kuryr-libnetwork                    stein               657f55ff806f        4 days ago          1.02GB
kolla/centos-source-designate-central                   stein               655dc6ce80d6        4 days ago          984MB
kolla/centos-source-octavia-api                         stein               38438c0d4c3d        4 days ago          1.06GB
kolla/centos-source-designate-api                       stein               5ec5c413dd32        4 days ago          984MB
kolla/centos-source-designate-sink                      stein               89264dd026cf        4 days ago          984MB
kolla/centos-source-designate-mdns                      stein               f51a2323d4d0        4 days ago          984MB
kolla/centos-source-octavia-worker                      stein               db214c6d0de7        4 days ago          999MB
kolla/centos-source-octavia-housekeeping                stein               f305ec44f2c4        4 days ago          999MB
kolla/centos-source-octavia-health-manager              stein               3b24efd564ca        4 days ago          999MB
kolla/centos-source-mistral-api                         stein               154ee67d2485        4 days ago          1.09GB
kolla/centos-source-neutron-lbaas-agent                 stein               27acebf080b6        4 days ago          1.19GB
kolla/centos-source-neutron-server                      stein               4101af1a5711        4 days ago          1.18GB
kolla/centos-source-mistral-engine                      stein               7add0de47242        4 days ago          1.03GB
kolla/centos-source-mistral-executor                    stein               dc08cf7174f0        4 days ago          1.03GB
kolla/centos-source-neutron-linuxbridge-agent           stein               971609946d50        4 days ago          1.18GB
kolla/centos-source-neutron-sriov-agent                 stein               e2c2de257fe7        4 days ago          1.15GB
kolla/centos-source-neutron-l3-agent                    stein               533270a215a5        4 days ago          1.19GB
kolla/centos-source-ironic-conductor                    stein               50ba534b8eb6        4 days ago          1.23GB
kolla/centos-source-ceilometer-compute                  stein               a7be14991da7        4 days ago          1.06GB
kolla/centos-source-neutron-metadata-agent              stein               3dbdcd7b3e53        4 days ago          1.15GB
kolla/centos-source-neutron-openvswitch-agent           stein               0c4befc229b8        4 days ago          1.15GB
kolla/centos-source-neutron-metering-agent              stein               3f8bc85f0bc5        4 days ago          1.15GB
kolla/centos-source-neutron-dhcp-agent                  stein               d683268857d9        4 days ago          1.15GB
kolla/centos-source-aodh-api                            stein               c9f699c66b66        4 days ago          1.04GB
kolla/centos-source-aodh-expirer                        stein               2fbe4667b1a3        4 days ago          1.04GB
kolla/centos-source-aodh-listener                       stein               5d2a616546a7        4 days ago          1.04GB
kolla/centos-source-aodh-notifier                       stein               dc4947c246e6        4 days ago          1.04GB
kolla/centos-source-aodh-evaluator                      stein               bfb69b18477a        4 days ago          1.04GB
kolla/centos-source-nova-api                            stein               cb5dca7e1e31        4 days ago          1.26GB
kolla/centos-source-nova-placement-api                  stein               261c4a895b71        4 days ago          1.26GB
kolla/centos-source-ceilometer-central                  stein               066cf0daf50f        4 days ago          1.01GB
kolla/centos-source-ceilometer-notification             stein               c238cf73d005        4 days ago          1.01GB
kolla/centos-source-karbor-operationengine              stein               7dc99a9b4ae6        4 days ago          1.05GB
kolla/centos-source-karbor-protection                   stein               50eea5407341        4 days ago          1.05GB
kolla/centos-source-karbor-api                          stein               c6c10df03c92        4 days ago          1.05GB
kolla/centos-source-nova-novncproxy                     stein               2cefe987d4a7        4 days ago          1.23GB
kolla/centos-source-nova-spicehtml5proxy                stein               9ce30713b8be        4 days ago          1.28GB
kolla/centos-source-nova-consoleauth                    stein               75f08fbca0b8        4 days ago          1.2GB
kolla/centos-source-nova-ssh                            stein               409f64a8db06        4 days ago          1.23GB
kolla/centos-source-nova-compute-ironic                 stein               29019cfcb256        4 days ago          1.23GB
kolla/centos-source-nova-conductor                      stein               05de9b08a1e1        4 days ago          1.2GB
kolla/centos-source-nova-scheduler                      stein               3091c85ebba3        4 days ago          1.2GB
kolla/centos-source-nova-serialproxy                    stein               1ed9ee4c627e        4 days ago          1.2GB
kolla/centos-source-monasca-api                         stein               71b28f630d4c        4 days ago          1.11GB
kolla/centos-source-monasca-log-api                     stein               12f8bd1f1d77        4 days ago          1.04GB
kolla/centos-source-placement-api                       stein               930cba984958        4 days ago          1.1GB
kolla/centos-source-barbican-worker                     stein               42722e6d315a        4 days ago          1.01GB
kolla/centos-source-barbican-keystone-listener          stein               e3afa36525d0        4 days ago          1.01GB
kolla/centos-source-barbican-api                        stein               3161529a3cd0        4 days ago          1.01GB
kolla/centos-source-monasca-agent                       stein               5de54ca2afcf        4 days ago          1.06GB
kolla/centos-source-ironic-pxe                          stein               20b3f5cb859e        4 days ago          1.06GB
kolla/centos-source-monasca-notification                stein               4fae8ac7d7b2        4 days ago          1.04GB
kolla/centos-source-ironic-api                          stein               b528b14c0c02        4 days ago          1.06GB
kolla/centos-source-senlin-api                          stein               b6810388adc6        4 days ago          979MB
kolla/centos-source-senlin-engine                       stein               5104444b0832        4 days ago          979MB
kolla/centos-source-vitrage-api                         stein               8f64a53a0c59        4 days ago          1.13GB
kolla/centos-source-vitrage-graph                       stein               4f93d0a61d28        4 days ago          1.13GB
kolla/centos-source-vitrage-notifier                    stein               647ac376ea80        4 days ago          1.13GB
kolla/centos-source-congress-api                        stein               2526f0527e37        4 days ago          1GB
kolla/centos-source-congress-policy-engine              stein               d55040ceb0da        4 days ago          1GB
kolla/centos-source-congress-datasource                 stein               fbd7b3cc9f38        4 days ago          1GB
kolla/centos-source-heat-api                            stein               2b6ea049da03        4 days ago          1.07GB
kolla/centos-source-magnum-api                          stein               38ddb718b4aa        4 days ago          1.01GB
kolla/centos-source-heat-engine                         stein               3aab421ff967        4 days ago          1.07GB
kolla/centos-source-heat-api-cfn                        stein               dee7017eeb97        4 days ago          1.07GB
kolla/centos-source-solum-api                           stein               5e21605a8101        4 days ago          974MB
kolla/centos-source-magnum-conductor                    stein               ed876e745ef6        4 days ago          1.01GB
kolla/centos-source-solum-deployer                      stein               2acd4249caa5        4 days ago          974MB
kolla/centos-source-solum-conductor                     stein               e407438cbcf3        4 days ago          974MB
kolla/centos-source-solum-worker                        stein               9cdf1449bd8d        4 days ago          974MB
kolla/centos-source-glance-base                         stein               5d1f5830ac71        4 days ago          1.04GB
kolla/centos-source-searchlight-api                     stein               0912670868ce        4 days ago          971MB
kolla/centos-source-watcher-applier                     stein               cc3338d211a9        4 days ago          985MB
kolla/centos-source-searchlight-listener                stein               528e10920581        4 days ago          971MB
kolla/centos-source-watcher-engine                      stein               d6e035019fc1        4 days ago          985MB
kolla/centos-source-watcher-api                         stein               5c0e64d78988        4 days ago          985MB
kolla/centos-source-trove-conductor                     stein               649779e65de9        4 days ago          985MB
kolla/centos-source-trove-api                           stein               605e96b1d374        4 days ago          985MB
kolla/centos-source-trove-guestagent                    stein               68b02bf12026        4 days ago          985MB
kolla/centos-source-trove-taskmanager                   stein               b0a046756d9e        4 days ago          985MB
kolla/centos-source-swift-base                          stein               f1098193a716        4 days ago          1.01GB
kolla/centos-source-gnocchi-base                        stein               9d7025e39dc2        4 days ago          1.18GB
kolla/centos-source-keystone-base                       stein               3702bb1b0856        4 days ago          1.06GB
kolla/centos-source-panko-base                          stein               f0c345715a0f        4 days ago          1.04GB
kolla/centos-source-cinder-base                         stein               669aa0b0d47e        4 days ago          1.18GB
kolla/centos-source-cloudkitty-base                     stein               7d94fd2c48d1        4 days ago          975MB
kolla/centos-source-vmtp                                stein               115699837664        4 days ago          973MB
kolla/centos-source-sahara-base                         stein               ad2b434464ba        4 days ago          1.07GB
kolla/centos-source-collectd                            stein               0ee098d33082        4 days ago          1.13GB
kolla/centos-source-manila-base                         stein               5e96bbef5600        4 days ago          1.04GB
kolla/centos-source-freezer-base                        stein               25f750d5b4af        4 days ago          1.05GB
kolla/centos-source-zun-base                            stein               b45a6590f391        4 days ago          1.12GB
kolla/centos-source-murano-base                         stein               3208cbcab6ea        4 days ago          977MB
kolla/centos-source-designate-base                      stein               155ea0df41ea        4 days ago          984MB
kolla/centos-source-kuryr-base                          stein               631166c7bd85        4 days ago          974MB
kolla/centos-source-octavia-base                        stein               6d421682f352        4 days ago          999MB
kolla/centos-source-mistral-base                        stein               d44092d85f05        4 days ago          1.03GB
kolla/centos-source-neutron-base                        stein               5c77b3a9a2ac        4 days ago          1.15GB
kolla/centos-source-aodh-base                           stein               2fc8ed384d61        4 days ago          1.04GB
kolla/centos-source-ceilometer-base                     stein               4207fcd31a50        4 days ago          1.01GB
kolla/centos-source-karbor-base                         stein               a563d284a815        4 days ago          1.05GB
kolla/centos-source-ironic-inspector                    stein               0c22980bd8ee        4 days ago          970MB
kolla/centos-source-rally                               stein               c292c27058a4        4 days ago          985MB
kolla/centos-source-nova-base                           stein               8201acc68c3a        4 days ago          1.2GB
kolla/centos-source-barbican-base                       stein               b09110a90baf        4 days ago          1.01GB
kolla/centos-source-monasca-grafana                     stein               fa09535ef81c        4 days ago          1.84GB
kolla/centos-source-tempest                             stein               373b5ae9cb80        4 days ago          1.07GB
kolla/centos-source-monasca-base                        stein               231c4d31b33c        4 days ago          1.03GB
kolla/centos-source-monasca-thresh                      stein               a37f939b2a3c        4 days ago          1.09GB
kolla/centos-source-senlin-base                         stein               7a6c8dec970f        4 days ago          979MB
kolla/centos-source-vitrage-base                        stein               7d262f805161        4 days ago          1.13GB
kolla/centos-source-congress-base                       stein               e90d8b1e3506        4 days ago          1GB
kolla/centos-source-heat-base                           stein               4f2c2b911cda        4 days ago          1.07GB
kolla/centos-source-magnum-base                         stein               5d2c1a77ddc1        4 days ago          1.01GB
kolla/centos-source-dind                                stein               ecc915bae808        4 days ago          963MB
kolla/centos-source-solum-base                          stein               4213bb1c4ddd        4 days ago          974MB
kolla/centos-source-searchlight-base                    stein               4fd4e17c2c3c        4 days ago          971MB
kolla/centos-source-watcher-base                        stein               32db6f525f50        4 days ago          985MB
kolla/centos-source-trove-base                          stein               2a455aa3bdc4        4 days ago          985MB
kolla/centos-source-ironic-base                         stein               6cfe553ced23        4 days ago          995MB
kolla/centos-source-skydive-agent                       stein               3c5793027a2f        4 days ago          584MB
kolla/centos-source-skydive-analyzer                    stein               43ebe0328510        4 days ago          567MB
kolla/centos-source-openvswitch-vswitchd                stein               62432f7641ab        4 days ago          441MB
kolla/centos-source-openvswitch-db-server               stein               5615e6fdc519        4 days ago          441MB
kolla/centos-source-fluentd                             stein               0cd08e4e4b7d        4 days ago          689MB
kolla/centos-source-ceph-rgw                            stein               48d68612688c        4 days ago          729MB
kolla/centos-source-ceph-mon                            stein               e2c8ad3d7482        4 days ago          729MB
kolla/centos-source-ceph-mgr                            stein               ac68483b5311        4 days ago          729MB
kolla/centos-source-ceph-mds                            stein               3128e164ce49        4 days ago          729MB
kolla/centos-source-cephfs-fuse                         stein               380b4bb0ec48        4 days ago          729MB
kolla/centos-source-redis                               stein               0befc61cac8c        4 days ago          422MB
kolla/centos-source-prometheus-server                   stein               91b37b7caa0a        4 days ago          470MB
kolla/centos-source-prometheus-alertmanager             stein               27b612cc3f1f        4 days ago          437MB
kolla/centos-source-prometheus-node-exporter            stein               e07f31a4a5c8        4 days ago          412MB
kolla/centos-source-prometheus-cadvisor                 stein               3646cb891e4f        4 days ago          430MB
kolla/centos-source-prometheus-haproxy-exporter         stein               de0423a133ca        4 days ago          409MB
kolla/centos-source-prometheus-elasticsearch-exporter   stein               50597c816ef4        4 days ago          403MB
kolla/centos-source-prometheus-memcached-exporter       stein               68675911e571        4 days ago          409MB
kolla/centos-source-prometheus-openstack-exporter       stein               ea45f357309b        4 days ago          410MB
kolla/centos-source-prometheus-mysqld-exporter          stein               592a1592459b        4 days ago          411MB
kolla/centos-source-nova-libvirt                        stein               aee055499e98        4 days ago          893MB
kolla/centos-source-grafana                             stein               1549af64aa39        4 days ago          597MB
kolla/centos-source-openstack-base                      stein               485c805e632d        4 days ago          963MB
kolla/centos-source-openvswitch-base                    stein               51c49db09177        4 days ago          441MB
kolla/centos-source-kolla-toolbox                       stein               f64dd5651e7f        4 days ago          861MB
kolla/centos-source-telegraf                            stein               e56fe80ae731        4 days ago          496MB
kolla/centos-source-keepalived                          stein               bed82f207c93        4 days ago          425MB
kolla/centos-source-kibana                              stein               f4acbd94e0a7        4 days ago          631MB
kolla/centos-source-chrony                              stein               c657b0518a69        4 days ago          421MB
kolla/centos-source-cron                                stein               513183323d97        4 days ago          420MB
kolla/centos-source-zookeeper                           stein               0130f5e69736        4 days ago          617MB
kolla/centos-source-kubetoolbox                         stein               8428a4af598e        4 days ago          556MB
kolla/centos-source-logstash                            stein               a211f3d4873e        4 days ago          846MB
kolla/centos-source-multipathd                          stein               5075bcc6b3fe        4 days ago          421MB
kolla/centos-source-haproxy                             stein               053a1aa3a54e        4 days ago          444MB
kolla/centos-source-ceph-base                           stein               1a8e498905c3        4 days ago          729MB
kolla/centos-source-iscsid                              stein               41833ee8625d        4 days ago          425MB
kolla/centos-source-kubernetes-entrypoint               stein               9017117b3f21        4 days ago          439MB
kolla/centos-source-dnsmasq                             stein               1ece58678334        4 days ago          420MB
kolla/centos-source-influxdb                            stein               096785aa84ce        4 days ago          545MB
kolla/centos-source-tgtd                                stein               c86869bc4e53        4 days ago          420MB
kolla/centos-source-helm-repository                     stein               ea28565009e4        4 days ago          528MB
kolla/centos-source-etcd                                stein               de99fdfc1fd8        4 days ago          467MB
kolla/centos-source-rabbitmq                            stein               30a8c2c256e5        4 days ago          500MB
kolla/centos-source-storm                               stein               31ab0318c517        4 days ago          747MB
kolla/centos-source-kube-base                           stein               8e1da6120169        4 days ago          397MB
kolla/centos-source-mariadb                             stein               5dc28f803868        4 days ago          608MB
kolla/centos-source-mongodb                             stein               87453cdef417        4 days ago          592MB
kolla/centos-source-elasticsearch                       stein               3fd94c5fe987        4 days ago          594MB
kolla/centos-source-kafka                               stein               ab9a3a54a36d        4 days ago          604MB
kolla/centos-source-memcached                           stein               e71cc4756188        4 days ago          421MB
kolla/centos-source-base                                stein               8924da1d1bd1        4 days ago          397MB
[root@kolla ~]#下载所有的镜像
[root@kolla ~]# cat ImageDownLoad.sh
#!/usr/bin/env sh
for Name in `cat image.txt |awk '{print $1}'`
do
    docker pull $Name:stein
done
-------------------------------------------------------------------------------------------
打标签制作内网源[root@kolla ~]# cat ImageDownLoad.sh
#!/usr/bin/env sh
for Name in `cat images.txt |awk '{print $1}'`
do
    docker tag $Name:stein 192.168.229.141:4000/$Name:stein
done

[root@kolla ~]# cat ImageDeal.sh
#!/usr/bin/env sh
#for Name in `cat images.txt |awk '{print $1}'`
#do
#    docker tag $Name:stein 192.168.229.141:4000/$Name:stein
#done

#for Name in `cat images.txt |awk '{print $1}'`
#do
#    docker push 192.168.229.141:4000/$Name:stein
#done

#for Name in `cat images.txt |awk '{print $1}'`
#do
#    docker rmi 192.168.229.141:4000/$Name:stein
#done
[root@kolla ~]#
-------------------------------------------------------------------------------------------
[root@kolla ~]# yum install ansible -y
[root@kolla ~]# git clone https://github.com/openstack/kolla-ansible.git -b stable/stein
[root@kolla ~]# cd kolla-ansible/
[root@kolla kolla-ansible]# pip install .
[root@kolla kolla-ansible]# pip install -r requirements.txt
[root@kolla kolla-ansible]# pip install -r test-requirements.txt
[root@kolla ~]# pip install ipaddress
[root@kolla ~]# pip install python-openstackclient python-glanceclient python-neutronclient

[root@kolla kolla-ansible]# cp -r etc/kolla /etc/kolla/
[root@kolla kolla-ansible]# 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

配置Ceph
由于是单节点,all in one的部署,ceph数据只存放1份
创建 /etc/kolla/config/ceph.conf
[global]
osd pool default size = 1
osd pool default min size = 1
Ceph修改配置文件/etc/kolla/globals.yml
enable_cinder: "yes"
enable_ceph: "yes"
enable_ceph_rgw: "yes"
enable_ceph_rgw_keystone: "yes"
glance_backend_ceph: "yes"
[root@kolla ~]# kolla-genpwd
[root@kolla ~]# vi /etc/kolla/passwords.yml
keystone_admin_password: hadoop

[root@kolla ~]# vi /usr/share/kolla-ansible/ansible/group_vars/all.yml
ceph_osd_store_type: "filestore"

[root@kolla ~]# parted /dev/sdb -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP 1 -1
[root@kolla ~]# kolla-ansible -i /opt/multinode prechecks


# kolla-ansible -i /root/all-in-one bootstrap-servers

# kolla-ansible -i /root/all-in-one prechecks

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

这样就创建 /etc/kolla/admin-openrc.sh 文件

安装OpenStack client端

pip install python-openstackclient
编辑 /usr/share/kolla-ansible/init-runonce,

网络需要根据实际情况修改

EXT_NET_CIDR='192.168.12.0/24'
EXT_NET_RANGE='start=192.168.12.30,end=192.168.12.40'
EXT_NET_GATEWAY='192.168.12.1'
这里解析一下,192.168.12.0的网络,就是我上面ens34接的网络,这个网络是通过路由器访问互联网。这个地方需要好好理解。配置好这个,装完虚拟机就可以直接ping通。



运行

source /etc/kolla/admin-openrc.sh
cd /usr/share/kolla-ansible
./init-runonce

yum install qemu-img

转成raw格式

qemu-img convert -f qcow2 -O raw \
cirros-0.3.4-x86_64-disk.img cirros-0.3.4-x86_64-disk.raw
openstack image create --disk-format raw --container-format bare \
--public true --file ./cirros-0.3.4-x86_64-disk.raw
镜像打标签 ,否则magnum中镜像显示不出来
[root@kolla hadoop]# openstack image create  --disk-format raw  --container-format bare --public coreos_production_openstack_image  --file ./coreos_production_openstack_image.raw
[root@kolla hadoop]# openstack image list 
[root@kolla hadoop]# openstack image set 891af456-b16e-4ed4-b974-7a4b1f9bb8df --property os_distro=coreos 

[root@kolla hadoop]# docker  exec -i -t -uroot magnum_api /bin/bash
(magnum-api)[root@kolla ~]# cat admin-openrc.sh
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=hadoop
export OS_AUTH_URL=http://192.168.229.160:35357/v3
export OS_INTERFACE=internal
export OS_IDENTITY_API_VERSION=3
export OS_REGION_NAME=RegionOne
export OS_AUTH_PLUGIN=password
(magnum-api)[root@kolla ~]# cat example.sh
#!/usr/bin/env sh

openstack coe cluster template create k8s-cluster-template \
                           --image coreos_production_openstack_image \
                           --keypair mykey \
                           --external-network public1 \
                           --dns-nameserver 8.8.8.8 \
                           --flavor m1.small \
                           --docker-volume-size 5 \
                           --network-driver flannel \
                           --coe kubernetes
(magnum-api)[root@kolla ~]# cat k8s-cluster.sh
#!/usr/bin/env sh
openstack coe cluster create k8s-cluster \
                      --cluster-template k8s-cluster-template \
                      --master-count 1 \
                      --node-count 2
(magnum-api)[root@kolla ~]#


ceph验证
docker exec -it ceph_mon ceph osd pool ls
docker exec -it ceph_mon ceph osd pool set vms size 1
docker exec -it ceph_mon ceph osd pool set images size 1
docker exec -it ceph_mon ceph osd pool set volumes size 1
docker exec -it ceph_mon ceph osd pool set backups size 1
docker exec -it ceph_mon ceph osd pool set rbd size 1
docker exec -it ceph_mon ceph osd pool set rbd min_size 1
docker exec -it ceph_mon ceph osd pool set backups min_size 1
docker exec -it ceph_mon ceph osd pool set volumes min_size 1
docker exec -it ceph_mon ceph osd pool set images min_size 1
docker exec -it ceph_mon ceph osd pool set vms min_size 1
docker exec -it ceph_mon ceph osd pool ls
docker exec -it ceph_mon ceph -s
配置文件-仅安装ceph 大数据及magnum项目
[root@kolla ~]# cat /etc/kolla/globals.yml
---
kolla_base_distro: "centos"
kolla_install_type: "source"
openstack_release: "stein"
kolla_internal_vip_address: "192.168.229.160"
docker_registry: ""
docker_namespace: "kolla"
network_interface: "ens33"
api_interface: "{{ network_interface }}"
storage_interface: "{{ network_interface }}"
tunnel_interface: "{{ network_interface }}"
octavia_network_interface: "{{ api_interface }}"

neutron_external_interface: "ens34"
keepalived_virtual_router_id: "51"
enable_glance: "{{ enable_openstack_core | bool }}"
enable_haproxy: "yes"
enable_keepalived: "{{ enable_haproxy | bool }}"
enable_mariadb: "yes"
enable_outward_rabbitmq: "{{ enable_murano | bool }}"
enable_ceph: "yes"
enable_ceph_mds: "yes"
enable_ceph_rgw: "yes"
enable_ceph_dashboard: "{{ enable_ceph | bool }}"
enable_cinder: "yes"
enable_congress: "yes"
enable_destroy_images: "yes"
enable_heat: "{{ enable_openstack_core | bool }}"
enable_horizon: "{{ enable_openstack_core | bool }}"
enable_horizon_congress: "{{ enable_congress | bool }}"
enable_horizon_magnum: "{{ enable_magnum | bool }}"
enable_horizon_murano: "{{ enable_murano | bool }}"
enable_horizon_sahara: "{{ enable_sahara | bool }}"
enable_kuryr: "yes"
enable_magnum: "yes"
enable_murano: "yes"
enable_openstack_core: "yes"
enable_sahara: "yes"
enable_ceph_rgw_keystone: "yes"
ceph_pool_pg_num: 4
ceph_pool_pgp_num: 4
glance_backend_ceph: "yes"
glance_backend_file: "no"
glance_enable_rolling_upgrade: "no"
cinder_backend_ceph: "{{ enable_ceph }}"
cinder_backup_driver: "ceph"
nova_backend_ceph: "{{ enable_ceph }}"
horizon_backend_database: "{{ enable_murano | bool }}"
[root@kolla ~]#





测试配置文件

[root@kolla ~]# cat /etc/kolla/globals.yml
---
# You can use this file to override _any_ variable throughout Kolla.
# Additional options can be found in the
# 'kolla-ansible/ansible/group_vars/all.yml' file. Default value of all the
# commented parameters are shown here, To override the default value uncomment
# the parameter and change its value.

###############
# Kolla options
###############
# Valid options are [ COPY_ONCE, COPY_ALWAYS ]
#config_strategy: "COPY_ALWAYS"

# Valid options are ['centos', 'debian', 'oraclelinux', 'rhel', 'ubuntu']
#kolla_base_distro: "centos"

# Valid options are [ binary, source ]
kolla_install_type: "source"

# Valid option is Docker repository tag
openstack_release: "stein"

# Location of configuration overrides
#node_custom_config: "/etc/kolla/config"

# This should be a VIP, an unused IP on your network that will float between
# the hosts running keepalived for high-availability. If you want to run an
# All-In-One without haproxy and keepalived, you can set enable_haproxy to no
# in "OpenStack options" section, and set this value to the IP of your
# 'network_interface' as set in the Networking section below.
kolla_internal_vip_address: "192.168.229.160"

# This is the DNS name that maps to the kolla_internal_vip_address VIP. By
# default it is the same as kolla_internal_vip_address.
#kolla_internal_fqdn: "{{ kolla_internal_vip_address }}"

# This should be a VIP, an unused IP on your network that will float between
# the hosts running keepalived for high-availability. It defaults to the
# kolla_internal_vip_address, allowing internal and external communication to
# share the same address.  Specify a kolla_external_vip_address to separate
# internal and external requests between two VIPs.
#kolla_external_vip_address: "{{ kolla_internal_vip_address }}"

# The Public address used to communicate with OpenStack as set in the public_url
# for the endpoints that will be created. This DNS name should map to
# kolla_external_vip_address.
#kolla_external_fqdn: "{{ kolla_external_vip_address }}"

################
# Docker options
################
# Below is an example of a private repository with authentication. Note the
# Docker registry password can also be set in the passwords.yml file.

docker_registry: ""
docker_namespace: "kolla"
#docker_registry_username: "sam"
#docker_registry_password: "correcthorsebatterystaple"

###################
# Messaging options
###################
# Below is an example of an separate backend that provides brokerless
# messaging for oslo.messaging RPC communications

#om_rpc_transport: "amqp"
#om_rpc_user: "{{ qdrouterd_user }}"
#om_rpc_password: "{{ qdrouterd_password }}"
#om_rpc_port: "{{ qdrouterd_port }}"
#om_rpc_group: "qdrouterd"


##############################
# Neutron - Networking Options
##############################
# This interface is what all your api services will be bound to by default.
# Additionally, all vxlan/tunnel and storage network traffic will go over this
# interface by default. This interface must contain an IPv4 address.
# It is possible for hosts to have non-matching names of interfaces - these can
# be set in an inventory file per host or per group or stored separately, see
#     http://docs.ansible.com/ansible/intro_inventory.html
# Yet another way to workaround the naming problem is to create a bond for the
# interface on all hosts and give the bond name here. Similar strategy can be
# followed for other types of interfaces.
network_interface: "ens33"

# These can be adjusted for even more customization. The default is the same as
# the 'network_interface'. These interfaces must contain an IPv4 address.
#kolla_external_vip_interface: "{{ network_interface }}"
api_interface: "{{ network_interface }}"
storage_interface: "{{ network_interface }}"
cluster_interface: "{{ network_interface }}"
#swift_storage_interface: "{{ storage_interface }}"
#swift_replication_interface: "{{ swift_storage_interface }}"
tunnel_interface: "{{ network_interface }}"
dns_interface: "{{ network_interface }}"
octavia_network_interface: "{{ api_interface }}"

# This is the raw interface given to neutron as its external network port. Even
# though an IP address can exist on this interface, it will be unusable in most
# configurations. It is recommended this interface not be configured with any IP
# addresses for that reason.
neutron_external_interface: "ens34"

# Valid options are [ openvswitch, linuxbridge, vmware_nsxv, vmware_nsxv3, vmware_dvs, opendaylight ]
# if vmware_nsxv3 is selected, enable_openvswitch MUST be set to "no" (default is yes)
#neutron_plugin_agent: "openvswitch"

# Valid options are [ internal, infoblox ]
#neutron_ipam_driver: "internal"

# Configure Neutron upgrade option, currently Kolla support
# two upgrade ways for Neutron: legacy_upgrade and rolling_upgrade
# The variable "neutron_enable_rolling_upgrade: yes" is meaning rolling_upgrade
# were enabled and opposite
# Neutron rolling upgrade were enable by default
#neutron_enable_rolling_upgrade: "yes"


####################
# keepalived options
####################
# Arbitrary unique number from 0..255
keepalived_virtual_router_id: "53"

###################
# Dimension options
###################
# This is to provide an extra option to deploy containers with Resource constraints.
# We call it dimensions here.
# The dimensions for each container are defined by a mapping, where each dimension value should be a
# string.
# Reference_Docs
# https://docs.docker.com/config/containers/resource_constraints/
# eg:
# <container_name>_dimensions:
#    blkio_weight:
#    cpu_period:
#    cpu_quota:
#    cpu_shares:
#    cpuset_cpus:
#    cpuset_mems:
#    mem_limit:
#    mem_reservation:
#    memswap_limit:
#    kernel_memory:
#    ulimits:


#############
# TLS options
#############
# To provide encryption and authentication on the kolla_external_vip_interface,
# TLS can be enabled.  When TLS is enabled, certificates must be provided to
# allow clients to perform authentication.
#kolla_enable_tls_external: "no"
#kolla_external_fqdn_cert: "{{ node_config }}/certificates/haproxy.pem"


##############
# OpenDaylight
##############
#enable_opendaylight_qos: "no"
#enable_opendaylight_l3: "yes"

###################
# OpenStack options
###################
# Use these options to set the various log levels across all OpenStack projects
# Valid options are [ True, False ]
openstack_logging_debug: "True"

# Valid options are [ none, novnc, spice, rdp ]
nova_console: "novnc"

# These roles are required for Kolla to be operation, however a savvy deployer
# could disable some of these required roles and run their own services.
enable_glance: "{{ enable_openstack_core | bool }}"
enable_haproxy: "yes"
enable_keepalived: "{{ enable_haproxy | bool }}"
#enable_keystone: "{{ enable_openstack_core | bool }}"
enable_mariadb: "yes"
enable_memcached: "yes"
#enable_neutron: "{{ enable_openstack_core | bool }}"
#enable_nova: "{{ enable_openstack_core | bool }}"
#enable_rabbitmq: "{{ 'yes' if om_rpc_transport == 'rabbit' or om_notify_transport == 'rabbit' else 'no' }}"
enable_outward_rabbitmq: "{{ enable_murano | bool }}"

# OpenStack services can be enabled or disabled with these options
#enable_aodh: "no"
#enable_barbican: "no"
#enable_blazar: "no"
#enable_ceilometer: "yes"
#enable_ceilometer_ipmi: "yes"
enable_central_logging: "yes"
enable_ceph: "yes"
enable_ceph_mds: "yes"
enable_ceph_rgw: "yes"
#enable_ceph_nfs: "no"
enable_ceph_dashboard: "{{ enable_ceph | bool }}"
#enable_chrony: "yes"
enable_cinder: "yes"
#enable_cinder_backup: "yes"
#enable_cinder_backend_hnas_iscsi: "no"
#enable_cinder_backend_hnas_nfs: "no"
#enable_cinder_backend_iscsi: "no"
#enable_cinder_backend_lvm: "no"
#enable_cinder_backend_nfs: "no"
#enable_cinder_backend_quobyte: "no"
#enable_cloudkitty: "no"
#enable_collectd: "no"
enable_congress: "yes"
#enable_cyborg: "no"
#enable_designate: "no"
enable_destroy_images: "yes"
enable_elasticsearch: "{{ 'yes' if enable_central_logging | bool or enable_freezer | bool or enable_osprofiler | bool or enable_skydive | bool or enable_monasca | bool else 'no' }}"
#enable_etcd: "no"
#enable_fluentd: "yes"
enable_freezer: "yes"
#enable_gnocchi: "no"
enable_grafana: "yes"
enable_heat: "{{ enable_openstack_core | bool }}"
enable_horizon: "{{ enable_openstack_core | bool }}"
#enable_horizon_blazar: "{{ enable_blazar | bool }}"
#enable_horizon_cloudkitty: "{{ enable_cloudkitty | bool }}"
enable_horizon_congress: "{{ enable_congress | bool }}"
#enable_horizon_designate: "{{ enable_designate | bool }}"
#enable_horizon_freezer: "{{ enable_freezer | bool }}"
enable_horizon_fwaas: "{{ enable_neutron_fwaas | bool }}"
#enable_horizon_ironic: "{{ enable_ironic | bool }}"
#enable_horizon_karbor: "{{ enable_karbor | bool }}"
enable_horizon_magnum: "{{ enable_magnum | bool }}"
#enable_horizon_manila: "{{ enable_manila | bool }}"
#enable_horizon_mistral: "{{ enable_mistral | bool }}"
enable_horizon_murano: "{{ enable_murano | bool }}"
enable_horizon_neutron_lbaas: "{{ enable_neutron_lbaas | bool }}"
enable_horizon_neutron_vpnaas: "{{ enable_neutron_vpnaas | bool }}"
#enable_horizon_octavia: "{{ enable_octavia | bool }}"
enable_horizon_sahara: "{{ enable_sahara | bool }}"
#enable_horizon_searchlight: "{{ enable_searchlight | bool }}"
#enable_horizon_senlin: "{{ enable_senlin | bool }}"
#enable_horizon_solum: "{{ enable_solum | bool }}"
#enable_horizon_tacker: "{{ enable_tacker | bool }}"
#enable_horizon_trove: "{{ enable_trove | bool }}"
#enable_horizon_watcher: "{{ enable_watcher | bool }}"
#enable_horizon_zun: "{{ enable_zun | bool }}"
#enable_hyperv: "no"
#enable_influxdb: "no"
#enable_ironic: "no"
#enable_ironic_ipxe: "no"
#enable_ironic_neutron_agent: "no"
#enable_ironic_pxe_uefi: "no"
enable_kafka: "yes"
#enable_karbor: "no"
enable_kuryr: "yes"
enable_magnum: "yes"
#enable_manila: "no"
#enable_manila_backend_generic: "no"
#enable_manila_backend_hnas: "no"
#enable_manila_backend_cephfs_native: "no"
#enable_manila_backend_cephfs_nfs: "no"
#enable_mistral: "no"
enable_monasca: "yes"
#enable_mongodb: "no"
enable_murano: "yes"
#enable_multipathd: "no"
enable_neutron_bgp_dragent: "no"
#enable_neutron_dvr: "no"
enable_neutron_lbaas: "yes"
enable_neutron_fwaas: "yes"
enable_neutron_qos: "yes"
#enable_neutron_agent_ha: "no"
enable_neutron_vpnaas: "yes"
enable_neutron_sriov: "yes"
enable_neutron_sfc: "yes"
enable_neutron_metering: "yes"
#enable_nova_fake: "no"
#enable_nova_serialconsole_proxy: "no"
enable_nova_ssh: "yes"
#enable_octavia: "no"
#enable_onos: "no"
#enable_opendaylight: "no"
enable_openstack_core: "yes"
#enable_openvswitch: "{{ enable_neutron | bool and neutron_plugin_agent != 'linuxbridge' }}"
#enable_ovs_dpdk: "no"
enable_osprofiler: "yes"
#enable_panko: "no"
#enable_placement: "{{ enable_nova }}"
enable_prometheus: "yes"
#enable_qdrouterd: "no"
#enable_rally: "no"
#enable_redis: "no"
enable_sahara: "yes"
#enable_searchlight: "no"
#enable_senlin: "no"
enable_skydive: "yes"
#enable_solum: "no"
#enable_swift: "no"
enable_storm: "yes"
#enable_telegraf: "no"
#enable_tacker: "no"
enable_tempest: "yes"
#enable_trove: "no"
#enable_trove_singletenant: "no"
#enable_vitrage: "no"
#enable_vmtp: "no"
#enable_watcher: "no"
#enable_xtrabackup: "no"
#enable_zookeeper: "no"
#enable_zun: "no"

##############
# Ceph options
##############
# Ceph can be setup with a caching to improve performance. To use the cache you
# must provide separate disks than those for the OSDs
#ceph_enable_cache: "no"

# Set to no if using external Ceph without cephx.
#external_ceph_cephx_enabled: "yes"

# Ceph is not able to determine the size of a cache pool automatically,
# so the configuration on the absolute size is required here, otherwise the flush/evict will not work.
#ceph_target_max_bytes: ""
#ceph_target_max_objects: ""

# Valid options are [ forward, none, writeback ]
#ceph_cache_mode: "writeback"

# A requirement for using the erasure-coded pools is you must setup a cache tier
# Valid options are [ erasure, replicated ]
#ceph_pool_type: "replicated"

# Integrate ceph rados object gateway with openstack keystone
enable_ceph_rgw_keystone: "yes"

# Set the pgs and pgps for pool
# WARNING! These values are dependant on the size and shape of your cluster -
# the default values are not suitable for production use. Please refer to the
# Kolla Ceph documentation for more information.
ceph_pool_pg_num: 4
ceph_pool_pgp_num: 4

#############################
# Keystone - Identity Options
#############################

# Valid options are [ fernet ]
#keystone_token_provider: 'fernet'

#keystone_admin_user: "admin"

#keystone_admin_project: "admin"

# Interval to rotate fernet keys by (in seconds). Must be an interval of
# 60(1 min), 120(2 min), 180(3 min), 240(4 min), 300(5 min), 360(6 min),
# 600(10 min), 720(12 min), 900(15 min), 1200(20 min), 1800(30 min),
# 3600(1 hour), 7200(2 hour), 10800(3 hour), 14400(4 hour), 21600(6 hour),
# 28800(8 hour), 43200(12 hour), 86400(1 day), 604800(1 week).
#fernet_token_expiry: 86400


########################
# Glance - Image Options
########################
# Configure image backend.
glance_backend_ceph: "yes"
glance_backend_file: "no"
#glance_backend_swift: "no"
#glance_backend_vmware: "no"
#enable_glance_image_cache: "no"
# Configure glance upgrade option, due to this feature is experimental
# in glance, so default value should be set to "no".
glance_enable_rolling_upgrade: "no"

####################
# Osprofiler options
####################
# valid values: ["elasticsearch", "redis"]
#osprofiler_backend: "elasticsearch"

##################
# Barbican options
##################
# Valid options are [ simple_crypto, p11_crypto ]
#barbican_crypto_plugin: "simple_crypto"
#barbican_library_path: "/usr/lib/libCryptoki2_64.so"

################
## Panko options
################
# Valid options are [ mongodb, mysql ]
#panko_database_type: "mysql"

#################
# Gnocchi options
#################
# Valid options are [ file, ceph ]
#gnocchi_backend_storage: "{{ 'ceph' if enable_ceph|bool else 'file' }}"

# Valid options are [redis, '']
#gnocchi_incoming_storage: "{{ 'redis' if enable_redis | bool else '' }}"

################################
# Cinder - Block Storage Options
################################
# Enable / disable Cinder backends
cinder_backend_ceph: "{{ enable_ceph }}"
#cinder_backend_vmwarevc_vmdk: "no"
#cinder_volume_group: "cinder-volumes"

# Valid options are [ nfs, swift, ceph ]
cinder_backup_driver: "ceph"
#cinder_backup_share: ""
#cinder_backup_mount_options_nfs: ""


###################
# Designate options
###################
# Valid options are [ bind9 ]
#designate_backend: "bind9"
#designate_ns_record: "sample.openstack.org"

########################
# Nova - Compute Options
########################
nova_backend_ceph: "{{ enable_ceph }}"

# Valid options are [ qemu, kvm, vmware, xenapi ]
#nova_compute_virt_type: "kvm"

# The number of fake driver per compute node
#num_nova_fake_per_node: 5

# Configure nova upgrade option, due to currently kolla support
# two upgrade ways for nova: legacy_upgrade and rolling_upgrade
# The variable "nova_enable_rolling_upgrade: yes" is meaning
# rolling_upgrade were enabled and opposite
#nova_enable_rolling_upgrade: "yes"

# The flag "nova_safety_upgrade" need to be consider when
# "nova_enable_rolling_upgrade" is enabled. The "nova_safety_upgrade"
# controls whether the nova services are all stopped before rolling
# upgrade to the new version, for the safety and availability.
# If "nova_safety_upgrade" is "yes", that will stop all nova services (except
# nova-compute) for no failed API operations before upgrade to the
# new version. And opposite.
#nova_safety_upgrade: "no"

#################
# Hyper-V options
#################
# Hyper-V can be used as hypervisor
#hyperv_username: "user"
#hyperv_password: "password"
#vswitch_name: "vswitch"
# URL from which Nova Hyper-V MSI is downloaded
#nova_msi_url: "https://www.cloudbase.it/downloads/HyperVNovaCompute_Beta.msi"

#############################
# Horizon - Dashboard Options
#############################
horizon_backend_database: "{{ enable_murano | bool }}"

#############################
# Ironic options
#############################
# dnsmasq bind interface for Ironic Inspector, by default is network_interface
#ironic_dnsmasq_interface: "{{ network_interface }}"
# following value must be set when enable ironic, the value format
# is "192.168.0.10,192.168.0.100".
ironic_dnsmasq_dhcp_range:
# PXE bootloader file for Ironic Inspector, relative to /tftpboot.
#ironic_dnsmasq_boot_file: "pxelinux.0"

# Configure ironic upgrade option, due to currently kolla support
# two upgrade ways for ironic: legacy_upgrade and rolling_upgrade
# The variable "ironic_enable_rolling_upgrade: yes" is meaning rolling_upgrade
# were enabled and opposite
# Rolling upgrade were enable by default
#ironic_enable_rolling_upgrade: "yes"

# List of extra kernel parameters passed to the kernel used during inspection
#ironic_inspector_kernel_cmdline_extras: []

######################################
# Manila - Shared File Systems Options
######################################
# HNAS backend configuration
#hnas_ip:
#hnas_user:
#hnas_password:
#hnas_evs_id:
#hnas_evs_ip:
#hnas_file_system_name:

################################
# Swift - Object Storage Options
################################
# Swift expects block devices to be available for storage. Two types of storage
# are supported: 1 - storage device with a special partition name and filesystem
# label, 2 - unpartitioned disk  with a filesystem. The label of this filesystem
# is used to detect the disk which Swift will be using.

# Swift support two matching modes, valid options are [ prefix, strict ]
#swift_devices_match_mode: "strict"

# This parameter defines matching pattern: if "strict" mode was selected,
# for swift_devices_match_mode then swift_device_name should specify the name of
# the special swift partition for example: "KOLLA_SWIFT_DATA", if "prefix" mode was
# selected then swift_devices_name should specify a pattern which would match to
# filesystems' labels prepared for swift.
#swift_devices_name: "KOLLA_SWIFT_DATA"

# Configure swift upgrade option, due to currently kolla support
# two upgrade ways for swift: legacy_upgrade and rolling_upgrade
# The variable "swift_enable_rolling_upgrade: yes" is meaning rolling_upgrade
# were enabled and opposite
# Rolling upgrade were enable by default
#swift_enable_rolling_upgrade: "yes"


################################################
# Tempest - The OpenStack Integration Test Suite
################################################
# following value must be set when enable tempest
tempest_image_id:
tempest_flavor_ref_id:
tempest_public_network_id:
tempest_floating_network_name:

# tempest_image_alt_id: "{{ tempest_image_id }}"
# tempest_flavor_ref_alt_id: "{{ tempest_flavor_ref_id }}"

###################################
# VMware - OpenStack VMware support
###################################
#vmware_vcenter_host_ip:
#vmware_vcenter_host_username:
#vmware_vcenter_host_password:
#vmware_datastore_name:
#vmware_vcenter_name:
#vmware_vcenter_cluster_name:

#######################################
# XenAPI - Support XenAPI for XenServer
#######################################
# XenAPI driver use HIMN(Host Internal Management Network)
# to communicate with XenServer host.
#xenserver_himn_ip:
#xenserver_username:
#xenserver_connect_protocol:

############
# Prometheus
############
enable_prometheus_haproxy_exporter: "{{ enable_haproxy | bool }}"
enable_prometheus_mysqld_exporter: "{{ enable_mariadb | bool }}"
enable_prometheus_node_exporter: "{{ enable_prometheus | bool }}"
enable_prometheus_cadvisor: "{{ enable_prometheus | bool }}"
enable_prometheus_memcached: "{{ enable_prometheus | bool }}"
enable_prometheus_alertmanager: "{{ enable_prometheus | bool }}"
enable_prometheus_ceph_mgr_exporter: "{{ enable_prometheus | bool and enable_ceph | bool }}"
enable_prometheus_openstack_exporter: "{{ enable_prometheus | bool }}"
enable_prometheus_elasticsearch_exporter: "{{ enable_prometheus | bool and enable_elasticsearch | bool }}"
[root@kolla ~]#




[root@kolla ~]#部署或者重新部署openstack出现错误

一ceph部署问题

1 TASK [ceph : Fetching Ceph keyrings] *******************************************
2
3 fatal: [controller01]: FAILED! => {“failed”: true, “msg”: “The conditional check ‘{{ (ceph_files_json.stdout | from_json).changed }}’ failed. The error was: No JSON object could be decoded”
原因是在删除容器和配置文件后,kolla生成的相关volume是没有删除的。其还存在于/var/lib/docker/volume下。因此当再次构建kolla时,这些已经存在的volume会阻止ceph_mon的启动,会>导致上述错误Ceph keyring无法获取而产生的一些错误。因此 删除掉docker volume ls下的卷。再次部署就能够成功的解决问题。

[root@kolla ~]#  docker volume ls
DRIVER              VOLUME NAME
local               55b26a179933246b6b5ad08e5215f25b179d1dd13c9ca14d564d38df5217043e
local               ceph_mon
local               ceph_mon_config
local               cinder
local               elasticsearch
local               glance
local               haproxy_socket
local               influxdb
local               keystone_fernet_tokens
local               kolla_etcd
local               kolla_logs
local               libvirtd
local               magnum
local               mariadb
local               neutron_metadata_socket
local               nova_compute
local               nova_libvirt_qemu
local               openvswitch_db
local               rabbitmq
[root@kolla ~]#  docker volume rm ceph_mon ceph_mon_config

[root@kolla ~]#  kolla-ansible deploy -i /root/all-in-one -t ceph

或者采用如下方法


 在OSD节点执行,获取挂载的CEPH磁盘
# ds4ft=`mount | grep ceph | awk '{print $1}' | tr -d [:digit:] | sort -u`
### 在OSD节点执行,取消挂载
# echo $ds4ft | tr ' ' '\n' | xargs -i umount {}
### 在OSD节点执行,格式化磁盘
# echo $ds4ft | tr ' ' '\n' | xargs -i mkfs.xfs -f {}
### 在OSD节点执行,重新设置标记
# echo $ds4ft | tr ' ' '\n' | xargs -i  parted {} -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP 1 -1
### 在MON和OSD节点执行,删除所有CEPH容器和配置文件
# docker ps --filter "label=kolla_version" --format "{{.Names}}" -a | grep -E "ceph|osd" | xargs -i docker rm -f {}
# rm -rf /var/lib/kolla/var/lib/ceph /var/lib/kolla/etc/ceph /etc/kolla/ceph-*
### 在MON节点执行
# docker volume rm ceph_mon_config
 

二Mariadb部署失败


### 问题描述
TASK: [mariadb | Creating haproxy mysql user] *********************************
......
stdout: localhost | FAILED! => {
    "changed": false,
    "failed": true,
    "msg": "unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials. Exception message: (1045, \"Access denied for user 'root'@'mick-workstation' (using password: YES)\")"
}
msg: Task failed as maximum retries was encountered

### 解决办法

# docker rm mariadb
# rm -rf /var/lib/docker/volumes/mariadb/_data/*
 

三等待VIP超时


获取不到VIP

### 解决办法

### 尝试一: 修改kolla_internal_vip_address或keepalived_virtual_router_id防止VIP被其他kolla部署环境占用
# vim /etc/kolla/globals.yml
kolla_internal_vip_address: "4.0.0.5"
keepalived_virtual_router_id: "5"
# kolla-ansible -i multinode deploy --tags="haproxy"

### 尝试二: 禁用主机的网络管理器
# docker rm -f haproxy keepalived
# systemctl stop NetworkManager
# systemctl disable NetworkManager
# kolla-ansible -i multinode deploy --tags="haproxy"
 

四VIP自动消失

### 问题描述
获取到的VIP会自动消失

### 解决办法

### 尝试一: IP是否被占用
# ping 4.0.0.9

### 尝试二: 判断keepalived监控的服务是否正常
# docker exec -it keepalived bash
# ./check_alive.sh
### 如果打印的值为0说明keepalived监控的服务正常
# echo $?

### 尝试三: 参考网上一篇帖子的做法(http://www.cnblogs.com/ayao/p/keepalived-loss-vip.html),将VIP绑定的网卡的BOOTPROTO=none防止因为dhcp导致的VIP消失问题(虽然问题出现时>网卡的配置是static的,应该不是dhcp的问题,但是似乎VIP不会消失了)
 

五Bootstrap-servers执行失败


### 问题描述
docker-engine安装失败

### 解决办法

### 在节点上手动安装,下载超时也会导致失败
# yum clean all
# yum makecache fast
# yum install docker-engine-1.12.0 -y

六 kolla-ansible执行报错


### 问题描述
Ansible 2.4.0: No test named 'equalto'

### 解决办法

# pip install --upgrade Jinja2

七kolla-ansible执行报错


### 问题描述
ansible "msg": "shade is required for this module"

### 解决办法

# pip install shade
 

八镜像拉取失败

### 问题描述
Error response from daemon: Get https://4.0.0.10:4000/v1/_ping: http: server gave HTTP response to HTTPS client

Network timed out while trying to connect to http://4.0.0.10:4000/v1/repositories/lokolla/centos-source-fluentd/images. You may want to check your internet connection or if you are behind a proxy.

### 解决办法

### 尝试一: 降低docker版本
# yum remove docker-engine
# yum install docker-engine-1.12.0 -y

### 尝试二: 修改docker服务配置文件
# vim /etc/systemd/system/docker.service.d/kolla.conf
[Service]
MountFlags=shared
ExecStart=
ExecStart=/usr/bin/docker daemon --insecure-registry 92.0.0.10:4000
# systemctl daemon-reload
# systemctl restart docker
# ps -ef|grep docker
root      1294     1  0 11:36 ?        00:00:01 /usr/bin/dockerd --insecure-registry 92.0.0.10:4000
 

九创建虚拟机失败

### 问题描述
创建带volume的虚拟机提示"Block device mapping is invalid"
- 查看nova-compute日志:VolumeNotCreated: Volume f103b3f3-d0ff-4a2b-9a5e-4b7ea5a9abdc did not finish being created even after we waited 3 seconds or 2 attempts. And its status is error.
- 查看cinder-volume日志:Volume group "cinder-volumes" not found

### 解决办法

### 打印vg列表发现的确没有"cinder-volumes",这个卷是要手动建立的
# vgdisplay
# dd if=/dev/zero of=./disk.img count=4096 bs=1MB
### 查询未被占用的loop设备
# losetup -f
# losetup /dev/loop2 disk.img
# pvcreate /dev/loop2
# vgcreate cinder-volumes /dev/loop2
### 重启容器,然后查看cinder-volume日志是否成功找到"cinder-volumes"
# docker restart cinder-volumes
 


## 问题描述
创建带volume的虚拟机提示"No valid host was found"
- 查看nova-compute日志: 'iscsiadm -m node -T iqn.2010-10.org.openstack:volume-bbbccab7-bdd7-4086-8d0e-e14898439131 -p 127.0.0.1:3260' failed

### 解决办法

### 从日志看来是登入iscsi服务器失败,IP地址不对
# vim /etc/kolla/cinder-volume/cinder.conf
my_ip = 4.0.0.12
# docker restart cinder-volumes
 


### 问题描述
- nova-compute日志提示
ERROR nova.compute.manager [instance: 3af11e19-b4f8-452a-8f3d-3d659be050bd] libvirtError: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

- libvirtd日志提示
2017-11-01 18:46:09.362+0000: 30348: error : virDBusCall:1570 : error from service: CanSuspend: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the re
ply, the reply timeout expired, or the network connection was broken.

### 解决办法

检查节点状态,发现selinux开启了,关闭selinux即可
 


### 问题描述
- nova-compute日志提示
ERROR nova.image.glance [req-3d1ff662-1b82-4cf9-8aba-28644c8ba88b ded6f7f63e6743b4ac88213d5d2df5ce dded963ced3946b585c92d0684277eec - - -] Error writing to /var/lib/nova/instances/_base/bc9f28a296e64237d4205a6ea278c3e51c083ba0.part: 'NoneType' object is not iterable
ERROR nova.compute.manager [instance: 2e6b91e4-96f3-41ae-98d3-4d72f1b2cd37]   File "/usr/lib/python2.7/site-packages/nova/image/glance.py", line 586, in download
ERROR nova.compute.manager [instance: 2e6b91e4-96f3-41ae-98d3-4d72f1b2cd37]     for chunk in image_chunks:
ERROR nova.compute.manager [instance: 2e6b91e4-96f3-41ae-98d3-4d72f1b2cd37] TypeError: 'NoneType' object is not iterable

- glance_api日志提示
WARNING glance.location [req-27feac8f-9cfb-4891-91fd-913bcb7a9f1f ded6f7f63e6743b4ac88213d5d2df5ce dded963ced3946b585c92d0684277eec - default default] Get image 856dbf39-8821-4906-a68c-e78f77d88b27 data failed: Image /var/lib/glance/images/856dbf39-8821-4906-a68c-e78f77d88b27 not found.
ERROR glance.location [req-27feac8f-9cfb-4891-91fd-913bcb7a9f1f ded6f7f63e6743b4ac88213d5d2df5ce dded963ced3946b585c92d0684277eec - default default] Glance tried all active locations to get data for image 856dbf39-8821-4906-a68c-e78f77d88b27 but all have failed.

### 解决办法

到glance节点

[root@kolla ~]# cat b.txt
虚拟机创建失败

### 问题描述
rpc超时

### 解决办法

rabbitmq集群部署的配置文件使用的是主机名,所以HA环境下各个Contoller主机的主机名不能相同
虚拟机创建失败

### 问题描述
failed to connect to the hypervisor

### 解决办法

### 查询虚拟机的嵌套虚拟化是否开启
# cat /sys/module/kvm_intel/parameters/nested
N
### 如果为N,关闭虚拟机,设置CPU,开启嵌套虚拟化
# shutdown now
mariadb容器启动失败

### 问题描述
[ERROR] WSREP: failed to open gcomm backend connection: 131: invalid UUID: 00000000 (FATAL)
at gcomm/src/pc.cpp:PC():271

### 解决办法

# rm -rf /var/lib/docker/volumes/mariadb/_data/gvwstate.dat
# docker restart mariadb
宕机后mariadb集群恢复

### 问题描述
mariadb服务异常

### 解决办法

########## 停止所有mariadb容器 ##########
# docker stop mariadb
########## 找到最后关闭的mariadb主机,如果不记得就随机选取一台或者根据/var/lib/docker/volumes/mariadb/_data/grastate.dat的seqno进行选取(越大优先级越高),然后修改其grastate.dat文件的safe_to_bootstrap参数 ##########
# vim /var/lib/docker/volumes/mariadb/_data/grastate.dat
safe_to_bootstrap: 1
########## 修改mariadb容器启动命令后启动容器,查询日志保证mariadb服务正常启动 ##########
# vim /etc/kolla/mariadb/config.json
"command": "/usr/bin/mysqld_safe --wsrep-new-cluster",
# docker start mariadb
# tail -200f /var/lib/docker/volumes/kolla_logs/_data/mariadb/mariadb.log
########## 启动其他节点的mariadb容器 ##########
# docker start mariadb
# tail -200f /var/lib/docker/volumes/kolla_logs/_data/mariadb/mariadb.log
########## 确保集群运行正常后,恢复最初修改的config.json(这样就保证集群中所有的mariadb容器都是平等的)##########
# vim /etc/kolla/mariadb/config.json
"command": "/usr/bin/mysqld_safer",
# docker stop mariadb
# docker start mariadb
# tail -200f /var/lib/docker/volumes/kolla_logs/_data/mariadb/mariadb.log
Horizon无法访问

### 问题描述
[Tue May 29 09:58:25.056236 2018] [core:error] [pid 20] [client 192.168.0.1:51277] Script timed out before returning headers: django.wsgi
[Tue May 29 09:58:28.017141 2018] [core:error] [pid 81] [client 192.168.0.105:48074] End of script output before headers: django.wsgi, referer: http://47.98.113.179:8011/

### 解决办法

### 添加 WSGIApplicationGroup 配置项
# vim /etc/httpd/conf.d/openstack-dashboard.conf
...
WSGISocketPrefix run/wsgi
WSGIApplicationGroup %{GLOBAL}
...
Redis容器异常

### 问题描述
5:M 29 May 17:31:11.072 # Short read or OOM loading DB. Unrecoverable error, aborting now.
5:M 29 May 17:31:11.072 # Internal error in RDB reading function at rdb.c:1428 -> Unexpected EOF reading RDB file

### 解决办法

# rm -rf /var/lib/docker/volumes/redis/_data/dump.rdb
# docker restart redis
在nova-compute容器执行PIP命令权限不够

### 问题描述
容器内无法执行pip命令

### 解决办法

### 在容器内执行
# cat /etc/nova/rootwrap.conf | grep filters_path
filters_path=/etc/nova/rootwrap.d,/usr/share/nova/rootwrap

### 在宿主机上执行
# tee pip.filters << EOF
[Filters]
pip: CommandFilter, pip, root
EOF
# docker cp pip.filters nova_compute:/usr/share/nova/rootwrap

# sudo nova-rootwrap /etc/nova/rootwrap.conf pip install -U pip
ovs命令无法正常执行

### 问题描述
# ovs-appctl ofproto/trace br-tun dl_vlan=3
2017-06-05T08:37:32Z|00001|daemon_unix|WARN|/var/run/openvswitch/ovs-vswitchd.pid: open: No such file or directory
ovs-appctl: cannot read pidfile "/var/run/openvswitch/ovs-vswitchd.pid" (No such file or directory)

### 解决办法

### 添加启动参数
# vim /etc/kolla/openvswitch-vswitchd/config.json
--pidfile=/var/run/openvswitch/ovs-vswitchd.pid
# docker restart openvswitch_vswitchd
[root@kolla ~]#
 

的/var/lib/glance/images目录下的确没有任何内容,重启horizon容器,然后删除镜像,然后重新上传并且重命名

检测部署情况

查看Openstack服务

openstack service list --long 

查看ceph状态

 docker exec ceph_mon ceph -s

部署过程出现问题的解决方法(适合Openstack/ceph有了解的阅读人群)

Health_warm 查看ceph状态,出现health_warm警告:

查看OSD TREE是否正常 docker exec ceph_mon ceph osd tree

查看Pool情况 

# docker exec -it ceph_mon ceph osd lspools

# docker exec -it ceph_mon ceph osd dump | grep pool

ceph系统有health_warn警告,通过Pool看出池的副本数是3(replicated size),osd tree故障域只有两台host,有一个副本没有地方放置,所以是降级状态(degraded)。

配置副本数量,8个pool池都需要改

# docker exec -it ceph_mon ceph osd pool set .rgw.root size 2

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.

pip install --ignore-installed PyYAML

Network timed out while trying to...

fatal: [localhost]: FAILED! =>{"changed": false, "msg": "Unknown error message: Network timed out while trying to connect to https://index.docker.io/v1/repositories/kolla/centos-source-fluentd/images. You may want to check your internet connection or if you are behind a proxy."}

解决方法

Kolla

没有新建:vi /etc/docker/daemon.json

{

  "registry-mirrors": ["https://jzngeu7d.mirror.aliyuncs.com"]

}

#systemctl daemon-reload

#systemctl restart docker

 'ReadTimeoutError("HTTPSConnection

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)",)': /simple/ansible/

解决方法

Kolla

# pip install -U ansible --default-timeout=100

ImportError: cannot import name decorate

ImportError: cannot import name decorate

解决方法

Kolla

# pip install -U decorator

Cannot uninstall 'ipaddress'.

Cannot uninstall 'ipaddress'. 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.

此类问题强制升级此安装包即可。(已发现PyYAML,ipaddress)

解决方法

Kolla

# pip install --ignore-installed ipaddress

TCP connection reset by peer

"https://yum.dockerproject.org/repo/main/centos/7/repodata/repomd.xml: [Errno 14] curl#35 - \"TCP connection reset by peer\"", "/bin/sh: apt-get: command not found"]}

解决方法

Kolla

yum 加速源(centos7 阿里源)

# 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
 

猜你喜欢

转载自blog.csdn.net/xsjzdrxsjzdr/article/details/89790536
今日推荐