zoukankan      html  css  js  c++  java
  • start stack

    Start OpenStack Services


    After launching your stack by Devstack, you maybe stop some services or reboot your machine.

    This script help you start nova,keystone,heat,cinder and glance.

    #! /bin/bash 
    ###########################
    # start OpenStack Services
    ###########################
    # Help
    # this script is used to start several OpenStack Services after creating 
    # devstack. Typically, run it after restarting machine.
    #constants
    
    
    #functions
    
    
    #call nohup
    function call_async(){
     nohup $* &
    }
    #start keystone
    function start_keystone() {
        echo "start keystone"
        call_async python /opt/stack/keystone/bin/keystone-all 
            --config-file /etc/keystone/keystone.conf 
            --log-config /etc/keystone/logging.conf -d 
            --debug 
            > /tmp/start_keystone.log 2>&1 &
    }
    
    
    #glance
    function start_glance {
        echo "start glance registry"
        call_async python /usr/local/bin/glance-registry 
            --config-file=/etc/glance/glance-registry.conf 
            > /tmp/start_glance_reg.log 2>&1 &
        echo "start glance api"
        call_async python /usr/local/bin/glance-api 
            --config-file=/etc/glance/glance-api.conf 
            > /tmp/start_glance_api.log 2>&1 &
    
    
    }
    
    
    #nova
    function start_nova { 
        echo "start nova api"
        call_async python /usr/local/bin/nova-api 
            > /tmp/start_nova_api.log 2>&1 &
        echo "start nova conductor"
        call_async python /usr/local/bin/nova-conductor 
            > /tmp/start_nova_conductor.log 2>&1 &
        echo "start nova compute"
        call_async python /usr/local/bin/nova-compute 
            --config-file /etc/nova/nova.conf 
            > /tmp/start_nova_compute.log 2>&1 &
        echo "start nova cert"
        call_async python /usr/local/bin/nova-cert 
            > /tmp/start_nova_cert.log 2>&1 &
        echo "start nova network"
        call_async python /usr/local/bin/nova-network 
            --config-file /etc/nova/nova.conf 
            > /tmp/start_nova_network.log 2>&1 &
        echo "start nova scheduler"
        call_async python /usr/local/bin/nova-scheduler 
            --config-file /etc/nova/nova.conf 
            > /tmp/start_nova_scheduler.log 2>&1 &
        echo "start nova novncproxy"
        call_async python /usr/local/bin/nova-novncproxy 
            --config-file /etc/nova/nova.conf 
            --web /opt/stack/noVNC 
            > /tmp/start_nova_novncproxy.log 2>&1 &
        echo "start nova xvpvncproxy"
        call_async python /usr/local/bin/nova-xvpvncproxy 
            --config-file /etc/nova/nova.conf 
            > /tmp/start_nova_vncproxy.log 2>&1 &
        echo "start nova consoleauth"
        call_async python /usr/local/bin/nova-consoleauth 
            > /tmp/start_nova_noconsole.log 2>&1 &
        echo "start nova objectstore"
        call_async python /usr/local/bin/nova-objectstore 
            > /tmp/start_nova_obj.log 2>&1 &
    }
    
    
    #cinder
    function start_cinder {
        echo "start cinder api"
        call_async python /usr/local/bin/cinder-api 
            --config-file /etc/cinder/cinder.conf 
            > /tmp/start_cinder_api.log 2>&1 &
        echo "start cinder scheduler"
        call_async python /usr/local/bin/cinder-scheduler 
            --config-file /etc/cinder/cinder.conf 
            > /tmp/start_cinder_scheduler.log 2>&1 &
        echo "start cinder volume"
        call_async python /usr/local/bin/cinder-volume 
            --config-file /etc/cinder/cinder.conf 
            > /tmp/start_cinder_volume.log 2>&1 &
    }
    #heat
    function start_heat {
        echo "start heat engine"
        call_async python /usr/local/bin/heat-engine 
            --config-file=/etc/heat/heat-engine.conf 
            > /tmp/start_heat_engine.log 2>&1 &
        echo "start heat api"
        call_async python /usr/local/bin/heat-api 
            --config-dir=/etc/heat/heat-api.conf 
            > /tmp/start_heat_api.log 2>&1 &
        echo "start heat api cfn"
        call_async python /usr/local/bin/heat-api-cfn 
            --config-dir=/etc/heat/heat-api-cfn.conf 
            > /tmp/start_heat_api_cfn.log 2>&1 &
        echo "start heat api cloudwatch"
        call_async python /usr/local/bin/heat-api-cloudwatch 
            --config-dir=/etc/heat/heat-api-cloudwatch.conf 
            > /tmp/start_heat_cw.log 2>&1 &
    }
    
    
    
    
    #main
    [ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
    
    
    echo "clean logs"
    sudo rm /tmp/start_*.log
    
    
    start_keystone
    
    
    # make sure the keystone is started.
    sleep 5
    
    
    start_glance
    
    
    start_cinder
    
    
    sleep 10
    
    
    start_nova
    
    
    sleep 10
    
    
    start_heat


  • 相关阅读:
    118/119. Pascal's Triangle/II
    160. Intersection of Two Linked Lists
    168. Excel Sheet Column Title
    167. Two Sum II
    172. Factorial Trailing Zeroes
    169. Majority Element
    189. Rotate Array
    202. Happy Number
    204. Count Primes
    MVC之Model元数据
  • 原文地址:https://www.cnblogs.com/keanuyaoo/p/3291954.html
Copyright © 2011-2022 走看看