阿里云 centos7.2 安装openstack报错

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介: 在CentOS 7下使用DevStack一键安装包安装OpenStack,突然来个报错,信息如下:报错一、解决方法:修改hosts文件,同步主机名vim /etc/hosts127.



在CentOS 7下使用DevStack一键安装包安装OpenStack,突然来个报错,信息如下:


报错一、


wKioL1le7AegSFrJAAAstyNfPrU999.png


解决方法:修改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


怀疑应该是软件问题

[root@h1 ~]# 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


[root@h1 Packages]# rpm -e --nodeps mariadb-libs-5.5.47-1.el7_2.x86_64[root@h1 Packages]# rpm -qa mariadb-libs                              [root@h1 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%]
[root@h1 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

查看日志

[root@controller ~]# cd /var/log/keystone/[root@controller 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 'root'@'%' IDENTIFIED BY 'yunjisuan';

flush privileges;

修改hosts
[root@controller 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



[root@controller keystone]# mysql -ukeystone_admin   -pEnter password:Welcome to the MariaDB monitor.  Commands end with ; or \g.                        ##本机测试可以登录因为本人实在云上环境搭建的,只有一个eth0是内网,通过云是外网ip,现在不确定服务器 访问绑定的外网ip的方式是什么样的,
是直接eth0到外网ip,就回来了,, 还是过了路由再回来。如果是这样,就相当于远程访问mysql数据库。- -,关系好乱。



[root@controller ~]# 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 'root'@'%'  identified  by 'xxxxxxxx';       ####添加%,就可以远程登录了.
[root@hequan ~]# 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

[root@controller ~]# 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登陆信息

001741_MLr9_857184.png


总结:其实每个简单得小报错都可能是未来的小财富,相信越努力就会越成功!



相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
2月前
阿里云Grafana服务支持一键安装Grafana插件
阿里云Grafana服务支持一键安装Grafana插件
73 2
|
2月前
|
Java 关系型数据库 应用服务中间件
阿里云RDS购买Linux完整过程——安装java环境并跑起来tomcat
阿里云RDS购买Linux完整过程——安装java环境并跑起来tomcat
47 0
|
2月前
|
Docker 容器
在docker中安装zookeeper,并且阿里云服务器配置
在docker中安装zookeeper,并且阿里云服务器配置
204 1
|
2月前
|
NoSQL Redis Docker
在docker中安装redis,并且阿里云服务器配置
在docker中安装redis,并且阿里云服务器配置
187 1
|
1月前
|
存储 弹性计算 Linux
阿里云ECS(CentOS镜像)安装docker
阿里云ECS(CentOS镜像)安装docker
385 0
|
1月前
阿里云Grafana服务支持一键安装Grafana插件
【2月更文挑战第12天】阿里云Grafana服务支持一键安装Grafana插件
29 4
|
2月前
|
搜索推荐 语音技术 开发工具
ModelScope问题之文档部署到阿里云EAS 调用模型报错如何解决
ModelScope模型报错是指在使用ModelScope平台进行模型训练或部署时遇到的错误和问题;本合集将收集ModelScope模型报错的常见情况和排查方法,帮助用户快速定位问题并采取有效措施。
188 1
|
2月前
|
弹性计算 Linux 数据安全/隐私保护
阿里云幻兽帕鲁服务器搭建教程_神仙级Palworld安装教程
阿里云幻兽帕鲁服务器搭建教程_神仙级Palworld安装教程,阿里云提供了一键部署幻兽帕鲁(Palworld)服务器的便捷服务,让用户可以快速创建和管理自己的游戏服务器,利用计算巢或OOS的幻兽帕鲁程序一键部署Palworld
|
2月前
|
NoSQL 关系型数据库 Linux
阿里云RDS购买Linux——安装redis服务
阿里云RDS购买Linux——安装redis服务
97 0
|
2月前
|
存储 弹性计算 NoSQL
阿里云Ubuntu20.04安装MongDB
本文主要演示如何使用阿里云Ubuntu20.04,并使用阿里云DMS工具登录MongDB。
阿里云Ubuntu20.04安装MongDB