Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

gnocchi port not open

I configured gnocchi and started its services successfully. But port 8041 is not open. So, when I run gnocchi commands, it is failing. I have provided gnocchi.conf, and gnocchi services' status below.

[root@controller1 ~ (admin)]# gnocchi resource list  --type image
Unable to establish connection to http://localhost:8041/v1/resource/image?: HTTPConnectionPool(host='localhost', port=8041): Max retries exceeded with url: /v1/resource/image (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x3a92310>: Failed to establish a new connection: [Errno 111] Connection refused',))

[root@controller1 ~ (admin)]# systemctl is-active openstack-gnocchi-api.service openstack-gnocchi-metricd.service openstack-gnocchi-statsd.service
active
active
active

[root@controller1 ~ (admin)]# cat /etc/gnocchi/gnocchi.conf
[DEFAULT]
debug = true
verbose = true
log_dir = /var/log/gnocchi

[api]
auth_mode = keystone
max_limit = 1000
host=10.0.0.12
workers=4
port=8041

[database]
backend = sqlalchemy

[indexer]
url = mysql+pymysql://gnocchi:GNOCCHI_DBPASS@10.0.0.11/gnocchi

[keystone_authtoken]
auth_url = http://10.0.0.11:5000/v3
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = gnocchi
password = GNOCCHI_PASS
interface = internalURL
region_name = RegionOne

[oslo_policy]
policy_file = /etc/gnocchi/policy.json

[statsd]
resource_id = b21b5f8e-37b4-41af-9e43-29e489fa129e
user_id = a0017c7c-6775-426d-a997-8fd4fa2e2069
project_id = 6b897f1e-2422-43ae-bd8d-b232a34c1d8f
archive_policy_name = low
flush_delay = 5

[storage]
driver = ceph
ceph_pool = metrics
ceph_username = gnocchi
ceph_keyring = /etc/ceph/ceph.client.gnocchi.keyring
ceph_conffile = /etc/ceph/ceph.conf

gnocchi port not open

I configured gnocchi and started its services successfully. But port 8041 is not open. So, when I run gnocchi commands, it is failing. I have provided gnocchi.conf, and gnocchi services' status below.

[root@controller1 ~ (admin)]# gnocchi resource list  --type image
Unable to establish connection to http://localhost:8041/v1/resource/image?: HTTPConnectionPool(host='localhost', port=8041): Max retries exceeded with url: /v1/resource/image (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x3a92310>: Failed to establish a new connection: [Errno 111] Connection refused',))
 

I have provided gnocchi.conf, and gnocchi services' status below.

[root@controller1 ~ (admin)]# systemctl is-active openstack-gnocchi-api.service openstack-gnocchi-metricd.service openstack-gnocchi-statsd.service
active
active
active

[root@controller1 ~ (admin)]# cat /etc/gnocchi/gnocchi.conf
[DEFAULT]
debug = true
verbose = true
log_dir = /var/log/gnocchi

[api]
auth_mode = keystone
max_limit = 1000
host=10.0.0.12
workers=4
port=8041

[database]
backend = sqlalchemy

[indexer]
url = mysql+pymysql://gnocchi:GNOCCHI_DBPASS@10.0.0.11/gnocchi

[keystone_authtoken]
auth_url = http://10.0.0.11:5000/v3
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = gnocchi
password = GNOCCHI_PASS
interface = internalURL
region_name = RegionOne

[oslo_policy]
policy_file = /etc/gnocchi/policy.json

[statsd]
resource_id = b21b5f8e-37b4-41af-9e43-29e489fa129e
user_id = a0017c7c-6775-426d-a997-8fd4fa2e2069
project_id = 6b897f1e-2422-43ae-bd8d-b232a34c1d8f
archive_policy_name = low
flush_delay = 5

[storage]
driver = ceph
ceph_pool = metrics
ceph_username = gnocchi
ceph_keyring = /etc/ceph/ceph.client.gnocchi.keyring
ceph_conffile = /etc/ceph/ceph.conf

It looks like gnocchi-api is listening on port 8000 instead of port 8041.

