设为首页 收藏本站
查看: 2954|回复: 0

[经验分享] [原]openstack-kilo--issue(十)ERROR: openstack Unable to establish connection to ht

[复制链接]

尚未签到

发表于 2017-6-26 14:29:16 | 显示全部楼层 |阅读模式
本博客已经添加"打赏"功能,"打赏"位置位于右边栏红色框中,感谢您赞助的咖啡.
  ====环境==
  openstack :kilo
  CentOS : 7
  ====问题===
  在没有关vm的情况下,重启了controller。
  问题一:
  在使用nova service-list 或者openstack-status的时候或者其他认证需求的时候出现以下错误
  ERROR: openstack Unable to establish connection to http://controller:35357/v3/auth/tokens
  ConnectionRefused: Unable to establish connection to http://controller:35357/v3/auth/tokens
Authorization Failed: Unable to establish connection to http://controller:35357/v3/tokens



1 == Keystone users ==
2 /usr/lib/python2.7/site-packages/keystoneclient/shell.py:65: DeprecationWarning: The keystone CLI is deprecated in favor of python-openstackclient. For a Python library, continue using python-keystoneclient.
3   'python-keystoneclient.', DeprecationWarning)
4 Authorization Failed: Unable to establish connection to http://controller:35357/v3/tokens
5 == Glance images ==
6 Unable to establish connection to http://controller:35357/v3/auth/tokens
7 == Nova managed services ==
8 No handlers could be found for logger "keystoneclient.auth.identity.generic.base"
9 ERROR (ConnectionRefused): Unable to establish connection to http://controller:35357/v3/auth/tokens
10 == Nova networks ==
11 No handlers could be found for logger "keystoneclient.auth.identity.generic.base"
12 ERROR (ConnectionRefused): Unable to establish connection to http://controller:35357/v3/auth/tokens
13 == Nova instance flavors ==
14 No handlers could be found for logger "keystoneclient.auth.identity.generic.base"
15 ERROR (ConnectionRefused): Unable to establish connection to http://controller:35357/v3/auth/tokens
16 == Nova instances ==
17 No handlers could be found for logger "keystoneclient.auth.identity.generic.base"
18 ERROR (ConnectionRefused): Unable to establish connection to http://controller:35357/v3/auth/tokens
  问题二:
  解决问题一之后发现dashboard无法正常启动了:
  ImportError: Could not import settings 'openstack_dashboard.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named main



1 [iyunv@controller system]# systemctl status httpd.service
2 httpd.service - The Apache HTTP Server
3    Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
4   Drop-In: /usr/lib/systemd/system/httpd.service.d
5            └─openstack-dashboard.conf
6    Active: failed (Result: exit-code) since Tue 2016-12-27 15:37:33 CST; 15min ago
7   Process: 8204 ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear (code=e
8
9 Dec 27 15:37:33 controller python[8204]: File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 54, in __getat
10 Dec 27 15:37:33 controller python[8204]: self._setup(name)
11 Dec 27 15:37:33 controller python[8204]: File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 49, in _setup
12 Dec 27 15:37:33 controller python[8204]: self._wrapped = Settings(settings_module)
13 Dec 27 15:37:33 controller python[8204]: File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 132, in __init
14 Dec 27 15:37:33 controller python[8204]: % (self.SETTINGS_MODULE, e)
15 Dec 27 15:37:33 controller python[8204]: ImportError: Could not import settings 'openstack_dashboard.settings' (Is it on sys.
16 Dec 27 15:37:33 controller systemd[1]: httpd.service: control process exited, code=exited status=1
17 Dec 27 15:37:33 controller systemd[1]: Failed to start The Apache HTTP Server.
18 Dec 27 15:37:33 controller systemd[1]: Unit httpd.service entered failed state.
  openstack-dashboard也出现了变化



[iyunv@controller httpd.service.d]# openstack-status
== Nova services ==
openstack-nova-api:                     active
openstack-nova-cert:                    active
openstack-nova-compute:                 active
openstack-nova-network:                 inactive  (disabled on boot)
openstack-nova-scheduler:               active
openstack-nova-conductor:               active
== Glance services ==
openstack-glance-api:                   active
openstack-glance-registry:              active
== Keystone service ==
openstack-keystone:                     active
== Horizon service ==
openstack-dashboard:                    uncontactable
== neutron services ==
neutron-server:                         active
  问题三:
  使用nova boot 创建vm的时候出现错误:



1 ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-2f5571f4-aa54-4d45-a096-cb8797c5ff7a)
2
3 ConnectionRefused: Unable to establish connection to http://controller:9696/v2.0/ports.json?tenant_id=

  ]# neutron agent-list
  Unable to establish connection to http://controller:9696/v2.0/agents.json


  =======解决方案===
  问题一的解决方案:



1 ]# netstat -anp|grep 35357        //使用命令查看是否有这个服务端口
2
3
4
5 如果没有35357 端口
6 ]# vim /etc/keystone/keystone.conf
7
8 admin_port = 35357                //取消注释
9
10
11
12 重启keystone服务
13 在kilo中 keystone 服务名称为openstack-keystone.service
14 ]# systemctl enable openstack-keystone.service  && systemctl restart openstack-keystone.service
15
16 ---------验证---------------
17 [iyunv@controller ~]# netstat -anp |grep 35357
18
19 tcp 0 0 0.0.0.0:35357 0.0.0.0:* LISTEN 7738/python
20
21  
22
23 [iyunv@controller ~]# nova service-list
24 +----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
25 | Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
26 +----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
27 | 1 | nova-console | controller | internal | enabled | up | 2016-12-27T08:02:16.000000 | - |
28 | 2 | nova-cert | controller | internal | enabled | up | 2016-12-27T08:02:16.000000 | - |
29 | 3 | nova-conductor | controller | internal | enabled | up | 2016-12-27T08:02:16.000000 | - |
30 | 4 | nova-scheduler | controller | internal | enabled | up | 2016-12-27T08:02:17.000000 | - |
31 | 5 | nova-compute | controller | nova | enabled | up | 2016-12-27T08:02:12.000000 | - |
32 | 6 | nova-consoleauth | controller | internal | enabled | up | 2016-12-27T08:02:16.000000 | - |
33 | 7 | nova-compute | compute1 | nova | enabled | up | 2016-12-27T08:02:20.000000 | - |
34 +----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
35
36 问题一解决
  问题二的解决方案:



I have resolved the "openstack service create" problem following this steps :
HTTP and KEYSTONE service sharing the same port, so stop httpd and start openstack-keystone.service. Edit /etc/keystone/keystone.conf and replace "hostname or ip" to "localhost":
connection = mysql://keystone:openstack@localhost/keystone

Remember to stop service httpd and enable start service keystone: - systemctl stop httpd.service - systemctl enable openstack-keystone.service => systemctl start openstack-keystone.service
And finally, exec "openstack service create --name keystone --description "OpenStack Identity" identity" command.
Most important to remember, the dashboard horizon use apache so that keystone and apache service must be running. Into keystone.conf and wsgi-keystone.conf occur bind a single interface on ports 5000 and 35357 instead of all interface "*" or "0.0.0.0":
edit /etc/keystone/keystone.conf => set admin_bind_host = <ip_mgmt> => set public_bind_host = <ip_mgmt>
edit /etc/httpd/conf.d/wsgi-keystone.conf => set Listen 127.0.0.1:5000 => Listen 127.0.0.1:35357 => same for VirtualHost 127.0.0.1:5000 & 35357
After service openstack-keystone.service and httpd.service restart, both process will be running in the same time.
参考源网址:
https://ask.openstack.org/en/question/66833/kilo-on-centos7-keystone-throws-http-500-except-when-using-os_token/
  问题三的解决方案:



1 查看9696端口:
2
3 ]# netstat -anp|grep 9696
4
5 如果没有端口开启,查看下面配置文件
6
7 ]# vim /etc/neutron/neutron.conf
8 bind_port = 9696         
9
10 重启neutron服务
11
12 ]# systemctl restart neutron-server neutron-dhcp-agent neutron-l3-agent  neutron-metadata-agent  neutron-openvswitch-agent
13
14 ]# netstat -anp|grep 9696
15 tcp 0 0 0.0.0.0:9696 0.0.0.0:* LISTEN 11895/python2
16
17 ============验证=======
18
19 [iyunv@controller etc]# neutron agent-list
20 +--------------------------------------+--------------------+------------+-------+----------------+---------------------------+
21 | id | agent_type | host | alive | admin_state_up | binary |
22 +--------------------------------------+--------------------+------------+-------+----------------+---------------------------+
23 | 2c0d7171-ae4d-467f-8a24-14d0c683aefb | Open vSwitch agent | controller | :-)| True | neutron-openvswitch-agent |
24 | 32eb2441-daf9-4f48-8cf6-2a11c3140426 | Metadata agent | controller | :-) | True | neutron-metadata-agent |
25 | 54c7a92d-2ceb-4786-939f-31a55b34952c | DHCP agent | controller | :-) | True | neutron-dhcp-agent |
26 | aca60f17-955a-41fc-8992-1387efa6574e | L3 agent | controller | :-) | True | neutron-l3-agent |
27 | ba6ebc7d-b15f-44d2-a515-17efdd5e3472 | Open vSwitch agent | compute1 | :-) | True | neutron-openvswitch-agent |
28 +--------------------------------------+--------------------+------------+-------+----------------+---------------------------+

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-388191-1-1.html 上篇帖子: Neutron 网络基本概念 下篇帖子: Openstack Swift 原理、架构与 API 介绍
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表