How to Change the Debug Level for PF9-consul Logs?
Problem
Change the log levels for the PF9-consul logs.
Default Logs level configured for _"/var/log/pf9/pf9-consul.log"_
can be verified in the _"pf9-ha.conf"_
and _"server.json"_
on the hosts.
x
# cat /opt/pf9/etc/pf9-ha/conf.d/pf9-ha.conf | grep -i "consul_log_level"
consul_log_level = debug
# cat /opt/pf9/etc/pf9-consul/conf.d/server.json
{"bootstrap_expect": 3, "server": true, "datacenter": "3", "data_dir": "/opt/pf9/consul-data-dir/", "advertise_addr": "172.20.113.39", "bind_addr": "172.20.113.39", "disable_remote_exec": true, "log_level": "debug", "node_name": "011ed680-aa4d-451d-8756-e257a9678e12", "retry_join": ["172.20.113.32", "172.20.113.33", "172.20.113.34", "172.20.113.35", "172.20.113.36", "172.20.113.37", "172.20.113.38", "172.20.113.39", "172.20.113.40", "172.20.113.41"], "encrypt": "QjJYWTVxc3ZRU2E0eWMtMw==", "verify_incoming": true, "verify_outgoing": true, "verify_server_hostname": false, "ca_file": "/opt/pf9/etc/pf9-consul/consul_ca.pem", "cert_file": "/opt/pf9/etc/pf9-consul/consul_cert.pem", "key_file": "/opt/pf9/etc/pf9-consul/consul_key.pem"}[root@aidc-ostack-prd8 ~]#
Environment
- Platform9 Managed OpenStack - v5.4.0 and Higher
Procedure
We need to update in the Resmgr DB for Roles and Hosts table.
- Roles table need to be updated so that the same configurations should get reflected to the new hosts.
mysql> update roles set customizable_settings = REPLACE (customizable_settings, "debug", "info") where id="pf9-ha-slave_5.6.6-969";
2. Hosts table need to be updated - It should start reflecting the config to the already on-boarded hosts.
mysql> update hosts set role_settings = REPLACE (role_settings, "debug", "info");
- Verify the "____**consul__log___level"**_ configurations using below commands or
_"/var/log/pf9/pf9-consul.log"_
the on the node:
# cat /opt/pf9/etc/pf9-ha/conf.d/pf9-ha.conf | grep -i "consul_log_level"
consul_log_level = info
# cat /opt/pf9/etc/pf9-consul/conf.d/server.json
{"bootstrap_expect": 3, "server": true, "datacenter": "3", "data_dir": "/opt/pf9/consul-data-dir/", "advertise_addr": "172.20.113.39", "bind_addr": "172.20.113.39", "disable_remote_exec": true, "log_level": "info", "node_name": "011ed680-aa4d-451d-8756-e257a9678e12", "retry_join": ["172.20.113.32", "172.20.113.33", "172.20.113.34", "172.20.113.35", "172.20.113.36", "172.20.113.37", "172.20.113.38", "172.20.113.39", "172.20.113.40", "172.20.113.41"], "encrypt": "QjJYWTVxc3ZRU2E0eWMtMw==", "verify_incoming": true, "verify_outgoing": true, "verify_server_hostname": false, "ca_file": "/opt/pf9/etc/pf9-consul/consul_ca.pem", "cert_file": "/opt/pf9/etc/pf9-consul/consul_cert.pem", "key_file": "/opt/pf9/etc/pf9-consul/consul_key.pem"}
Or
We use curl API request to update the role settings for a host:
curl -k -X 'PUT' -H "X-Auth-Token: $TOKEN" -H 'Content-Type: application/json;charset=UTF-8' "https://test-du-vmha-centos7-2835695-r2.platform9.horse/resmgr/v1/hosts/<host-id>/roles/pf9-ha-slave" -d '{"consul_log_level": "debug"}'
Was this page helpful?