[root@controller1 ~ (admin)]# systemctl status openstack-gnocchi-api.service  -l
● openstack-gnocchi-api.service - OpenStack ceilometer API service
   Loaded: loaded (/usr/lib/systemd/system/openstack-gnocchi-api.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2017-07-01 09:56:28 EDT; 10min ago
 Main PID: 18682 (gnocchi-api)
   CGroup: /system.slice/openstack-gnocchi-api.service
           └─18682 /usr/bin/python2 /usr/bin/gnocchi-api -- --logfile /var/log/gnocchi/api.log

Jul 01 09:56:32 controller1 gnocchi-api[18682]: Available at http://10.0.0.12:8000/
Jul 01 09:56:32 controller1 gnocchi-api[18682]: DANGER! For testing only, do not use in production
Jul 01 09:56:32 controller1 gnocchi-api[18682]: ********************************************************************************
Jul 01 09:57:53 controller1 gnocchi-api[18682]: 10.0.0.12 - - [01/Jul/2017 09:57:53] "GET /v1/resource/image HTTP/1.1" 401 114
Jul 01 09:58:00 controller1 gnocchi-api[18682]: 10.0.0.12 - - [01/Jul/2017 09:58:00] "GET /v1/resource/image HTTP/1.1" 401 114
Jul 01 09:58:17 controller1 gnocchi-api[18682]: 10.0.0.12 - - [01/Jul/2017 09:58:17] "GET /v1/resource/image HTTP/1.1" 401 114
Jul 01 09:58:28 controller1 gnocchi-api[18682]: 10.0.0.12 - - [01/Jul/2017 09:58:28] "GET /v1/resource/image HTTP/1.1" 401 114
Jul 01 09:58:35 controller1 gnocchi-api[18682]: 10.0.0.12 - - [01/Jul/2017 09:58:35] "GET /v1/resource/image HTTP/1.1" 401 114
Jul 01 09:58:47 controller1 gnocchi-api[18682]: 10.0.0.12 - - [01/Jul/2017 09:58:47] "GET /v1/resource/image HTTP/1.1" 401 114
Jul 01 10:01:31 controller1 gnocchi-api[18682]: 10.0.0.12 - - [01/Jul/2017 10:01:31] "GET /v1/resource/image HTTP/1.1" 401 114
You have new mail in /var/spool/mail/root

When I executed gnocchi command with argument "--endpoint http://10.0.0.12:8000", I got "The request you have made requires authentication. (HTTP 401)"

[root@controller1 ~ (admin)]# gnocchi-2.7 resource list  --type image --endpoint http://10.0.0.12:8000  --debug
REQ: curl -g -i -X GET http://10.0.0.12:8000/v1/resource/image? -H "Authorization: {SHA1}d4daf1cf567f14f32dbc762154b3a281b4ea4c62" -H "Accept: application/json, */*" -H "User-Agent: gnocchi-2.7 keystoneauth1/2.18.0 python-requests/2.11.1 CPython/2.7.5"
Starting new HTTP connection (1): 10.0.0.12
"GET /v1/resource/image HTTP/1.1" 401 114
RESP: [401] Date: Sat, 01 Jul 2017 14:09:14 GMT Server: WSGIServer/0.1 Python/2.7.5 Content-Type: application/json Content-Length: 114 WWW-Authenticate: Keystone uri='http://10.0.0.11:5000/v3'
RESP BODY: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}

The request you have made requires authentication. (HTTP 401)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/display.py", line 112, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/lib/python2.7/site-packages/gnocchiclient/v1/resource_cli.py", line 68, in take_action
    **utils.get_pagination_options(parsed_args))
  File "/usr/lib/python2.7/site-packages/gnocchiclient/v1/resource.py", line 45, in list
    return self._get(url).json()
  File "/usr/lib/python2.7/site-packages/gnocchiclient/v1/base.py", line 37, in _get
    return self.client.api.get(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 217, in get
    return self.request(url, 'GET', **kwargs)
  File "/usr/lib/python2.7/site-packages/gnocchiclient/client.py", line 38, in request
    raise exceptions.from_response(resp, method)
Unauthorized: The request you have made requires authentication. (HTTP 401)
Traceback (most recent call last):
  File "/usr/bin/gnocchi-2.7", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/gnocchiclient/shell.py", line 239, in main
    return GnocchiShell().run(args)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 279, in run
    result = self.run_subcommand(remainder)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/display.py", line 112, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/lib/python2.7/site-packages/gnocchiclient/v1/resource_cli.py", line 68, in take_action
    **utils.get_pagination_options(parsed_args))
  File "/usr/lib/python2.7/site-packages/gnocchiclient/v1/resource.py", line 45, in list
    return self._get(url).json()
  File "/usr/lib/python2.7/site-packages/gnocchiclient/v1/base.py", line 37, in _get
    return self.client.api.get(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 217, in get
    return self.request(url, 'GET', **kwargs)
  File "/usr/lib/python2.7/site-packages/gnocchiclient/client.py", line 38, in request
    raise exceptions.from_response(resp, method)
gnocchiclient.exceptions.Unauthorized: The request you have made requires authentication. (HTTP 401)

gnocchi client program is not sending authentication token request to Keystone. Why does this happen? How to rectify this?