1. 程式人生 > >阿裏雲安裝openstack報錯

阿裏雲安裝openstack報錯

阿裏雲安裝openstack報錯



在CentOS 7下使用DevStack一鍵安裝包安裝OpenStack,突然來個報錯,信息如下:


報錯一、


技術分享


解決方法:修改hosts文件,同步主機名

vim /etc/hosts

127.0.0.1 openstack


報錯二、

ERROR : Error appeared during Puppet run: 192.168.1.201_mariadb.ppError: Execution of ‘/usr/bin/yum -d 0 -e 0 -y install mariadb‘ returned 1: Error: Package: 1:mariadb-5.5.44-2.el7.centos.x86_64 (dvd)
You will find full trace in log /var/tmp/packstack/20160704-142958-_jXSqZ/manifests/192.168.1.201_mariadb.pp.log


懷疑應該是軟件問題

[[email protected] ~]# yum -d 0 -e 0 -y install mariadb-5.5.44-2.el7.centos.x86_64錯誤:軟件包:1:mariadb-5.5.44-2.el7.centos.x86_64 (dvd)
          需要:mariadb-libs(x86-64) = 1:5.5.44-2.el7.centos
          已安裝: 1:mariadb-libs-5.5.47-1.el7_2.x86_64 (@updates)
              mariadb-libs(x86-64) = 1:5.5.47-1.el7_2
          可用: 1:mariadb-libs-5.5.44-2.el7.centos.x86_64 (dvd)
              mariadb-libs(x86-64) = 1:5.5.44-2.el7.centos
 您可以嘗試添加 --skip-broken 選項來解決該問題
 您可以嘗試執行:rpm -Va --nofiles --nodigest


一個是5.5.44 一個是5.5.47


[[email protected] Packages]# rpm -e --nodeps mariadb-libs-5.5.47-1.el7_2.x86_64[[email protected] Packages]# rpm -qa mariadb-libs                              [[email protected] Packages]# rpm -ivh mariadb-libs-5.5.44-2.el7.centos.x86_64.rpm準備中...                          ################################# [100%]
正在升級/安裝...
   1:mariadb-libs-1:5.5.44-2.el7.cento################################# [100%]
[[email protected]
/* */ Packages]# rpm -qa mariadb-libs mariadb-libs-5.5.44-2.el7.centos.x86_64


正常測試


報錯三、

解決:

報錯是 在用RDO模式 packstack安裝openstack 最新版mitaka時出現的。

是在雲上的環境

inet 192.168.1.7/24 brd 192.168.1.255 scope global dynamic eth0 有一個外網IP 42.62.X.X

查看日誌

[[email protected] ~]# cd /var/log/keystone/[[email protected] keystone]# lskeystone.log2016-08-01 20:34:33.513 14145 ERROR keystone.common.wsgi DBConnectionError: (pymysql.err.OperationalError) (2003, "Can‘t connect to MySQL server on ‘x.x.x.x‘ ([Errno 110] Connection timed out)")2016-08-01 20:34:33.513 14145 ERROR keystone.common.wsgi2016-08-01 20:35:34.671 14150 WARNING oslo_db.sqlalchemy.engines [req-12a5fe87-1163-4fbb-a049-5225ea65a05a - - - - -] SQL connection failed. 10 attempts left.

查看數據庫

MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| cinder |
| glance |
| gnocchi |
| information_schema |
| keystone |
| mysql |
| neutron |
| nova |
| nova_api |
| performance_schema |
| test |
+--------------------+11 rows in set (0.00 sec)
MariaDB [(none)]> use keystone;
Database changed
MariaDB [keystone]> show tables;
Empty set (0.00 sec)
生成了庫 沒內容


看用戶
MariaDB [mysql]> select host,user from user;
+-----------+----------------+
| host | user |
+-----------+----------------+
| % | cinder |
| % | glance |
| % | gnocchi |
| % | keystone_admin |
| % | neutron |
| % | nova |
| % | nova_api |
| 127.0.0.1 | keystone_admin |
| localhost | root |
+-----------+----------------+9 rows in set (0.00 sec)
權限是 %,應該是可以的,


