zoukankan      html  css  js  c++  java
  • onva控制节点部署

    第一步:创建nova的库
    [root@zxw6 ~]# mysql -uroot -p123
    create database nova_api;


    create database nova;


    create database nova_cell0;

    第二步:给予权限设置远程登录
    MariaDB [mysql]> grant all on nova_api.* to 'nova'@'localhost' identified by 'zxw6';
    Query OK, 0 rows affected (0.01 sec)
    MariaDB [mysql]> grant all on nova_api.* to 'nova'@'%' identified by 'zxw6';
    Query OK, 0 rows affected (0.00 sec)


    MariaDB [mysql]> grant all on nova.* to 'nova'@'%' identified by 'zxw6';
    Query OK, 0 rows affected (0.00 sec)
    MariaDB [mysql]> grant all on nova.* to 'nova'@'localhost' identified by 'zxw6';
    Query OK, 0 rows affected (0.00 sec)


    MariaDB [mysql]> grant all on nova_cell0.* to 'nova'@'localhost' identified by 'zxxw6';
    Query OK, 0 rows affected (0.00 sec)
    MariaDB [mysql]> grant all on nova_cell0.* to 'nova'@'%' identified by 'zxw6';
    Query OK, 0 rows affected (0.00 sec)


    登录到openstack
    source openrc
    第三步:创建nova用户
    [root@zxw6 ~]# openstack user create --domain default --password=zxw6 nova

    第四步:在service项目把nova用户添加到admin角色
    [root@zxw6 ~]# openstack role add --project service --user nova admin


    第五步:创建服务
    [root@zxw6 ~]# openstack service create --name nova
    --description "OpenStack Compute" compute


    第六步:创建服务端点
    [root@zxw6 ~]# openstack endpoint create --region RegionOne compute public http://zxw6:8774/v2.1

    [root@zxw6 ~]# openstack endpoint create --region RegionOne compute internal http://zxw6:8774/v2.1


    [root@zxw6 ~]# openstack endpoint create --region RegionOne
    compute admin http://zxw6:8774/v2.1

    第七步:创建用户placement (检查资源)
    [root@zxw6 ~]# openstack user create --domain default --password=zxw6 placement


    第八步:在service项目把placement用户添加到admin角色
    [root@zxw6 ~]# openstack role add --project service --user placement admin

     

    第九步:创建服务
    [root@zxw6 ~]# openstack service create --name placement --description "Placement API" placement


    第十步:创建端点服务
    [root@zxw6 ~]# openstack endpoint create --region RegionOne placement public http://zxw6:8778

    [root@zxw6 ~]# openstack endpoint create --region RegionOne placement internal http://zxw6:8778

    [root@zxw6 ~]# openstack endpoint create --region RegionOne placement admin http://zxw6:8778


    第十一步:安装nova软件包

    [root@zxw6 ~]# yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api -y

    第十二步:编辑nova配置文件
    [root@zxw6 ~]# vim /etc/nova/nova.conf

    [DEFAULT]
    enabled_apis = osapi_compute,metadata
    transport_url = rabbit://openstack:zxw6@zxw6 传输协议
    my_ip = 192.168.126.6 节点ip
    use_neutron = True 使用网络组件
    firewall_driver = nova.virt.firewall.NoopFirewallDriver 开启防火墙的驱动


    [api_database]
    connection = mysql+pymysql://nova:zxw6@zxw6/nova_api api数据库的链接

    [database]
    connection = mysql+pymysql://nova:zxw6@zxw6/nova nova数据库的链接

    [api]
    auth_strategy = keystone 认证方式

    [keystone_authtoken]
    auth_uri = http://zxw6:5000
    auth_url = http://zxw6:35357
    memcached_servers = zxw6:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project_name = service
    username = nova
    password = zxw6


    [vnc]
    enabled = true 开启vnc
    vncserver_listen = $my_ipvncserver_proxyclient_address = $my_ip
    vncserver_proxyclient_address = $my_ip 监听变量

    [glance]
    api_servers = http://zxw6:9292 镜像地址

    [oslo_concurrency]
    lock_path = /var/lib/nova/tmp 零时文件保存目录


    [placement]
    os_region_name = RegionOne 工作域
    project_domain_name = Default 域
    project_name = service 工作项目
    auth_type = password 认证方式
    user_domain_name = Default
    auth_url = http://zxw6:35357/v3 认证路径
    username = placement
    password = zxw6


    第十三步:编辑配置文件httpd
    [root@zxw6 ~]# vim /etc/httpd/conf.d/00-nova-placement-api.conf
    <Directory /usr/bin>
    <IfVersion >= 2.4>
    Require all granted
    </IfVersion>
    <IfVersion < 2.4>
    Order allow,deny
    Allow from all
    </IfVersion>
    </Directory>


    第十四步:重启http服务
    [root@zxw6 ~]# systemctl restart httpd


    第十五步:导入nova_api的库
    [root@zxw6 ~]# su -s /bin/sh -c "nova-manage api_db sync" nova


    第十六步:导入nova_cell0的库
    [root@zxw6 ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
    认证
    [root@zxw6 ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
    6db3fa34-9498-4b1f-8042-90bba954fa48


    第十七步:同步nova的库
    root@zxw6 ~]# su -s /bin/sh -c "nova-manage db sync" nova


    第十八步:查看cell的列表
    [root@zxw6 ~]# nova-manage cell_v2 list_cells

    +-------+--------------------------------------+
    | Name | UUID |
    +-------+--------------------------------------+
    | cell0 | 00000000-0000-0000-0000-000000000000 |
    | cell1 | 6db3fa34-9498-4b1f-8042-90bba954fa48 |
    +-------+--------------------------------------+


    第十九步:从其nova所有的服务并开机自启
    [root@zxw6 ~]# systemctl start openstack-nova-api.service
    openstack-nova-consoleauth.service openstack-nova-scheduler.service
    openstack-nova-conductor.service openstack-nova-novncproxy.service

    [root@zxw6 ~]# systemctl enable openstack-nova-api.service
    openstack-nova-consoleauth.service openstack-nova-scheduler.service
    openstack-nova-conductor.service openstack-nova-novncproxy.service

    [root@zxw6 ~]# systemctl status openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service | grep active
    Active: active (running) since 三 2019-07-31 18:25:03 CST; 9min ago
    Active: active (running) since 三 2019-07-31 18:25:00 CST; 9min ago
    Active: active (running) since 三 2019-07-31 18:25:01 CST; 9min ago
    Active: active (running) since 三 2019-07-31 18:25:00 CST; 9min ago
    Active: active (running) since 三 2019-07-31 18:24:54 CST; 9min ago


    openstack-nova-api.service 负责接收和响应客户
    openstack-nova-consoleauth.service 负责对访问虚拟机控制台提供token认证
    openstack-nova-scheduler.service 负责访问调度器
    openstack-nova-conductor.service 负责访问数据库
    openstack-nova-novncproxy.service 负责web浏览器vnc的访问

    root@zxw6 ~]# nova service-list
    +----+------------------+------+----------+---------+-------+----------------------------+-----------------+
    | Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
    +----+------------------+------+----------+---------+-------+----------------------------+-----------------+
    | 1 | nova-scheduler | zxw6 | internal | enabled | up | 2019-07-31T11:42:14.000000 | - |
    | 2 | nova-conductor | zxw6 | internal | enabled | up | 2019-07-31T11:42:13.000000 | - |
    | 3 | nova-consoleauth | zxw6 | internal | enabled | up | 2019-07-31T11:42:04.000000 | - |
    +----+------------------+------+----------+---------+-------+----------------------------+-----------------+
    [root@zxw6 ~]# openstack compute service list
    +----+--------------+------+----------+---------+-------+--------------+
    | ID | Binary | Host | Zone | Status | State | Updated At |
    +----+--------------+------+----------+---------+-------+--------------+
    | 1 | nova- | zxw6 | internal | enabled | up | 2019-07-31T1 |
    | | scheduler | | | | | 1:43:04.0000 |
    | | | | | | | 00 |
    | 2 | nova- | zxw6 | internal | enabled | up | 2019-07-31T1 |
    | | conductor | | | | | 1:43:03.0000 |
    | | | | | | | 00 |
    | 3 | nova- | zxw6 | internal | enabled | up | 2019-07-31T1 |
    | | consoleauth | | | | | 1:43:04.0000 |
    | | | | | | | 00 |
    +----+--------------+------+----------+---------+-------+--------------+

     

    [DEFAULT]
    my_ip=172.16.254.63
    use_neutron = True
    firewall_driver = nova.virt.firewall.NoopFirewallDriver
    enabled_apis=osapi_compute,metadata
    transport_url = rabbit://openstack:admin@controller
     
    [api]
    auth_strategy = keystone
     
    [api_database]
    connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api
     
    [barbican]
     
    [cache]
     
    [cells]
     
    [cinder]
    os_region_name = RegionOne
     
    [cloudpipe]
     
    [conductor]
     
    [console]
     
    [consoleauth]
     
    [cors]
     
    [cors.subdomain]
     
    [crypto]
     
    [database]
    connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
     
    [ephemeral_storage_encryption]
     
    [filter_scheduler]
     
    [glance]
    api_servers = http://controller:9292
     
    [guestfs]
     
    [healthcheck]
     
    [hyperv]
     
    [image_file_url]
     
    [ironic]
     
    [key_manager]
     
    [keystone_authtoken]
    auth_uri = http://controller:5000
    auth_url = http://controller:35357
    memcached_servers = controller:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project_name = service
    username = nova
    password = nova
     
    [libvirt]
    virt_type=qemu
     
    [matchmaker_redis]
     
    [metrics]
     
    [mks]
     
    [neutron]
    url = http://controller:9696
    auth_url = http://controller:35357
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    region_name = RegionOne
    project_name = service
    username = neutron
    password = neutron
    service_metadata_proxy = true
    metadata_proxy_shared_secret = METADATA_SECRET
     
    [notifications]
     
    [osapi_v21]
     
    [oslo_concurrency]
    lock_path=/var/lib/nova/tmp
     
    [oslo_messaging_amqp]
     
    [oslo_messaging_kafka]
     
    [oslo_messaging_notifications]
     
    [oslo_messaging_rabbit]
     
    [oslo_messaging_zmq]
     
    [oslo_middleware]
     
    [oslo_policy]
     
    [pci]
    [placement]
    os_region_name = RegionOne
    auth_type = password
    auth_url = http://controller:35357/v3
    project_name = service
    project_domain_name = Default
    username = placement
    password = placement
    user_domain_name = Default
     
    [quota]
     
    [rdp]
     
    [remote_debug]
     
    [scheduler]
     
    [serial_console]
     
    [service_user]
     
    [spice]
     
    [ssl]
     
    [trusted_computing]
     
    [upgrade_levels]
     
    [vendordata_dynamic_auth]
     
    [vmware]
     
    [vnc]
    enabled=true
    vncserver_listen=$my_ip
    vncserver_proxyclient_address=$my_ip
    novncproxy_base_url = http://172.16.254.63:6080/vnc_auto.html
     
    [workarounds]
     
    [wsgi]
     
    [xenserver]
     
    [xvp]

     

  • 相关阅读:
    Java实现 LeetCode 802 找到最终的安全状态 (DFS)
    Java实现 LeetCode 802 找到最终的安全状态 (DFS)
    Java实现 LeetCode 802 找到最终的安全状态 (DFS)
    Java实现 LeetCode 804 唯一摩尔斯密码词 (暴力)
    Java实现 LeetCode 803 打砖块 (DFS)
    Java实现 LeetCode 804 唯一摩尔斯密码词 (暴力)
    Java实现 LeetCode 803 打砖块 (DFS)
    Java实现 LeetCode 804 唯一摩尔斯密码词 (暴力)
    英文标点
    post sharp 与log4net 结合使用,含执行源码 转拷
  • 原文地址:https://www.cnblogs.com/itzhao/p/11335558.html
Copyright © 2011-2022 走看看