savanna-api can't be started while setting logging in conf

Asked by Xiang Hui

Hi team,

ENV :
Redhat 6.4 64-bit
RDO rdo-release-havana-6.noarch
openstack-savanna-0.3-0.1.a274.gabf778f.el6.noarch
python-django-savanna-0.3-0.1.a10.g87e1e22.el6.noarch

I want to log savanna, but after setting the following items into /etc/savanna/savanna.conf,
the command service openstack-savanna-api start didn't work, didn't find any clue.

#log_dir=/var/log/savanna/
#log_file=savanna.log

Any help is appreciated, thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Sahara Edit question
Assignee:
No assignee Edit question
Solved by:
Alexander Rubtsov
Solved:
Last query:
Last reply:
Revision history for this message
Dmitry Mescheryakov (dmitrymex) said :
#1

The first thing I notice is that you didn't remove '#' from the beginning of lines.

If you did, did you also created /var/log/savanna directory?

Also consider invoking savanna-api directly - stdout & stderr output hidden by the init script might give you a hint.

If that does not help, can you post you full configuration here?

Revision history for this message
Xiang Hui (xianghui) said :
#2

Thanks for Dmitry's response,

The following is the entire steps I configure savanna logging based on rdo:

savanna-api can be started by removing log_dir/log_file, but failed to start while adding them.

[root@oc2603148815 ~(keystone_admin)]# ps -ef|grep savanna
savanna 10359 1 1 04:17 ? 00:00:00 /usr/bin/python /usr/bin/savanna-api --config-file /etc/savanna/savanna.conf
root 11022 1260 0 04:18 pts/2 00:00:00 grep --color=auto savanna
[root@oc2603148815 ~(keystone_admin)]# mkdir /var/log/savanna

# Edit savanna.conf
[root@oc2603148815 ~(keystone_admin)]# vi /etc/savanna/savanna.conf

[DEFAULT]
log_dir=/var/log/savanna
log_file=savanna.log
# REST API config
#port=8386

# Address and credentials that will be used to check auth tokens
os_auth_host=127.0.0.1
os_auth_port=35357
os_admin_username=admin
os_admin_password=79e82b9223d34a56
os_admin_tenant_name=admin

# When set to false, Savanna uses only internal IP of VMs.
# When set to true, Savanna expects OpenStack to auto-
# assign floating IPs to cluster nodes. Internal IPs will
# be used for inter-cluster communication, while floating
# ones will be used by Savanna to configure nodes. Also
# floating IPs will be exposed in service URLs. This option
# is ignored when "use_neutron" is set to True (boolean value)
use_floating_ips=False

# The suffix of the node's FQDN. In nova-network that is
# dhcp_domain config parameter (string value)
#node_domain=novalocal

# Use Neutron or Nova Network (boolean value)
#use_neutron=false

# List of plugins to be loaded. Savanna preserves the order of
# the list when returning it. (list value)
plugins=vanilla,hdp

[plugin:vanilla]
plugin_class=savanna.plugins.vanilla.plugin:VanillaProvider

[plugin:hdp]
plugin_class=savanna.plugins.hdp.ambariplugin:AmbariPlugin

[database]
[DEFAULT]
log_dir=/var/log/savanna
log_file=savanna.log
# REST API config
#port=8386

# Address and credentials that will be used to check auth tokens
os_auth_host=127.0.0.1
os_auth_port=35357
os_admin_username=admin
os_admin_password=79e82b9223d34a56
os_admin_tenant_name=admin

# When set to false, Savanna uses only internal IP of VMs.
# When set to true, Savanna expects OpenStack to auto-
# assign floating IPs to cluster nodes. Internal IPs will
# be used for inter-cluster communication, while floating
# ones will be used by Savanna to configure nodes. Also
# floating IPs will be exposed in service URLs. This option
# is ignored when "use_neutron" is set to True (boolean value)
use_floating_ips=False

# The suffix of the node's FQDN. In nova-network that is
# dhcp_domain config parameter (string value)
#node_domain=novalocal

# Use Neutron or Nova Network (boolean value)
#use_neutron=false

# List of plugins to be loaded. Savanna preserves the order of
# the list when returning it. (list value)
plugins=vanilla,hdp

[plugin:vanilla]
plugin_class=savanna.plugins.vanilla.plugin:VanillaProvider

[plugin:hdp]
plugin_class=savanna.plugins.hdp.ambariplugin:AmbariPlugin

[database]

# URL for sqlalchemy database (string value)
connection=sqlite:////tmp/savanna-server.db

