Liberty(controller)

来源:互联网 发布:js跨域请求有什么问题 编辑:程序博客网 时间:2024/06/05 05:39
cat >> /etc/hosts << OFF192.168.10.102    controller192.168.10.104    compute1OFFyum install -y python-openstackclient openstack-utils yum install -y openstack-selinuxyum install -y mariadb mariadb-server MySQL-python#########################################mysql################################################sed -i "/\[mysqld\]$/a character-set-server = utf8" /etc/my.cnfsed -i "/\[mysqld\]$/a init-connect = 'SET NAMES utf8'" /etc/my.cnfsed -i "/\[mysqld\]$/a collation-server = utf8_general_ci" /etc/my.cnfsed -i "/\[mysqld\]$/a innodb_file_per_table" /etc/my.cnfsed -i "/\[mysqld\]$/a default-storage-engine = innodb" /etc/my.cnfsed -i "/\[mysqld\]$/a bind-address = 192.168.10.102" /etc/my.cnfsystemctl enable mariadb.servicesystemctl start mariadb.serviceyum install -y mongodb-server mongodbsed -i "s/bind_ip = 127.0.0.1/bind_ip = 192.168.10.102/" /etc/mongod.conf sed -i "s/#smallfiles = true/smallfiles = true/" /etc/mongod.confsystemctl enable mongod.servicesystemctl start mongod.servicemysql_secure_installation#########################################rabbitmq#############################################yum install -y rabbitmq-serversystemctl enable rabbitmq-server.servicesystemctl restart rabbitmq-server.servicerabbitmqctl add_user openstack openstackrabbitmqctl set_permissions openstack ".*" ".*" ".*"#########################################keystone#############################################mysql -e "CREATE DATABASE keystone;"mysql -e "GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';"mysql -e "GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';"yum install -y openstack-keystone httpd mod_wsgi memcached python-memcachedsystemctl enable memcached.servicesystemctl start memcached.serviceopenstack-config --set /etc/keystone/keystone.conf DEFAULT admin_token 9776252a40ab6d597ae1openstack-config --set /etc/keystone/keystone.conf database connection mysql://keystone:keystone@192.168.10.102/keystoneopenstack-config --set /etc/keystone/keystone.conf memcache servers localhost:11211openstack-config --set /etc/keystone/keystone.conf token provider uuidopenstack-config --set /etc/keystone/keystone.conf token driver memcacheopenstack-config --set /etc/keystone/keystone.conf revoke driver sqlopenstack-config --set /etc/keystone/keystone.conf DEFAULT verbose Truesu -s /bin/sh -c "keystone-manage db_sync" keystonesed -i "s/#ServerName www.example.com:80/ServerName controller/" /etc/httpd/conf/httpd.confcat > /etc/httpd/conf.d/wsgi-keystone.conf << OFFListen 5000Listen 35357<VirtualHost *:5000>    WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}    WSGIProcessGroup keystone-public    WSGIScriptAlias / /usr/bin/keystone-wsgi-public    WSGIApplicationGroup %{GLOBAL}    WSGIPassAuthorization On    <IfVersion >= 2.4>      ErrorLogFormat "%{cu}t %M"    </IfVersion>    ErrorLog /var/log/httpd/keystone-error.log    CustomLog /var/log/httpd/keystone-access.log combined    <Directory /usr/bin>        <IfVersion >= 2.4>            Require all granted        </IfVersion>        <IfVersion < 2.4>            Order allow,deny            Allow from all        </IfVersion>    </Directory></VirtualHost><VirtualHost *:35357>    WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}    WSGIProcessGroup keystone-admin    WSGIScriptAlias / /usr/bin/keystone-wsgi-admin    WSGIApplicationGroup %{GLOBAL}    WSGIPassAuthorization On    <IfVersion >= 2.4>      ErrorLogFormat "%{cu}t %M"    </IfVersion>    ErrorLog /var/log/httpd/keystone-error.log    CustomLog /var/log/httpd/keystone-access.log combined    <Directory /usr/bin>        <IfVersion >= 2.4>            Require all granted        </IfVersion>        <IfVersion < 2.4>            Order allow,deny            Allow from all        </IfVersion>    </Directory></VirtualHost>OFFsystemctl enable httpd.servicesystemctl start httpd.serviceexport OS_TOKEN=9776252a40ab6d597ae1export OS_URL=http://controller:35357/v3export OS_IDENTITY_API_VERSION=3openstack service create --name keystone --description "OpenStack Identity" identityopenstack endpoint create --region RegionOne identity public http://controller:5000/v2.0openstack endpoint create --region RegionOne identity internal http://controller:5000/v2.0openstack endpoint create --region RegionOne identity admin http://controller:35357/v2.0openstack project create --domain default --description "Admin Project" adminopenstack user create --domain default --password-prompt adminopenstack role create adminopenstack role add --project admin --user admin adminopenstack project create --domain default --description "Service Project" serviceopenstack project create --domain default --description "Demo Project" demoopenstack user create --domain default --password-prompt demoopenstack role create useropenstack role add --project demo --user demo usercat > /root/admin-openrc.sh << OFFexport OS_PROJECT_DOMAIN_ID=defaultexport OS_USER_DOMAIN_ID=defaultexport OS_PROJECT_NAME=adminexport OS_TENANT_NAME=adminexport OS_USERNAME=adminexport OS_PASSWORD=keystoneexport OS_AUTH_URL=http://controller:35357/v3export OS_IDENTITY_API_VERSION=3OFFcat > /root/demo-openrc.sh << OFFexport OS_PROJECT_DOMAIN_ID=defaultexport OS_USER_DOMAIN_ID=defaultexport OS_PROJECT_NAME=demoexport OS_TENANT_NAME=demoexport OS_USERNAME=demoexport OS_PASSWORD=demoexport OS_AUTH_URL=http://controller:5000/v3export OS_IDENTITY_API_VERSION=3OFFsource admin-openrc.shopenstack token issue#########################################glance#############################################mysql -e  "CREATE DATABASE glance;"mysql -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'glance';"mysql -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glance';"source admin-openrc.shopenstack user create --domain default --password-prompt glanceopenstack role add --project service --user glance adminopenstack service create --name glance --description "OpenStack Image service" imageopenstack endpoint create --region RegionOne image public http://controller:9292openstack endpoint create --region RegionOne image internal http://controller:9292openstack endpoint create --region RegionOne image admin http://controller:9292yum install -y openstack-glance python-glance python-glanceclientopenstack-config --set /etc/glance/glance-api.conf database  connection mysql://glance:glance@controller/glanceopenstack-config --set /etc/glance/glance-api.conf keystone_authtoken  auth_uri http://controller:5000openstack-config --set /etc/glance/glance-api.conf keystone_authtoken  auth_url http://controller:35357openstack-config --set /etc/glance/glance-api.conf keystone_authtoken  auth_plugin  passwordopenstack-config --set /etc/glance/glance-api.conf keystone_authtoken  project_domain_id  defaultopenstack-config --set /etc/glance/glance-api.conf keystone_authtoken  user_domain_id defaultopenstack-config --set /etc/glance/glance-api.conf keystone_authtoken  project_name serviceopenstack-config --set /etc/glance/glance-api.conf keystone_authtoken  username glanceopenstack-config --set /etc/glance/glance-api.conf keystone_authtoken  password  glanceopenstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystoneopenstack-config --set /etc/glance/glance-api.conf glance_store default_store fileopenstack-config --set /etc/glance/glance-api.conf glance_store filesystem_store_datadir /var/lib/glance/images/openstack-config --set /etc/glance/glance-api.conf DEFAULT notification_driver noopopenstack-config --set /etc/glance/glance-api.conf DEFAULT verbose Trueopenstack-config --set /etc/glance/glance-registry.conf database connection mysql://glance:glance@controller/glanceopenstack-config --set /etc/glance/glance-registry.conf keystone_authtoken  auth_uri http://controller:5000openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken  auth_url http://controller:35357openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken  auth_plugin  passwordopenstack-config --set /etc/glance/glance-registry.conf keystone_authtoken  project_domain_id  defaultopenstack-config --set /etc/glance/glance-registry.conf keystone_authtoken  user_domain_id defaultopenstack-config --set /etc/glance/glance-registry.conf keystone_authtoken  project_name serviceopenstack-config --set /etc/glance/glance-registry.conf keystone_authtoken  username glanceopenstack-config --set /etc/glance/glance-registry.conf keystone_authtoken  password  glanceopenstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystoneopenstack-config --set /etc/glance/glance-registry.conf DEFAULT notification_driver noopopenstack-config --set /etc/glance/glance-registry.conf DEFAULT verbose Truesu -s /bin/sh -c "glance-manage db_sync" glance  systemctl enable openstack-glance-api.service openstack-glance-registry.servicesystemctl start openstack-glance-api.service openstack-glance-registry.serviceecho "export OS_IMAGE_API_VERSION=2" | tee -a admin-openrc.sh demo-openrc.shsource admin-openrc.shwget http://192.168.10.202/cirros-0.3.4-x86_64-disk.imgglance image-create --name "cirros" \--file cirros-0.3.4-x86_64-disk.img \--disk-format qcow2 --container-format bare \--visibility public --progressglance image-list#########################################nova#############################################mysql -e "CREATE DATABASE nova;"mysql -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';"mysql -e "GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova';"source admin-openrc.shopenstack user create --domain default --password-prompt nova openstack role add --project service --user nova admin openstack service create --name nova --description "OpenStack Compute" computeopenstack endpoint create --region RegionOne compute public http://controller:8774/v2/%\(tenant_id\)sopenstack endpoint create --region RegionOne compute internal http://controller:8774/v2/%\(tenant_id\)sopenstack endpoint create --region RegionOne compute admin http://controller:8774/v2/%\(tenant_id\)syum install -y openstack-nova-api openstack-nova-cert \openstack-nova-conductor openstack-nova-console \openstack-nova-novncproxy openstack-nova-scheduler \python-novaclientopenstack-config --set /etc/nova/nova.conf database connection mysql://nova:nova@controller/novaopenstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbitopenstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host controlleropenstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid openstackopenstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password openstackopenstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystoneopenstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:35357openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_plugin passwordopenstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_id defaultopenstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_id defaultopenstack-config --set /etc/nova/nova.conf keystone_authtoken project_name serviceopenstack-config --set /etc/nova/nova.conf keystone_authtoken username novaopenstack-config --set /etc/nova/nova.conf keystone_authtoken password novaopenstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.10.102openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.APIopenstack-config --set /etc/nova/nova.conf DEFAULT security_group_api neutronopenstack-config --set /etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net.NeutronLinuxBridgeInterfaceDriveropenstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriveropenstack-config --set /etc/nova/nova.conf vnc vncserver_listen 192.168.10.102openstack-config --set /etc/nova/nova.conf vnc vncserver_proxyclient_address 192.168.10.102openstack-config --set /etc/nova/nova.conf glance host controlleropenstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmpopenstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadataopenstack-config --set /etc/nova/nova.conf DEFAULT verbose True su -s /bin/sh -c "nova-manage db sync" nova   systemctl enable openstack-nova-api.service \openstack-nova-cert.service openstack-nova-consoleauth.service \openstack-nova-scheduler.service openstack-nova-conductor.service \openstack-nova-novncproxy.servicesystemctl start openstack-nova-api.service \openstack-nova-cert.service openstack-nova-consoleauth.service \openstack-nova-scheduler.service openstack-nova-conductor.service \openstack-nova-novncproxy.service#########################################neutron network#############################################mysql -e "CREATE DATABASE neutron;"mysql -e "GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';"mysql -e "GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron';"source admin-openrc.shopenstack user create --domain default --password-prompt neutronopenstack role add --project service --user neutron adminopenstack service create --name neutron --description "OpenStack Networking" networkopenstack endpoint create --region RegionOne network public http://controller:9696openstack endpoint create --region RegionOne network internal http://controller:9696openstack endpoint create --region RegionOne network admin http://controller:9696###########第一种网络####################yum -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclient ebtables ipsetopenstack-config --set /etc/neutron/neutron.conf database connection mysql://neutron:neutron@controller/neutronopenstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin ml2openstack-config --set /etc/neutron/neutron.conf DEFAULT service_pluginsopenstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbitopenstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_host controlleropenstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_userid openstackopenstack-config --set /etc/neutron/neutron.conf oslo_messaging_rabbit rabbit_password openstackopenstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystoneopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://controller:5000openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://controller:35357openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_plugin passwordopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_id defaultopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_id defaultopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name serviceopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutronopenstack-config --set /etc/neutron/neutron.conf keystone_authtoken password neutronopenstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_status_changes Trueopenstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_data_changes Trueopenstack-config --set /etc/neutron/neutron.conf DEFAULT nova_url http://controller:8774/v2openstack-config --set /etc/neutron/neutron.conf nova auth_url http://controller:35357openstack-config --set /etc/neutron/neutron.conf nova auth_plugin passwordopenstack-config --set /etc/neutron/neutron.conf nova project_domain_id defaultopenstack-config --set /etc/neutron/neutron.conf nova user_domain_id defaultopenstack-config --set /etc/neutron/neutron.conf nova region_name RegionOneopenstack-config --set /etc/neutron/neutron.conf nova project_name serviceopenstack-config --set /etc/neutron/neutron.conf nova username novaopenstack-config --set /etc/neutron/neutron.conf nova password novaopenstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmpopenstack-config --set /etc/neutron/neutron.conf DEFAULT verbose True openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers flat,vlanopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_typesopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers linuxbridgeopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers port_securityopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks publicopenstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset  Trueopenstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings public:enp8s0openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan  Falseopenstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini agent prevent_arp_spoofing Trueopenstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group Trueopenstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriveropenstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriveropenstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dhcp_driver neutron.agent.linux.dhcp.Dnsmasqopenstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT enable_isolated_metadata Trueopenstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT verbose True##########完成neutron安装#################openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_uri http://controller:5000openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_url http://controller:35357  openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_region RegionOne  openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT auth_plugin password  openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT project_domain_id  defaultopenstack-config --set /etc/neutron/metadata_agent.ini DEFAULT user_domain_id defaultopenstack-config --set /etc/neutron/metadata_agent.ini DEFAULT project_name  service openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT username  neutronopenstack-config --set /etc/neutron/metadata_agent.ini DEFAULT password  neutronopenstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_ip  controller openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret neutron openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT verbose  Trueopenstack-config --set /etc/nova/nova.conf neutron url http://controller:9696 openstack-config --set /etc/nova/nova.conf neutron auth_url http://controller:35357 openstack-config --set /etc/nova/nova.conf neutron auth_plugin passwordopenstack-config --set /etc/nova/nova.conf neutron project_domain_id  defaultopenstack-config --set /etc/nova/nova.conf neutron user_domain_id  defaultopenstack-config --set /etc/nova/nova.conf neutron region_name RegionOneopenstack-config --set /etc/nova/nova.conf neutron project_name service openstack-config --set /etc/nova/nova.conf neutron username neutron openstack-config --set /etc/nova/nova.conf neutron password neutron openstack-config --set /etc/nova/nova.conf neutron service_metadata_proxy  Trueopenstack-config --set /etc/nova/nova.conf neutron metadata_proxy_shared_secret  neutronln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.inisu -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \--config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutronsystemctl restart openstack-nova-api.servicesystemctl enable neutron-server.service \neutron-linuxbridge-agent.service neutron-dhcp-agent.service \neutron-metadata-agent.servicesystemctl start neutron-server.service \neutron-linuxbridge-agent.service neutron-dhcp-agent.service \neutron-metadata-agent.servicesystemctl enable neutron-l3-agent.servicesystemctl restart neutron-l3-agent.service#########################################dashboard#############################################yum install -y openstack-dashboard 修改 /etc/openstack-dashboard/local_setingsOPENSTACK_HOST = "controller"ALLOWED_HOSTS = ['*', ]CACHES = {    'default': {         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',         'LOCATION': '127.0.0.1:11211',    }}OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"TIME_ZONE = "Asia/Shanghai"systemctl enable httpd.service memcached.servicesystemctl restart httpd.service memcached.service
0 0