參考 mysql授權localhost&%區別及一直授權錯誤解決辦法

http://blog.csdn.net/tantexian/article/details/44861733

此處多說一句,此處配置%遠程其他host有權限訪問,那麽在mysql的配置文件中 /etc/my.cnf,也需要做一些配置,將bind_address=0.0.0.0或者直接屏蔽掉此項,更多請自行查找資料。

如果想讓外面host能訪問數據庫:(yunjisuan為root密碼)

GRANT ALL PRIVILEGES ON *.* TO [email protected]%‘ IDENTIFIED BY ‘yunjisuan‘;

flush privileges;

修改hosts
[[email protected] keystone]# cat /etc/hosts
127.0.0.1 controller
localhost localhost.localdomain localhost4 localhost4.localdomain4 ##在127.0.0.1也添加主機名字::1
localhost localhost.localdomain localhost6 localhost6.localdomain6 x.x.x.x controller



[[email protected] keystone]# mysql -ukeystone_admin -pEnter password:Welcome to the MariaDB monitor. Commands end with ; or \g. ##本機測試可以登錄因為本人實在雲上環境搭建的,只有一個eth0是內網,通過雲是外網ip,現在不確定服務器 訪問綁定的外網ip的方式是什麽樣的,
是直接eth0到外網ip,就回來了,, 還是過了路由再回來。如果是這樣,就相當於遠程訪問mysql數據庫。- -,關系好亂。



[[email protected] ~]# route -n ##這是默認路由Kernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 eth0192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0所以現在要檢查一下 安全組。 測試root 無法遠程登錄。
用別的機器測試 mysql服務器可以,安全組沒有問題 MariaDB [mysql]> grant all privileges on *.* to [email protected]%‘ identified by ‘xxxxxxxx‘; ####添加%,就可以遠程登錄了.
[[email protected] ~]# mysql -hip -p -ukeystone_admin
## 本地測試登錄無問題。Enter password:Welcome to the MariaDB monitor. Commands end with ; or \g.MariaDB [mysql]> use keystone;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedMariaDB [keystone]> show tables;
+------------------------+
| Tables_in_keystone |
+------------------------+
| access_token |
| assignment |
| config_register |
| consumer |
| credential |
| domain |
| endpoint |
###查看有表了再次執行,又有新的報錯RROR : Error appeared during Puppet run: x.x.x.x_cinder.ppError: Could not prefetch cinder_type provider ‘openstack‘: Execution of ‘/usr/bin/openstack volume type list --quiet --format csv --long‘ returned 1: Unable to CONFIG_CINDER_NETAPP_ESERIES_HOST_TYPE=linux_dm_mp ##這是 cinder_typeMariaDB [keystone]> use cinderDatabase changedMariaDB [cinder]> show tables;Empty set (0.00 sec)

查看 cinder裏面沒有表,還是有問題。MariaDB [cinder]> use glance;Database changedMariaDB [glance]> show tables;Empty set (0.00 sec)
glance也沒有生成表,,,只有keystone 的好了。Applying x.x.x.x_keystone.ppApplying x.x.x.x_glance.ppApplying x.x.x.x_cinder.pp
x.x.x.x_keystone.pp: [ DONE ] Testing if puppet apply is finished: x.x.x.x_cinder.pp [ \ ] $$$##卡在這裏卸載數據庫,從新測試,竟然可以了。。= =,我了個大去。感動老天了。。
| % | cinder |
| % | glance |
| 127.0.0.1 | keystone_admin |

總結:方法3個,1是在127.0.0.1 添加主機名,,2 重新設置一遍 root 在msyql 的權限% 3 卸載掉數據庫,重新測試。


打算一會測試 用內網ip, 然後在路由器上做 80映射,這樣應該會好一點。不知道行不行。簡直是作死,在雲上搭建openstack。。。。測試完。

**** Installation completed successfully ******

Additional information:

* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.

* File /root/keystonerc_admin has been created on OpenStack client host x.x.x.x . To use the command line tools you need to source the file.