[root@oc2603148815 ~(keystone_admin)]# service openstack-savanna-api restart
Stopping openstack-savanna-api: [ OK ]
Starting openstack-savanna-api: [ OK ]
[root@oc2603148815 ~(keystone_admin)]# ps -ef|grep savanna
root 11967 1260 0 04:19 pts/2 00:00:00 grep --color=auto savanna

But invoking savanna-api directly log-file works fine~

[root@oc2603148815 ~(keystone_admin)]# /usr/bin/python /usr/bin/savanna-api --config-file /etc/savanna/savanna.conf --log-file /var/log/savanna/savanna.log &
[1] 19428
[root@oc2603148815 ~(keystone_admin)]# /usr/lib/python2.6/site-packages/nova/__init__.py:45: UserWarning: Module jinja2 was already imported from /usr/lib64/python2.6/site-packages/jinja2/__init__.pyc, but /usr/lib/python2.6/site-packages/Jinja2-2.6-py2.6.egg is being added to sys.path
  return pkg_resources.require(requirement)
/usr/lib64/python2.6/site-packages/Crypto/Util/randpool.py:40: RandomPool_DeprecationWarning: This application uses RandomPool, which is BROKEN in older releases. See http://www.pycrypto.org/randpool-broken
  RandomPool_DeprecationWarning)
/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/strategies.py:117: SADeprecationWarning: The 'listeners' argument to Pool (and create_engine()) is deprecated. Use event.listen().
  pool = poolclass(creator, **pool_args)
/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/pool.py:159: SADeprecationWarning: Pool.add_listener is deprecated. Use event.listen()
  self.add_listener(l)
2013-10-14 04:28:42.652 19428 WARNING keystoneclient.middleware.auth_token [-] Configuring auth_uri to point to the public identity endpoint is required; clients may not be able to authenticate against an admin endpoint
(19428) wsgi starting up on http://0.0.0.0:8386/

[root@oc2603148815 ~(keystone_admin)]# ps -ef|grep savanna
root 19428 1260 1 04:28 pts/2 00:00:00 /usr/bin/python /usr/bin/savanna-api --config-file /etc/savanna/savanna.conf --log-file /var/log/savanna/savanna.log
root 20164 1260 0 04:29 pts/2 00:00:00 grep --color=auto savanna

Is is the problem of the rpm packages? What your ways to start savanna-api with logging?
Thank you very much.

Revision history for this message
Dmitry Mescheryakov (dmitrymex) said :
#3

Hmm, try removing log_dir parameter from config and set log_file=/var/log/savanna/savanna.log

Then try launching savanna-api directly after that with only config file parameter:
/usr/bin/python /usr/bin/savanna-api --config-file /etc/savanna/savanna.conf

Also try again restarting the service with init script

Revision history for this message
Best Alexander Rubtsov (arubtsov) said :
#4

Hello Xiang,

Also please make sure that savanna.log has appropriate permissions:
"chown savanna:savanna /var/log/savanna/savanna.log"

because when you run savanna-api directly, it launched as root

Revision history for this message
Xiang Hui (xianghui) said :
#5

@Dmitry, after setting logging as you referred, savanna-api still failed to be started :( , but thanks for your efforts to give my advices, appreciated.
[root@oc2603148815 ~]# vi /etc/savanna/savanna.conf
#log_dir=/var/log/savanna
log_file=/var/log/savanna/savanna.log

[root@oc2603148815 ~]# vi /etc/savanna/savanna.conf

[root@oc2603148815 ~]# service openstack-savanna-api restart
Stopping openstack-savanna-api: [FAILED]
Starting openstack-savanna-api: [ OK ]
[root@oc2603148815 ~]# ps -ef|grep savanna
root 23347 22043 0 21:31 pts/4 00:00:00 grep --color=auto savanna

@Alexander, thank you, that works : )
[root@oc2603148815 ~]#
[root@oc2603148815 ~]# vi /etc/savanna/savanna.conf
log_dir=/var/log/savanna
log_file=savanna.log

[root@oc2603148815 ~]# chown savanna:savanna /var/log/savanna/savanna.log
[root@oc2603148815 ~]# service openstack-savanna-api restart
Stopping openstack-savanna-api: [FAILED]
Starting openstack-savanna-api: [ OK ]
[root@oc2603148815 ~]# ps -ef|grep savanna
savanna 24157 1 8 21:32 ? 00:00:00 /usr/bin/python /usr/bin/savanna-api --config-file /etc/savanna/savanna.conf
root 24245 22043 0 21:32 pts/4 00:00:00 grep --color=auto savanna

Revision history for this message
Xiang Hui (xianghui) said :
#6

Thanks Alexander Rubtsov, that solved my question.