openstack on centos 7.1(compute)

来源:互联网 发布:考试管理系统数据库 编辑:程序博客网 时间:2024/06/02 22:53

1.Install and configure controller node

Prerequisites

mysql -u root -p CREATE DATABASE nova_api;CREATE DATABASE nova;#Replace NOVA_DBPASS with a suitable passwordGRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
. admin-openrc
openstack user create --domain default --password-prompt novaopenstack role add --project service --user nova adminopenstack service create --name nova --description "OpenStack Compute" computeopenstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%\(tenant_id\)sopenstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)sopenstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)s

Install and configure components

yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler

/etc/nova/nova.conf

[DEFAULT]...enabled_apis = osapi_compute,metadatarpc_backend = rabbitauth_strategy = keystonemy_ip = 10.0.0.11 #IP address of the controller nodeuse_neutron = Truefirewall_driver = nova.virt.firewall.NoopFirewallDriver[api_database]...connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api  #Replace NOVA_DBPASS with the password you chose for the Compute databases[database]...connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova[oslo_messaging_rabbit]...rabbit_host = controllerrabbit_userid = openstackrabbit_password = RABBIT_PASS #Replace RABBIT_PASS with the password you chose for the openstack account in RabbitMQ[keystone_authtoken]...auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = novapassword = NOVA_PASS #Replace NOVA_PASS with the password you chose for the nova user in the Identity service[vnc]...vncserver_listen = $my_ipvncserver_proxyclient_address = $my_ip[glance]...api_servers = http://controller:9292[oslo_concurrency]...lock_path = /var/lib/nova/tmp
su -s /bin/sh -c "nova-manage api_db sync" novasu -s /bin/sh -c "nova-manage db sync" nova

Finalize installation

systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.servicesystemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

2.Install and configure a compute node

Install and configure components

yum install openstack-nova-compute

/etc/nova/nova.conf

[DEFAULT]...rpc_backend = rabbitauth_strategy = keystonemy_ip = MANAGEMENT_INTERFACE_IP_ADDRESS #Replace MANAGEMENT_INTERFACE_IP_ADDRESS with the IP address of the management network interface on your compute nodeuse_neutron = Truefirewall_driver = nova.virt.firewall.NoopFirewallDriver[oslo_messaging_rabbit]...rabbit_host = controllerrabbit_userid = openstackrabbit_password = RABBIT_PASS #Replace RABBIT_PASS with the password you chose for the openstack account in RabbitMQ[keystone_authtoken]...auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = novapassword = NOVA_PASS #Replace NOVA_PASS with the password you chose for the nova user in the Identity service[vnc]...enabled = Truevncserver_listen = 0.0.0.0vncserver_proxyclient_address = $my_ipnovncproxy_base_url = http://controller:6080/vnc_auto.html[glance]...api_servers = http://controller:9292[oslo_concurrency]...lock_path = /var/lib/nova/tmp
egrep -c '(vmx|svm)' /proc/cpuinfo#If this command returns a value of one or greater, your compute node supports hardware acceleration which typically requires no additional configuration#If this command returns a value of zero, your compute node does not support hardware acceleration and you must configure libvirt to use QEMU instead of KVM
systemctl enable libvirtd.service openstack-nova-compute.servicesystemctl enable libvirtd.service openstack-nova-compute.service
0 0