zoukankan      html  css  js  c++  java
  • openstack stein部署手册 6. nova-api

    # 建立数据库用户及权限
    create database nova;
    grant all privileges on nova.* to nova@'localhost' identified by 'Abc@123';
    grant all privileges on nova.* to nova@'%' identified by 'Abc@123';
    
    create database nova_api;
    grant all privileges on nova_api.* to nova@'localhost' identified by 'Abc@123';
    grant all privileges on nova_api.* to nova@'%' identified by 'Abc@123';
    
    create database nova_cell0;
    grant all privileges on nova_cell0.* to nova@'localhost' identified by 'Abc@123';
    grant all privileges on nova_cell0.* to nova@'%' identified by 'Abc@123';
    
    flush privileges;
    

    # 建立用户、角色、服务、项目、域、端点
    source ~/.openstack_admin
    openstack user create --domain default --project service --password Abc@123 nova
    openstack role add --project service --user nova admin
    openstack service create --name nova --description "OpenStack Compute Service" compute
    
    openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
    openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
    openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
    

    # 安装程序包
    yum install -y openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-console
    

    # 变更配置文件
    cd /etc/nova
    mv nova.conf nova.conf.org
    
    cat > /etc/nova/nova.conf << EOF
    [DEFAULT]
    my_ip = 192.168.10.218
    enabled_apis = osapi_compute,metadata
    transport_url = rabbit://openstack:Abc@123@controller
    user_neutron = true
    firewall_driver = nova.virt.firewall.NoopFirewallDriver
    
    [api_database]
    connection = mysql+pymysql://nova:Abc@123@controller/nova_api
    
    [database]
    connection = mysql+pymysql://nova:Abc@123@controller/nova
    
    [api]
    auth_strategy = keystone
    
    [keystone_authtoken]
    auth_url = http://controller:5000/v3
    memcached_servers = controller:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project _name = service
    username = nova
    password = Abc@123
    
    [vnc]
    enabled = true
    server_listen = $my_ip
    server_proxyclient_address = $my_ip
    
    [glance]
    api_servers = http://controller:9292
    
    [oslo_concurrency]
    lock_path = /var/lib/nova/tmp
    
    [placement]
    auth_url = http://controller:5000/v3
    region_name = RegionOne
    project_domain_name = default
    user_domain_name = default
    project _name = service
    auth_type = password
    username = placement
    password = Abc@123
    
    [scheduler]
    discover_hosts_in_cells_interval = 300
    EOF
    
    chmod 640 /etc/nova/nova.conf
    chown root:nova /etc/nova/nova.conf
    

    # 同步数据库
    su -s /bin/bash -c "nova-manage api_db sync" nova
    su -s /bin/bash -c "nova-manage cell_v2 map_cell0" nova
    su -s /bin/bash -c "nova-manage cell_v2 create_cell --name cell1 --verbose" nova
    su -s /bin/bash -c "nova-manage db sync" nova
    
    su -s /bin/bash -c "nova-manage cell_v2 list_cells" nova
    su -s /bin/bash -c "nova-manage cell_v2 discover_hosts --verbose" nova
    

    # 开启服务
    systemctl restart openstack-nova-api && systemctl enable openstack-nova-api
    systemctl restart openstack-nova-scheduler && systemctl enable openstack-nova-scheduler
    systemctl restart openstack-nova-conductor && systemctl enable openstack-nova-conductor
    systemctl restart openstack-nova-novncproxy && systemctl enable openstack-nova-novncproxy
    systemctl restart openstack-nova-consoleauth && systemctl enable openstack-nova-consoleauth
    

    # 验证
    openstack compute service list
    
  • 相关阅读:
    Python与机器视觉(x)图像修复
    git push代码到远程新分支
    1024节日快乐~~~~
    【Python-GPU】GPU数据科学加速包——RAPIDS
    Echarts漂亮水滴图
    【深度学习】三维点云数据集总结
    poj 3273 Monthly Expense
    poj 3150 Cellular Automaton
    poj 3101 Astronomy
    hdu 4282 A very hard mathematic problem
  • 原文地址:https://www.cnblogs.com/liujitao79/p/11870824.html
Copyright © 2011-2022 走看看