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


  • 相关阅读:
    项目中正在使用,整理出来的logback配置文件模板
    springboot集成redis 报错@Bean definition illegally overridden by existing bean definition@bean定义被现有bean定义非法重写
    SpringBoot2.0+ 使用Log4j2日志输出
    springboot启动报 A child container failed during start 错误解决过程
    java反射获取和设置实体类的属性值 递归所有父类
    springboot集成websocket实现向前端浏览器发送一个对象,发送消息操作手动触发
    SpringBoot整合MongoDB,在多数据源下实现事务回滚。
    spring boot项目开发中遇到问题,持续更新
    identifier of an instance of xx.entity was altered from xxKey@249e3cb2 to xxKey@74e8f4a3; nested exception is org.hibernate.HibernateException: identifier of an instance of xxentity was altered from错误
    Spring Boot启动 Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not instantiate id generator错误
  • 原文地址:https://www.cnblogs.com/keanuyaoo/p/3291954.html
Copyright © 2011-2022 走看看