##5.1 Nova控制节点
openstack pike 安装 目录汇总 http://www.cnblogs.com/elvi/p/7613861.html
##5.1 Nova控制节点 # controller 安装 #5.1.Nova-controller.sh #创建Nova数据库、用户、认证,前面已设置 source ./admin-openstack.sh || { echo "加载前面设置的admin-openstack.sh环境变量脚本";exit; } # keystone上服务注册 ,创建nova用户、服务、API # nova用户前面已建 openstack service create --name nova --description "OpenStack Compute" 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 #创建placement用户、服务、API openstack user create --domain default --password=placement placement openstack role add --project service --user placement admin openstack service create --name placement --description "Placement API" placement openstack endpoint create --region RegionOne placement public http://controller:8778 openstack endpoint create --region RegionOne placement internal http://controller:8778 openstack endpoint create --region RegionOne placement admin http://controller:8778 #openstack endpoint delete id? ## 安装nova控制节点 yum install -y openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api yum install -y openstack-utils # #nova控制节点配置 echo '# [DEFAULT] enabled_apis = osapi_compute,metadata transport_url = rabbit://openstack:openstack@controller my_ip = 10.2.1.20 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver [api_database] connection = mysql+pymysql://nova:nova@controller/nova_api [database] connection = mysql+pymysql://nova:nova@controller/nova [api] auth_strategy = keystone [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 [vnc] enabled = true vncserver_listen = $my_ip vncserver_proxyclient_address = $my_ip [glance] api_servers = http://controller: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://controller:35357/v3 username = placement password = placement [scheduler] discover_hosts_in_cells_interval = 300 #'>/etc/nova/nova.conf echo " #Placement API <Directory /usr/bin> <IfVersion >= 2.4> Require all granted </IfVersion> <IfVersion < 2.4> Order allow,deny Allow from all </IfVersion> </Directory> ">>/etc/httpd/conf.d/00-nova-placement-api.conf systemctl restart httpd sleep 2 #同步数据库 su -s /bin/sh -c "nova-manage api_db sync" nova su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova su -s /bin/sh -c "nova-manage db sync" nova #检测数据 nova-manage cell_v2 list_cells mysql -h controller -u nova -pnova -e "use nova_api;show tables;" mysql -h controller -u nova -pnova -e "use nova;show tables;" mysql -h controller -u nova -pnova -e "use nova_cell0;show tables;" #开机自启动 systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service #启动服务 systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service #查看节点 #nova service-list openstack catalog list nova-status upgrade check openstack compute service list #nova-manage cell_v2 delete_cell --cell_uuid b736f4f4-2a67-4e60-952a-14b5a68b0f79 # #发现计算节点,新增计算节点时执行 #su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova