一、centos7安装mitika问题
1.问题:在keystone安装阶段请求认证令牌出现错误
1
2
3
4
5
6
7
8
9
10
11
12
|
# vim admin-openrc
export os_project_domain_name=default
export os_user_domain_name=default
export os_project_name=admin
export os_username=admin
export os_password=admin
export os_auth_url=http: //192 .168.30.139:35357 /v3
export os_identity_api_version=3
export os_image_api_version=2
# . admin-openrc
# openstack token issue
the request you have made requires authentication. (http 401) (request- id : req-7fdfe96b-ed63-4204-a357-ef104d9cf07d)
|
解决:该问题是由于二次实验时更改了用户密码,密码错误致使出现该问题,更改环境变量脚本的密码后,请求认证令牌成功
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# vim admin-openrc
export os_project_domain_name=default
export os_user_domain_name=default
export os_project_name=admin
export os_username=admin
export os_password=keystone
export os_auth_url=http: //192 .168.30.139:35357 /v3
export os_identity_api_version=3
export os_image_api_version=2
# openstack token issue
+------------+----------------------------------------------------------+
| field | value |
+------------+----------------------------------------------------------+
| expires | 2017-03-14t14:41:44.254142z |
| id | gaaaaabyx_myf4j-87auujc_an5fulubz0x7tjd1rbnazu- |
| | yqtu7uzeg8s786rp1_wyenr1jjmqyfok6jxjrhsipfk-dq_cla79fbjwa|
| | _f96vpz_knlb_znu1lo7bxuf4tx0vnyjlnebriyrrqici7k4fzwsldp- |
| | _798x_zntdb-rc9iyxi8 |
| project_id | 8bd659ec3af14030ab92047844856463 |
| user_id | 04fd25261b6444f7a331fe021e85f2fe |
+------------+----------------------------------------------------------+
|
2.dashboard仪表盘无法登陆
浏览器输入 http://controller/dashboard 访问仪表盘无法登陆,提示“出错啦!
遇到异常情况,请刷新。如需帮助请联系管理员。”
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# tail -n 40 /var/log/apache2/error.log
[wed mar 15 22:56:22.744149 2017] [:error] [pid 2733] login successful for user "admin" .
[wed mar 15 22:56:34.220718 2017] [:error] [pid 2733] internal server error: /dashboard/auth/login/
[wed mar 15 22:56:34.220920 2017] [:error] [pid 2733] traceback (most recent call last):
[wed mar 15 22:56:34.220935 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" , line 132, in get_response
[wed mar 15 22:56:34.220943 2017] [:error] [pid 2733] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[wed mar 15 22:56:34.220951 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/views/decorators/debug.py" , line 76, in sensitive_post_parameters_wrapper
[wed mar 15 22:56:34.220959 2017] [:error] [pid 2733] return view(request, *args, **kwargs)
[wed mar 15 22:56:34.220966 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/utils/decorators.py" , line 110, in _wrapped_view
[wed mar 15 22:56:34.220973 2017] [:error] [pid 2733] response = view_func(request, *args, **kwargs)
[wed mar 15 22:56:34.220981 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py" , line 57, in _wrapped_view_func
[wed mar 15 22:56:34.221043 2017] [:error] [pid 2733] response = view_func(request, *args, **kwargs)
[wed mar 15 22:56:34.221052 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/openstack_auth/views.py" , line 103, in login
[wed mar 15 22:56:34.221059 2017] [:error] [pid 2733] **kwargs)
[wed mar 15 22:56:34.221067 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/views/decorators/debug.py" , line 76, in sensitive_post_parameters_wrapper
[wed mar 15 22:56:34.221075 2017] [:error] [pid 2733] return view(request, *args, **kwargs)
[wed mar 15 22:56:34.221082 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/utils/decorators.py" , line 110, in _wrapped_view
[wed mar 15 22:56:34.221089 2017] [:error] [pid 2733] response = view_func(request, *args, **kwargs)
[wed mar 15 22:56:34.221095 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py" , line 57, in _wrapped_view_func
[wed mar 15 22:56:34.221102 2017] [:error] [pid 2733] response = view_func(request, *args, **kwargs)
[wed mar 15 22:56:34.221109 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/contrib/auth/views.py" , line 51, in login
[wed mar 15 22:56:34.221179 2017] [:error] [pid 2733] auth_login(request, form.get_user())
[wed mar 15 22:56:34.221206 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/contrib/auth/__init__.py" , line 110, in login
[wed mar 15 22:56:34.221214 2017] [:error] [pid 2733] request.session.cycle_key()
[wed mar 15 22:56:34.221221 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py" , line 285, in cycle_key
[wed mar 15 22:56:34.221228 2017] [:error] [pid 2733] self.create()
[wed mar 15 22:56:34.221269 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/cache.py" , line 48, in create
[wed mar 15 22:56:34.221281 2017] [:error] [pid 2733] "unable to create a new session key. "
[wed mar 15 22:56:34.221288 2017] [:error] [pid 2733] runtimeerror: unable to create a new session key. it is likely that the cache is unavailable.
[root@openstack1 ~] # tail -f /var/log/httpd/error_log
[wed mar 15 22:56:34.221102 2017] [:error] [pid 2733] response = view_func(request, *args, **kwargs)
[wed mar 15 22:56:34.221109 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/contrib/auth/views.py" , line 51, in login
[wed mar 15 22:56:34.221179 2017] [:error] [pid 2733] auth_login(request, form.get_user())
[wed mar 15 22:56:34.221206 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/contrib/auth/__init__.py" , line 110, in login
[wed mar 15 22:56:34.221214 2017] [:error] [pid 2733] request.session.cycle_key()
[wed mar 15 22:56:34.221221 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py" , line 285, in cycle_key
[wed mar 15 22:56:34.221228 2017] [:error] [pid 2733] self.create()
[wed mar 15 22:56:34.221269 2017] [:error] [pid 2733] file "/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/cache.py" , line 48, in create
[wed mar 15 22:56:34.221281 2017] [:error] [pid 2733] "unable to create a new session key. "
[wed mar 15 22:56:34.221288 2017] [:error] [pid 2733] runtimeerror: unable to create a new session key. it is likely that the cache is unavailable.
|
解决:更改dashboard的local_settings配置文件并重启httpd和memcached,刷新后可正常登陆,这是在国外的论坛上找到得解决方法。
1
2
3
4
5
|
# vim /etc/openstack-dashboard/local_settings
#session_engine = 'django.contrib.sessions.backends.cache'
session_engine = 'django.contrib.sessions.backends.file'
# systemctl restart httpd memcached
# systemctl status httpd memcached
|
3.创建实例提示http 500 未知api错误
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
[root@openstack1 ~] # openstack server create --flavor m1.tiny --image cirros \> --nic net-id=d920a7fc-2b7b-4553-9b4e-1cffe1f18c4d --security-group default \
> --key-name mykey1 provider-instance
unexpected api error. please report this at http: //bugs .launchpad.net /nova/ and attach the nova api log if possible.
<class 'keystoneauth1.exceptions.auth_plugins.missingrequiredoptions' > (http 500) (request- id : req-4a0895e6-971b-4531-b266-f393b6951e10)
[root@openstack1 ~] # tail -10 /var/log/nova/nova-api.log
2017-03-19 14:40:00.540 2662 error nova.api.openstack.extensions return plugin.load_from_options_getter(_getter, **kwargs)
2017-03-19 14:40:00.540 2662 error nova.api.openstack.extensions file "/usr/lib/python2.7/site-packages/keystoneauth1/loading/base.py" , line 148, in load_from_options_getter
2017-03-19 14:40:00.540 2662 error nova.api.openstack.extensions return self.load_from_options(**kwargs)
2017-03-19 14:40:00.540 2662 error nova.api.openstack.extensions file "/usr/lib/python2.7/site-packages/keystoneauth1/loading/base.py" , line 123, in load_from_options
2017-03-19 14:40:00.540 2662 error nova.api.openstack.extensions raise exceptions.missingrequiredoptions(missing_required)
2017-03-19 14:40:00.540 2662 error nova.api.openstack.extensions missingrequiredoptions: auth plugin requires parameters which were not given: auth_url
2017-03-19 14:40:00.540 2662 error nova.api.openstack.extensions
2017-03-19 14:40:00.551 2662 info nova.api.openstack.wsgi [req-4a0895e6-971b-4531-b266-f393b6951e10 04fd25261b6444f7a331fe021e85f2fe 8bd659ec3af14030ab92047844856463 - - -] http exception thrown: unexpected api error. please report this at http: //bugs .launchpad.net /nova/ and attach the nova api log if possible.
<class 'keystoneauth1.exceptions.auth_plugins.missingrequiredoptions' >
2017-03-19 14:40:00.555 2662 info nova.osapi_compute.wsgi.server [req-4a0895e6-971b-4531-b266-f393b6951e10 04fd25261b6444f7a331fe021e85f2fe 8bd659ec3af14030ab92047844856463 - - -] 192.168.30.139 "post /v2.1/8bd659ec3af14030ab92047844856463/servers http/1.1" status: 500 len: 536 time : 5.7874300
|
解决:nova.conf配置文件配置错误,仔细核对重新配置后正常
1
|
# vim /etc/nova/nova.conf
|
4.登陆云主机控制台提示如下错误
1
|
failed to connect to server (code: 1006)
|
原因:计算节点开启了防火墙、selinux,关闭后重启计算节点正常
5.云主机无法获取ip,提示如下:
1
|
failed to allocate the network(s), not rescheduling.
|
原因:计算节点不支持硬件加速
1
2
|
# egrep -c '(vms|svm)' /proc/cpuinfo
0
|
解决:确定计算节点是否支持虚拟机的硬件加速
1
2
|
# egrep -c '(vmx|svm)' /proc/cpuinfo
0
|
注:
大于等于1:计算节点支持硬件加速且不需要额外的配置
0:计算节点不支持硬件加速,必须配置 libvirt 来使用 qemu 去代替 kvm
1
2
3
|
# vim /etc/nova/nova.conf
[libvirt]
virt_type = qemu
|
6.上传云镜像失败,提示403 forbidden
1
2
3
4
|
# openstack image create "cirros" --file cirros-0.3.5-x86_64-disk.img --disk-format qcow2 --container-format bare --public
403 forbidden
you are not authorized to complete publicize_image action.
(http 403)
|
原因:glance镜像服务组件中未进行如下配置
1
2
|
[paste_deploy]
flavor = keystone
|
7.登陆云主机控制台提示:booting from hard disk
这里是由于镜像损坏导致,重新下载换个镜像后即可正常进入系统。
二、ubuntu安装openstack ocata问题
1.neutron服务安装完成后,无法验证 neutron-server
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# openstack extension list --network
'unicode' object has no attribute 'get'
# tail -n 10 /var/log/neutron/neutron-server.log
2017-03-24 21:55:29.244 97086 info neutron.wsgi [-] 192.168.30.145 - - [24 /mar/2017 21:55:29] "get / http/1.1" 200 271 0.009876
2017-03-24 21:55:30.548 97086 warning keystonemiddleware.auth_token [-] identity response: { "error" : { "message" : "the request you have made requires authentication." , "code" : 401, "title" : "unauthorized" }}
2017-03-24 21:55:31.205 97086 warning keystonemiddleware.auth_token [-] identity response: { "error" : { "message" : "the request you have made requires authentication." , "code" : 401, "title" : "unauthorized" }}
2017-03-24 21:55:31.207 97086 critical keystonemiddleware.auth_token [-] unable to validate token: identity server rejected authorization necessary to fetch token data
2017-03-24 21:55:31.214 97086 info neutron.wsgi [-] 192.168.30.145 - - [24 /mar/2017 21:55:31] "get /v2.0/extensions http/1.1" 503 401 1.949326
2017-03-24 22:04:06.670 97083 info neutron.wsgi [-] 192.168.30.145 - - [24 /mar/2017 22:04:06] "get / http/1.1" 200 271 0.006291
2017-03-24 22:04:07.251 97083 warning keystonemiddleware.auth_token [-] identity response: { "error" : { "message" : "the request you have made requires authentication." , "code" : 401, "title" : "unauthorized" }}
2017-03-24 22:04:07.566 97083 warning keystonemiddleware.auth_token [-] identity response: { "error" : { "message" : "the request you have made requires authentication." , "code" : 401, "title" : "unauthorized" }}
2017-03-24 22:04:07.567 97083 critical keystonemiddleware.auth_token [-] unable to validate token: identity server rejected authorization necessary to fetch token data
2017-03-24 22:04:07.572 97083 info neutron.wsgi [-] 192.168.30.145 - - [24 /mar/2017 22:04:07] "get /v2.0/extensions http/1.1" 503 401 0.895275
|
1
2
3
4
5
6
|
# openstack extension list --network --debug
using http: //192 .168.30.145:9696 /v2 .0 as public network endpoint
req: curl -g -i -x get http: //192 .168.30.145:9696 /v2 .0 /extensions -h "user-agent: openstacksdk/0.9.13 keystoneauth1/2.18.0 python-requests/2.12.4 cpython/2.7.12" -h "accept: application/json" -h "x-auth-token: {sha1}95ed2e189a2e72c1caf8da574a50e218d3c8a9c0"
http: //192 .168.30.145:9696 "get /v2.0/extensions http/1.1" 503 170
resp: [503] content-length: 170 content- type : application /json ; charset=utf-8 x-openstack-request- id : req-8cb0be17-836e-4793-b461-842e267052ee date : sat, 25 mar 2017 05:07:57 gmt connection: keep-alive
resp body: { "message" : "the server is currently unavailable. please try again at a later time.<br /><br />\n\n\n" , "code" : "503 service unavailable" , "title" : "service unavailable" }
|
解决:重新构建neutron-server服务
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# openstack user list
+----------------------------------+-----------+
| id | name |
+----------------------------------+-----------+
| 179677ec534648dbab9f0ca49cef017b | nova |
| 24208e7494d04e3d9a925f7efbcb34ce | admin |
| 5833a630dc9b42d48de9ea00d197834e | placement |
| 830fc99cc93742b88be1b0c04db55fd0 | neutron |
| cea92b6d391f4b008299d9a62d887202 | glance |
| e723711c56e64da7a2e4a21bbd8376b9 | demo |
+----------------------------------+-----------+
# openstack user delete 830fc99cc93742b88be1b0c04db55fd0
# openstack endpoint list
# openstack endpoint delete <id>
# openstack service list
+----------------------------------+-----------+-----------+
| id | name | type |
+----------------------------------+-----------+-----------+
| 1e5869c704be4f82b2a3948ec87aea37 | neutron | network |
| 9d52187708cc41a39582baa7c50fc63a | neutron | network |
| 9fb4ba14d8dc443bac19b7c3bc6c31fa | keystone | identity |
| c44529c847be466a8c314fee77c90fe8 | glance | image |
| d07ff10550e14570b073de85141badf1 | placement | placement |
| d6ec58eb7bc2435ab71f21a2b3a44a37 | nova | compute |
| dd2ff93317d6497798db071f360fb5f1 | neutron | network |
+----------------------------------+-----------+-----------+
# openstack service delete 9d52187708cc41a39582baa7c50fc63a
# openstack service delete dd2ff93317d6497798db071f360fb5f1
|
2.浏览器输入http://controller/horizon无法登陆horizon仪表盘服务,提示http 500错误
1
2
3
4
|
500 internal server error
the server encountered an internal error or misconfiguration and was unable to complete your request.
please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
more information about this error may be available in the server error log.
|
1
2
3
4
5
6
7
8
9
10
11
|
# tail -n 10 /var/log/apache2/error.log
[sat mar 25 03:24:01.146624 2017] [wsgi:error] [pid 103683:tid 139708160366336] [remote 192.168.30.1:23901] __import__(name)
[sat mar 25 03:24:01.146671 2017] [wsgi:error] [pid 103683:tid 139708160366336] [remote 192.168.30.1:23901] file "/usr/share/openstack-dashboard/openstack_dashboard/settings.py" , line 335, in <module>
[sat mar 25 03:24:01.146914 2017] [wsgi:error] [pid 103683:tid 139708160366336] [remote 192.168.30.1:23901] from local .local_settings import * # noqa
[sat mar 25 03:24:01.146942 2017] [wsgi:error] [pid 103683:tid 139708160366336] [remote 192.168.30.1:23901] file "/usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py" , line 133, in <module>
[sat mar 25 03:24:01.147303 2017] [wsgi:error] [pid 103683:tid 139708160366336] [remote 192.168.30.1:23901] secret_key = secret_key.generate_or_read_from_file( '/var/lib/openstack-dashboard/secret_key' )
[sat mar 25 03:24:01.147331 2017] [wsgi:error] [pid 103683:tid 139708160366336] [remote 192.168.30.1:23901] file "/usr/share/openstack-dashboard/horizon/utils/secret_key.py" , line 68, in generate_or_read_from_file
[sat mar 25 03:24:01.147438 2017] [wsgi:error] [pid 103683:tid 139708160366336] [remote 192.168.30.1:23901] key = read_from_file(key_file)
[sat mar 25 03:24:01.147464 2017] [wsgi:error] [pid 103683:tid 139708160366336] [remote 192.168.30.1:23901] file "/usr/share/openstack-dashboard/horizon/utils/secret_key.py" , line 50, in read_from_file
[sat mar 25 03:24:01.147499 2017] [wsgi:error] [pid 103683:tid 139708160366336] [remote 192.168.30.1:23901] with open (key_file, 'r' ) as f:
[sat mar 25 03:24:01.147544 2017] [wsgi:error] [pid 103683:tid 139708160366336] [remote 192.168.30.1:23901] ioerror: [errno 13] permission denied: '/var/lib/openstack-dashboard/secret_key'
|
解决:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# cd /var/lib/openstack-dashboard/
# ls -ltrh
total 12k
drwxr-xr-x 2 root root 4.0k feb 22 11:40 secret-key
-rw-r--r-- 1 root root 0 mar 25 02:16 _var_lib_openstack-dashboard_secret_key.lock
-rw------- 1 root root 64 mar 25 02:16 secret_key
drwxr-xr-x 10 www-data www-data 4.0k mar 25 02:16 static
# chown www-data:www-data /var/lib/openstack-dashboard/secret_key
# ls -ltrh
total 12k
drwxr-xr-x 2 root root 4.0k feb 22 11:40 secret-key
-rw-r--r-- 1 root root 0 mar 25 02:16 _var_lib_openstack-dashboard_secret_key.lock
-rw------- 1 www-data www-data 64 mar 25 02:16 secret_key
drwxr-xr-x 10 www-data www-data 4.0k mar 25 02:16 static
# service apache2 reload
|
3.输入域及admin凭证登陆提示invalid credentials.
1
2
3
4
5
6
|
# tail -n 10 /var/log/apache2/error.log
[sun mar 26 01:35:57.953542 2017] [wsgi:warn] [pid 7841:tid 140163993126784] mod_wsgi: compiled for python /2 .7.11.
[sun mar 26 01:35:57.953714 2017] [wsgi:warn] [pid 7841:tid 140163993126784] mod_wsgi: runtime using python /2 .7.12.
[sun mar 26 01:35:57.969646 2017] [mpm_event:notice] [pid 7841:tid 140163993126784] ah00489: apache /2 .4.18 (ubuntu) mod_wsgi /4 .3.0 python /2 .7.12 configured -- resuming normal operations
[sun mar 26 01:35:57.969747 2017] [core:notice] [pid 7841:tid 140163993126784] ah00094: command line: '/usr/sbin/apache2'
[sun mar 26 01:36:32.116454 2017] [wsgi:error] [pid 7844:tid 140163838510848] login failed for user "admin" , remote address 192.168.30.1.
|
解决:可能是bug,不支持谷歌浏览器,找了好长时间原因,后来无心插柳下用火狐浏览器正常登陆
4.nova服务配置完成后无法重新启动其中组件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# service nova-api restart
# service nova-consoleauth restart
# service nova-scheduler restart
# service nova-conductor restart ##无法启动
# tail -n 10 /var/log/nova/nova-consoleauth.log
2017-03-29 15:13:43.336 108033 error oslo_service.service file "/usr/lib/python2.7/dist-packages/amqp/connection.py" , line 274, in _wait_method
2017-03-29 15:13:43.336 108033 error oslo_service.service wait()
2017-03-29 15:13:43.336 108033 error oslo_service.service file "/usr/lib/python2.7/dist-packages/amqp/abstract_channel.py" , line 69, in wait
2017-03-29 15:13:43.336 108033 error oslo_service.service return self.dispatch_method(method_sig, args, content)
2017-03-29 15:13:43.336 108033 error oslo_service.service file "/usr/lib/python2.7/dist-packages/amqp/abstract_channel.py" , line 87, in dispatch_method
2017-03-29 15:13:43.336 108033 error oslo_service.service return amqp_method(self, args)
2017-03-29 15:13:43.336 108033 error oslo_service.service file "/usr/lib/python2.7/dist-packages/amqp/connection.py" , line 530, in _close
2017-03-29 15:13:43.336 108033 error oslo_service.service (class_id, method_id), connectionerror)
2017-03-29 15:13:43.336 108033 error oslo_service.service accessrefused: (0, 0): (403) access_refused - login was refused using authentication mechanism amqplain. for details see the broker logfile.
2017-03-29 15:13:43.336 108033 error oslo_service.service
|
原因及解决:
rabbitmq未创建成功openstack用户,出现认证错误,创建后重启正常
1
2
3
|
# rabbitmqctl list_users
listing users ...
guest[administrator]
|