当前位置: 代码迷 >> 综合 >> 解读先电2.4 iaas-install-dashboard.sh 脚本
  详细解决方案

解读先电2.4 iaas-install-dashboard.sh 脚本

热度:37   发布时间:2023-11-25 10:59:33.0
#!/bin/bash
source /etc/xiandian/openrc.sh#dashboard install
yum install openstack-dashboard -y 
#/etc/openstack-dashboard/local_settings		# 修改本地设置sed -i -e "s/^ALLOWED_HOSTS.*/ALLOWED_HOSTS = ['*', 'two.example.com']/g" \								#配置允许所有主机都可以访问dashboard
-e 's/^OPENSTACK_HOST.*/OPENSTACK_HOST = "'$HOST_NAME'"/g' \											#配置dashboard使用控制节点上的OPENSTACK服务
-e 's/#OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT.*/OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True/g' \		#允许多域支持
-e 's/^OPENSTACK_KEYSTONE_URL .*/OPENSTACK_KEYSTONE_URL = "http:\/\/%s:5000\/v3" % OPENSTACK_HOST/g' \	#配置OPENSTACKKEYSTONE的网址
-e 's/#OPENSTACK_KEYSTONE_DEFAULT_DOMAIN.*/OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"/g' \			#配置在dashboard中创建的用户默认所使用的域为Default
-e 's/^OPENSTACK_KEYSTONE_DEFAULT_ROLE.*/OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"/g' /etc/openstack-dashboard/local_settings	#配置在dashboard中创建的用户默认所使用的角色为user
#配置memcached会话存储服务echo "SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
    'default': {
    'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache','LOCATION': '$HOST_NAME:11211',}
}
OPENSTACK_API_VERSIONS = {
    "\"identity"\": 3,"\"image"\": 2,"\"volume"\": 2,
}" >> /etc/openstack-dashboard/local_settings
#/etc/httpd/conf.d/openstack-dashboard.conf
sed -i -e 'N;4aWSGIApplicationGroup %{GLOBAL}' /etc/httpd/conf.d/openstack-dashboard.conf
systemctl restart httpd.service memcached.service
  相关解决方案