This article will demonstrate that how to stop and start the Openstack services on Ubuntu when you have done the installation through the devstack method. If you followed the devstack method for deploying the openstack, there are some set of scripts will be available to perform the stop and start openstack services without much pain. This script can be added to the Linux start up scripts in rc.local or /etc/rc.3d. In this article ,we will see that how to stop the running openstack services and start manually. Openstack services will not automatically start unless you add in to the start-up scripts or start it manually.
[box type=”warning” align=”” class=”” width=””]If you do not stop the openstack service properly prior to the system reboot ,there is a high chance of corrupting the openstack DB.[/box]
This article will cover other know issue with respect to openstack keystone.
Assume that ,we have planned the maintenance for host which requires the reboot. Before going to reboot the sever , you need to stop the openstack services properly.
1. Navigate to the /opt/stack/devstack directory. Run ./unstack.sh to stop the openstack services gracefully.
stack@uacloud:~/devstack$ ./unstack.sh Site keystone disabled. To activate the new configuration, you need to run: service apache2 reload * Stopping web server apache2 * * Starting web server apache2 * Stopping web server apache2 * tgt stop/waiting stack@uacloud:~/devstack$
2. Halt the server . (If you have any maintenance planned)
3. Once the maintenance has been completed, power on the server.
4. Once the OS is booted, navigate to ~stack/devstack/ & rejoin-stack.sh . This script will bring up all the openstack services.
stack@uacloud:~/devstack$ ./rejoin-stack.sh 2015-08-20 09:18:41.105 DEBUG heat-api-cloudwatch [-] keystone_authtoken.memcache_pool_maxsize = 10 from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.105 DEBUG heat-api-cloudwatch [-] keystone_authtoken.memcache_pool_socket_timeout = 3 from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.109 DEBUG heat-api-cloudwatch [-] keystone_authtoken.memcache_pool_unused_timeout = 60 from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.109 DEBUG heat-api-cloudwatch [-] keystone_authtoken.memcache_secret_key = **** from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.113 DEBUG heat-api-cloudwatch [-] keystone_authtoken.memcache_security_strategy = None from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.117 DEBUG heat-api-cloudwatch [-] keystone_authtoken.memcache_use_advanced_pool = False from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.121 DEBUG heat-api-cloudwatch [-] keystone_authtoken.memcached_servers = None from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.122 DEBUG heat-api-cloudwatch [-] keystone_authtoken.revocation_cache_time = 10 from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.134 DEBUG heat-api-cloudwatch [-] keystone_authtoken.signing_dir = /var/cache/heat from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.140 DEBUG heat-api-cloudwatch [-] keystone_authtoken.token_cache_time = 300 from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.141 DEBUG heat-api-cloudwatch [-] auth_password.allowed_auth_uris = [] from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.142 DEBUG heat-api-cloudwatch [-] auth_password.multi_cloud = False from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.149 DEBUG heat-api-cloudwatch [-] clients_keystone.ca_file = None from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.154 DEBUG heat-api-cloudwatch [-] clients_keystone.cert_file = None from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.165 DEBUG heat-api-cloudwatch [-] clients_keystone.endpoint_type = None from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.171 DEBUG heat-api-cloudwatch [-] clients_keystone.insecure = None from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.172 DEBUG heat-api-cloudwatch [-] clients_keystone.key_file = None from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.177 DEBUG heat-api-cloudwatch [-] revision.heat_revision = unknown from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 2015-08-20 09:18:41.178 DEBUG heat-api-cloudwatch [-] ******************************************************************************** from (pid=18551) log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2075 2015-08-20 09:18:41.181 INFO heat.api.cloudwatch [-] Starting Heat CloudWatch API on 0.0.0.0:8003 2015-08-20 09:18:41.214 INFO eventlet.wsgi.server [-] Starting single process server 2015-08-20 09:18:41.225 DEBUG eventlet.wsgi.server [-] (18551) wsgi starting up on http://0.0.0.0:8003/ from (pid=18551) write /opt/stack/heat/heat/common/wsgi.py:179 9$ n-crt 10$ n-net 11$ n-sch 12$ n-novnc 13$ n-xvnc 14$ n-cauth 15$ n-obj 16$ c-api 17$ c-sch 18$ c-vol 19$ h-eng 20$ h-api 21-$ h-api-cfn 22$ h-api-cw*
5. If you want to come out from this screen , press Ctrl+A then immediately press shift+” . Once you have done that , you will get screen like below. ( ” quotation key which is near to enter key )
Num Name Flags 0 shell $ 1 key $ 2 key-access $ 3 horizon $ 4 g-reg $ 5 g-api $ 6 n-api $ 7 n-cpu $ 8 n-cond $ 9 n-crt $ 10 n-net $ 11 n-sch $ 12 n-novnc $ 13 n-xvnc $ 14 n-cauth $ 15 n-obj $ 16 c-api $ 17 c-sch $ 18 c-vol $ 19 h-eng $ 20 h-api $ 21 h-api-cfn $ 22 h-api-cw $ - * 0-$ shell 1$ key 2$ key-access 3$ horizon 4$ g-reg 5$ g-api 6$ n-api 7$ n-cpu 8$ n-cond 9$ n-crt 10$ n-net 11$ n-sch 12$ n-novnc 13$ n-xvnc 14$ n-ca
Use the arrow keys and navigate to ” 0 shell ” and press enter to get the shell back. But the openstack screen will remain attached. If you would like to detach the screen completely , user Ctrl+A then D.
Issues & Troubleshooting:
Issue 1. Dashboard is not opening , please check the apace service and restart it .
service apache2 restart
Issue 2. Unable to login to the dashboard after rebooting the server . If you get error like “An error occurred authenticating. Please try again later.” Please restart keystone services . To restart the keystone services, press Ctrl+A then immediately press shift+” (If your screen is already attached. ) . You will screen like below.
Num Name Flags 0 shell $ 1 key $ 2 key-access $ 3 horizon $ 4 g-reg $ 5 g-api $ 6 n-api $ 7 n-cpu $ 8 n-cond $ 9 n-crt $ 10 n-net $ 11 n-sch $ 12 n-novnc $ 13 n-xvnc $ 14 n-cauth $ 15 n-obj $ 16 c-api $ 17 c-sch $ 18 c-vol $ 19 h-eng $ 20 h-api $ 21 h-api-cfn $ 22 h-api-cw $ - * 0-$ shell 1$ key 2$ key-access 3$ horizon 4$ g-reg 5$ g-api 6$ n-api 7$ n-cpu 8$ n-cond 9$ n-crt 10$ n-net 11$ n-sch 12$ n-novnc 13$ n-xvnc 14$ n-ca
- Navigate to ” 1 key ” using arrow keys & press enter. You will be able to see the keystone logs. In this screen , just press Ctlr + C .
20107 DEBUG keystone.openstack.common.service [-] ******************************************************************************** log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2075 20107 INFO keystone.openstack.common.service [-] Caught SIGINT, stopping children stack@uacloud:~/keystone/bin$ 1$ key* 2$ key-access 3$ horizon 4$ g-reg 5$ g-api 6$ n-api 7$ n-cpu 8$ n-cond 9$ n-crt 10$ n-net 11$ n-sch 12$ n-novnc 13$ n-xvnc 14$ n-cauth 15$ n-obj
- Just navigate to /opt/stack/keystone/bin & execute keystone-all .
stack@uacloud:~/keystone/bin$ ls -lrt total 12 -rwxr-xr-x 1 stack stack 1559 Aug 20 00:30 keystone-manage -rwxr-xr-x 1 stack stack 5756 Aug 20 00:30 keystone-all stack@uacloud:~/keystone/bin$ ./keystone-all 20264 DEBUG keystone.openstack.common.service [-] token.revocation_cache_time = 3600 log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 20264 DEBUG keystone.openstack.common.service [-] token.revoke_by_id = True log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2073 20264 DEBUG keystone.openstack.common.service [-] ******************************************************************************** log_opt_values /usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py:2075 1$ key* 2$ key-access 3$ horizon 4$ g-reg 5$ g-api 6$ n-api 7$ n-cpu 8$ n-cond 9$ n-crt 10$ n-net 11$ n-sch 12$ n-novnc 13$ n-xvnc 14$ n-cauth 15$ n-obj
- Press Ctlr + A then D to detach the Openstack screen. Now you should be able to login to the Openstack horizon dashboard.
Hope this article is informative to you to stop & start the openstack services manually on Ubuntu . Also , it will help you to troubleshoot the dashboard login issues. Share it ! Support Openstack !!
Prasenjeet says
Thanks. Very helpful article.