1、(3)编辑文件/etc/mysql/f,添加以下内容vim /etc/mysql/fbind-address = 0.0.0.0mysqld.collation-server = utf8_general_ciinit-connect = SET NAMES utf8character-set-server = utf8(4)重启MySQL serviceservice mysql restart(5)安装其它服务包apt-get install -y ntp vlan bridge-utils(6)编辑文件/etc/sysctl.conf添加以下内容vim /etc/sysctl.confn
2、et.ipv4.ip_forward=1net.ipv4.conf.all.rp_filter=0net.ipv4.conf.default.rp_filter=0(7)加载上一步修改的值sysctl pkeystone (8)安装keystoneapt-get install -y keystone(9)创建名为keystone的数据库并添加信任权限mysql -u root -pCREATE DATABASE keystone;GRANT ALL PRIVILEGES ON keystone.* TO keystone% IDENTIFIED BY keystone_dbpassquit(
3、10)编辑文件/etc/keystone/keystone.conf 把下面这行vim /etc/keystone/keystone.confconnection = sqlite:/var/lib/keystone/keystone.db替换成:connection = mysql:/keystone:keystone_dbpassopenstack/keystone(11)重启keystone service并同步数据库service keystone restartkeystone-manage db_sync(12)输入下面环境变量来初始化keystone命令export OS_SER
4、VICE_TOKEN=ADMINexport OS_SERVICE_ENDPOINT=http:/172.24.54.88:35357/v2.0(13)创建admin user, admin tenant, admin role and service tenant. Also add admin user to admin tenant and admin role.keystone tenant-create -name=admin -description=Admin Tenantkeystone tenant-create -name=service -description=Serv
5、ice Tenantkeystone user-create -name=admin -pass=ADMIN -email=adminkeystone role-create -name=adminkeystone user-role-add -user=admin -tenant=admin -role=admin(14)创建keystone servicekeystone service-create -name=keystone -type=identity -description=Keystone Identity Service”(15)创建keystone端点keystone e
6、ndpoint-create -service=keystone -publicurl=http:5000/v2.0 -internalurl=http:5000/v2.0 -adminurl=http:(16)删除环境变量unset OS_SERVICE_TOKENunset OS_SERVICE_ENDPOINT(17)新建一个文件取名为creds并添加以下内容:export OS_USERNAME=adminexport OS_PASSWORD=ADMINexport OS_TENANT_NAME=adminexport OS_AUTH_URL=http:(18)启用环境变量source
7、 creds(19)测试keysonekeystone token-getkeystone user-listGlance (Image Store)(20)安装Glanceapt-get install -y glance(21)创建数据库Glance,并为Glance授权CREATE DATABASE glance;GRANT ALL ON glance.* TO glanceglance_dbpassquit;(22)创建glance以及相关的keystone入口:keystone user-create -name=glance -pass=glance_pass -email=gla
8、ncekeystone user-role-add -user=glance -tenant=service -role=adminkeystone service-create -name=glance -type=image -description=Glance Image Servicekeystone endpoint-create -service=glance -publicurl=http:9292 -internalurl=http:9292 -adminurl=http:9292(23)编辑文件/etc/glance/glance-api.conf添加以下内容注释掉# sq
9、lite_db = /var/lib/glance/glance.sqlite/glance:glance_dbpassopenstack/glancekeystone_authtokenauth_host = 172.24.54.88auth_port = 5000auth_protocol = httpadmin_tenant_name = serviceadmin_user = glanceadmin_password = glance_passpaste_deployflavor = keystone(24)编辑文件/etc/glance/glance-registry.conf修改以
10、下内容vim /etc/glance/glance-registry.conf# sqlite_db = /var/lib/glance/glance.sqlite(25)重启 Glance servicesservice glance-api restartservice glance-registry restart(26)同步databaseglance-manage db_sync(27)下载一个用于测试的imageglance image-create -name cirros-0.3.2-x86_64 -is-public true -container-format bare -
11、disk-format qcow2 -location http:/cdn.download.cirros-glance image-listcompute Service (Nova)(28)安装nova包:apt-get install -y nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy nova-scheduler python-novaclient nova-compute nova-console(29)创建数据库并给Nova授权CREATE DATABASE nova;GRANT ALL PRI
12、VILEGES ON nova.* TO novanova_dbpass(30)为Nova创建Keystone 入口keystone user-create -name=nova -pass=nova_pass -email=novakeystone user-role-add -user=nova -tenant=service -role=adminkeystone service-create -name=nova -type=compute -description=OpenStack Computekeystone endpoint-create -service=nova -pub
13、licurl=http:8774/v2/%(tenant_id)s -internalurl=http:8774/v2/%(tenant_id)s -adminurl=http:8774/v2/%(tenant_id)s(31)打开文件并编辑如下vim /etc/nova/nova.confDEFAULTlogdir=/var/log/novastate_path=/var/lib/novalock_path=/var/lock/novaforce_dhcp_release=Trueiscsi_helper=tgtadmlibvirt_use_virtio_for_bridges=Trueco
14、nnection_type=libvirtroot_helper=sudo nova-rootwrap /etc/nova/rootwrap.confverbose=Truerpc_backend = nova.rpc.impl_komburabbit_host = 172.24.54.88my_ip = 172.24.54.88vncserver_listen = 172.24.54.88vncserver_proxyclient_address = 172.24.54.88novncproxy_base_url=http:6080/vnc_auto.htmlglance_host = 17
15、2.24.54.88auth_strategy=keystonenetwork_api_class=work.neutronv2.api.APIneutron_url=http:9696neutron_auth_strategy=keystoneneutron_admin_tenant_name=serviceneutron_admin_username=neutronneutron_admin_password=neutron_passneutron_metadata_proxy_shared_secret=openstackneutron_admin_auth_url=http:linux
16、net_interface_driver = work.linux_net.LinuxOVSInterfaceDriverfirewall_driver=nova.virt.firewall.NoopFirewallDriversecurity_group_api=neutronvif_plugging_is_fatal: falsevif_plugging_timeout: 0database/nova:nova_dbpassopenstack/novaauth_uri = http:5000auth_port = 35357admin_user = novaadmin_password =
17、 nova_pass(32)同步Nova dbnova-manage db sync(33)重启所有的nova服务service nova-api restart ;service nova-cert restart; service nova-consoleauth restart ;service nova-scheduler restart;service nova-conductor restart; service nova-novncproxy restart; service nova-compute restart(34)测试Nova,笑脸:-)表示正常nova-manage
18、service listNeutron(Networking service)(35)安装Neutron servicesapt-get install -y neutron-server neutron-common neutron-plugin-ml2 neutron-plugin-openvswitch-agent dnsmasq neutron-l3-agent neutron-dhcp-agent(36)安装数据库并为Neutron提供认证服务CREATE DATABASE neutron;GRANT ALL ON neutron.* TO neutronneutron_dbpass
19、(36)为Neutron创建Keystone入口keystone user-create -name=neutron -pass=neutron_pass -email=neutronkeystone service-create -name=neutron -type=network -description=OpenStack Networkingkeystone user-role-add -user=neutron -tenant=service -role=adminkeystone endpoint-create -service=neutron -publicurl http:9
20、696 -adminurl http:9696 -internalurl http:(37)修改文件vim /etc/neutron/neutron.confcore_plugin = ml2notification_driver=mon.notifier.rpc_notifierrabbit_host=172.24.54.88rpc_backend=mon.rpc.impl_kombuservice_plugins=routerallow_overlapping_ips=Trueservice_neutron_metadata_proxy=Truenova_admin_password=no
21、va_passnotify_nova_on_port_data_changes=Truenotify_nova_on_port_status_changes=Truenova_admin_auth_url=http:nova_admin_tenant_id=servicenova_url=http:8774/v2nova_admin_username=novaadmin_user = neutronadmin_password = neutron_passsigning_dir = $state_path/keystone-signingrpc_backend = mon.rpc.impl_k
22、omburabbit_port = 5672notify_nova_on_port_status_changes = Truenotify_nova_on_port_data_changes = Truenova_url = http:8774nova_admin_username = nova# Replace the SERVICE_TENANT_ID with the output of this command (keystone tenant-list | awk / service / print $2 )nova_admin_tenant_id = be37106f31924f7
23、390e042de3124cc2d(把ID粘贴到这里)nova_admin_password = nova_passnova_admin_auth_url = http:/neutron:neutron_dbpass172.24.54.88/neutronagentroot_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf(38)打开文件,作出如下修改vim /etc/neutron/plugins/ml2/ml2_conf.ini ml2type_drivers=flat,vlantenant_network
24、_types=vlan,flatmechanism_drivers=openvswitchml2_type_flatflat_networks=Externalml2_type_vlannetwork_vlan_ranges=Intnet1:100:200ml2_type_greml2_type_vxlansecuritygroupfirewall_driver=neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriverenable_security_group=Trueovsbridge_mappings=External:br-ex,Intnet1:br-eth1(39)现在创建网桥,需要两块网卡ovs-vsctl add-br br-intovs-vsctl add-br br-eth1ovs-vsctl add-br br-exovs-vsctl add-port br-eth1 eth1ovs-vsctl add-port br-ex et
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1