openstack平台搭建步骤 openstack搭建教程( 三 )


# su -s /bin/sh -c "glance-manage db_sync" glance8、启用和开机自启用
# systemctl enable openstack-glance-api.service openstack-glance-registry.service# systemctl start openstack-glance-api.service openstack-glance-registry.service9、载入上传image镜像
# mkdir /tmp/images# cd /tmp/images# wget http://cdn.download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img# glance image-create --name "cirros-0.3.3-x86_64" --file cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress# glance image-list# mv /tmp/images /opt五、增添一个计划节点
1、创造nova数据库和受权用户
mysql -u root -pCREATE DATABASE nova;GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova';2、创造Nova的用户,介入到admin组、service效劳
# keystone user-create --name nova --pass nova# keystone user-role-add --user nova --tenant service --role admin# keystone service-create --name nova --type compute --description "OpenStack Compute"3、创造计划节点的考察url
# keystone endpoint-create --service-id $(keystone service-list | awk '/ compute / {print $2}') --publicurl http://controller:8774/v2/%(tenant_id)s --internalurl http://controller:8774/v2/%(tenant_id)s --adminurl http://controller:8774/v2/%(tenant_id)s --region regionOne4、安置Nova包
# yum -y install openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient# yum -y install openstack-nova-compute sysfsutils5、窜改nova摆设文献
# cp /etc/nova/nova.conf /etc/nova/nova.conf.bak# vim /etc/nova/nova.conf[DEFAULT]my_ip = controllervncserver_listen = controllervncserver_proxyclient_address = controllerverbose = Truerpc_backend = rabbitrabbit_host = controllerrabbit_password = rabbitauth_strategy = keystonevnc_enabled = Truevncserver_listen = 0.0.0.0vncserver_proxyclient_address = controllernovncproxy_base_url = http://controller:6080/vnc_auto.html[database]connection = mysql://nova:nova@controller/nova[keystone_authtoken]auth_uri = http://controller:5000/v2.0identity_uri = http://controller:35357admin_tenant_name = serviceadmin_user = novaadmin_password = nova[glance]host = controller[libvirt]virt_type = qemu6、同步nova到moriadb数据库
# su -s /bin/sh -c "nova-manage db sync" nova7、启用稠密效劳开机自启用
# systemctl enable openstack-nova-api.service openstack-nova-cert.serviceopenstack-nova-consoleauth.service openstack-nova-scheduler.serviceopenstack-nova-conductor.service openstack-nova-novncproxy.service# systemctl start openstack-nova-api.service openstack-nova-cert.serviceopenstack-nova-consoleauth.service openstack-nova-scheduler.serviceopenstack-nova-conductor.service openstack-nova-novncproxy.service# systemctl enable libvirtd.service openstack-nova-compute.service# systemctl start libvirtd.service# systemctl start openstack-nova-compute.service# nova service-list# nova image-list六、增添一个搜集节点
1、创造neutron数据库和受权用户
mysql -u root -pCREATE DATABASE neutron;GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron';2、创造neutron用户,介入到admin组中,并创造neutron效劳
# keystone user-create --name neutron --pass neutron# keystone user-role-add --user neutron --tenant service --role admin# keystone service-create --name neutron --type network --description "OpenStack Networking"3、创造neutron的endponit考察url
# keystone endpoint-create --service-id $(keystone service-list | awk '/ image / {print $2}') --publicurl http://controller:5672 --internalurl http://controller:5672 --adminurl http://controller:5672 --region regionOne4、安置neutron包
# yum -y install openstack-neutron openstack-neutron-ml2 python-neutronclient which5、窜改neutron摆设文献
# cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak# vim /etc/neutron/neutron.conf [DEFAULT] rpc_backend = rabbitrabbit_host = controllerrabbit_password = rabbitauth_strategy = keystonecore_plugin = ml2service_plugins = routerallow_overlapping_ips = Truenotify_nova_on_port_status_changes = Truenotify_nova_on_port_data_changes = Truenova_url = http://controller:8774/v2nova_admin_auth_url = http://controller:35357/v2.0nova_region_name = regionOnenova_admin_username = novanova_admin_tenant_id = SERVICE_TENANT_IDnova_admin_password = novaverbose = True[database]connection = mysql://neutron:neutron@controller/neutron[keystone_authtoken]auth_uri = http://controller:5000/v2.0identity_uri = http://controller:35357admin_tenant_name = serviceadmin_user = neutronadmin_password = neutron6、尝试
# keystone tenant-get service# cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak# vim /etc/neutron/plugins/ml2/ml2_conf.ini[ml2]type_drivers = flat,gretenant_network_types = gremechani *** _drivers = openvswitch[ml2_type_gre] tunnel_id_ranges = 1:1000[securitygroup] enable_security_group = Trueenable_ipset = Truefirewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver# vim /etc/nova/nova.conf [DEFAULT]network_api_class = nova.network.neutronv2.api.APIsecurity_group_api = neutronlinuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriverfirewall_driver = nova.virt.firewall.NoopFirewallDriver[neutron]url = http://controller:9696auth_strategy = keystoneadmin_auth_url = http://controller:35357/v2.0admin_tenant_name = serviceadmin_username = neutronadmin_password = neutron# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini7、同步neutron到mariadb数据库

推荐阅读