openstack常见报错

1:导入镜像的时候出现以下报错

error finding address for http://controller:9292/v2/schemas/image

是glance-api.conf,glance-registry.conf两个配置文件中

[keystone_authtoken]

auth_uri = http://controller:5000

auth_url = http://controller:35357

一个是uri,一个是url ,如果敲错了,就会出现如上错误。

如果修正好再不行,则加上auth_uri = http://controller:5000/v3

auth_url = http://controller:35357/v3

更改完后重启服务  每个服务,数据库里都有数据,首先要检查数据库里有没有数据表,再检查创建数据库用户授权,sql语句一定要写正确,再排查配置文件,再看日志

============================================================================

如果想继续浏览请点左下方继续阅读!!

2:安装keystone时创建用户报错

The request you have made requires authentication. (HTTP 401) (Request-ID: req-03560e9f-bacc-4b0f-ac00-6ee4030cab8a)

1.登陆mysql,查看keystone数据库下有没有生成新表

use keystone;

show tables;

发现keyston数据库下没有表生成,理论上运行如下语句后会生成表:

# su -s /bin/sh -c "keystone-manage db_sync" keystone

2.使用授权帐号和密码尝试登陆mysql

mysql -h localhost -u keystone -p123456    --登陆成功

mysql -h controller -u keystone -p123456   --登陆失败

理论上使用controller主机名能登陆,因为授权对象包括%和localhost

3.查看keystone日志

# vim /var/log/keystone/keystone.log

2018-07-20 13:59:29.019 2958 CRITICAL keystone [-] OperationalError: (pymysql.err.OperationalError) (1045, u"Access denied for user ‘keystone‘@‘controller‘ (using password: YES)")

发现登陆失败信息

# mysql_secure_installation

经过多次测试,如果在mysql安全初始化时,不移除匿名用户、删除test数据库,就会出现以上授权问题

Remove anonymous users? [Y/n] Y

 ... Success!

 

Normally, root should only be allowed to connect from ‘localhost‘.  This

ensures that someone cannot guess at the root password from the network.

 

Disallow root login remotely? [Y/n] n

 ... skipping.

By default, MariaDB comes with a database named ‘test‘ that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

 

Remove test database and access to it? [Y/n] Y

- Dropping test database...

... Success!

- Removing privileges on test database...

============================================================================

3:An unexpected error prevented the server from fulfilling your request. (HTTP 500)

执行    keystone tenant-create --name admin --description "Admin Tenant"  出现   An unexpected error prevented the server from fulfilling your request. (HTTP 500)

查询了一下

有的  说重启,不管用

有的说

Instead of typing the command: # su -s /bin/sh -c "keystone-manage db_sync" keystone, you must type only: /bin/sh -c "keystone-manage db_sync" keystone

The issue came that: if you have already loggin as a root so you haven't needed anymore to use the "su -s" command.也不管用

也查询了服务是否开启 netstat -anutp|grep 35357   正常啊

卡了3,4个小时

最后看日志 tail -f /var/log/keystone/keystone.log

2016-03-27 17:27:53.396 4910 ERROR keystone.common.wsgi [-] (ProgrammingError) (1146, "Table 'keystone.project' doesn't exist") 'INSERT INTO project (id, name, domain_id, description, enabled, extra) VALUES (%s, %s, %s, %s, %s, %s)' ('2b7c3c51a0ff42a886174224a5e2bf4d', 'admin', 'default', 'Admin Tenant', 1, '{}')

一行命名解决

直接输入  keystone-manage db_sync

问题解决
---------------------
作者:MautheDoog
来源:CSDN
原文:https://blog.csdn.net/zw421152835/article/details/50992732?utm_source=copy
版权声明:本文为博主原创文章,转载请附上博文链接!

=============================================================================

4:Openstack network agent list时报错

忘记错误了,一般情况是不会报错的,报错原因是因为我创建网络服务API的时候写错地址了,关于创建地址出错的解决办法。如下图,查询所有地址的时候发现transdreams被我创建成了controller,所以网络服务查询地址的时候就去访问controller这个地址了。

下面的图片,把neutron这个库完全删除

删除neutron服务

#openstack user list  //列出所有用户,把neutron用户也删掉

下图重新创建neutron库,并创建用户授权;

创建新的neutron用户并输入密码

将admin角色添加到neutron用户

创建neutron服务实体:

创建网络服务API端点:

运行下面的命令

Openstack目录列表

 

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注