* To access the OpenStack Dashboard browse to http://x.x.x.x /dashboard .

Please, find your login credentials stored in the keystonerc_admin in your home directory.

* Because of the kernel update the host x.x.x.x requires reboot.

* Because of the kernel update the host 127.0.0.1 requires reboot.

* The installation log file is available at: /var/tmp/packstack/20160801-224547-mTb9CN/openstack-setup.log

* The generated manifests are available at: /var/tmp/packstack/20160801-224547-mTb9CN/manifests

[[email protected] ~]# netstat -lntupActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp 0 0 0.0.0.0:8774 0.0.0.0:* LISTEN 21105/python2
tcp 0 0 0.0.0.0:8775 0.0.0.0:* LISTEN 21105/python2
tcp 0 0 0.0.0.0:9191 0.0.0.0:* LISTEN 19676/python2
tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN 1307/httpd
tcp 0 0 0.0.0.0:8776 0.0.0.0:* LISTEN 20207/python2
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 10588/beam.smp
tcp 0 0 0.0.0.0:8777 0.0.0.0:* LISTEN 1307/httpd
tcp 0 0 0.0.0.0:8041 0.0.0.0:* LISTEN 1307/httpd
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 31512/mongod
tcp 0 0 0.0.0.0:8042 0.0.0.0:* LISTEN 1307/httpd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 17028/mysqld
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 25302/memcached
tcp 0 0 0.0.0.0:9292 0.0.0.0:* LISTEN 19705/python2
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 22134/rpcbind
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1307/httpd
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 816/sshd
tcp 0 0 0.0.0.0:35357 0.0.0.0:* LISTEN 1307/httpd
tcp 0 0 0.0.0.0:16509 0.0.0.0:* LISTEN 22855/libvirtd
tcp 0 0 0.0.0.0:9696 0.0.0.0:* LISTEN 24517/python2
tcp 0 0 0.0.0.0:6080 0.0.0.0:* LISTEN 22974/python2
tcp6 0 0 :::5672 :::* LISTEN 10588/beam.smp
tcp6 0 0 :::111 :::* LISTEN 22134/rpcbind
tcp6 0 0 :::22 :::* LISTEN 816/sshd
tcp6 0 0 :::16509 :::* LISTEN 22855/libvirtd
udp 0 0 0.0.0.0:11211 0.0.0.0:* 25302/memcached
udp 0 0 0.0.0.0:11431 0.0.0.0:* 585/dhclient
udp 0 0 0.0.0.0:8125 0.0.0.0:* 29029/python2
udp 0 0 0.0.0.0:68 0.0.0.0:* 585/dhclient
udp 0 0 0.0.0.0:111 0.0.0.0:* 22134/rpcbind
udp 0 0 127.0.0.1:323 0.0.0.0:* 558/chronyd
udp 0 0 0.0.0.0:685 0.0.0.0:* 22134/rpcbind
udp 0 0 0.0.0.0:4952 0.0.0.0:* 32304/python2
udp6 0 0 :::111 :::* 22134/rpcbind
udp6 0 0 ::1:323 :::* 558/chronyd
udp6 0 0 :::685 :::* 22134/rpcbind
udp6 0 0 :::38397 :::* 585/dhclient

報錯 四、


安裝Mitaka

執行下列命令安裝RDO庫

yum install https://rdoproject.org/repos/rdo-release.rpm

安裝CentOS openstack RPM repository

yum install centos-release-openstack-mitaka

更新系統包

yum update

安裝packstack工具

yum install openstack-packstack

安裝openstack Mitaka

packstack --allinone

執行這一步之後會花費一些時間

看到下面類似的信息,說明openstak mitaka已經安裝完成了,同時可以看到dashboard的入口

技術分享

從/root/keystonerc_admin文件裏可以找到dashboard登陸信息

技術分享


總結:其實每個簡單得小報錯都可能是未來的小財富,相信越努力就會越成功!



本文出自 “李世龍” 博客,謝絕轉載!

阿裏雲安裝openstack報錯