当前位置:编程学习 > 网站相关 >>

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,keysto
 
#! /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  
ne,heat,cinder and glance.

补充:Web开发 , Python ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,