openstack安装配置—— dnshboard安装配置

    做为专业运维人员,使用命令行工具去管理云主机是没有问题的,但如果云要提供给客户使用,就不可能让用户命令行工具去管理自己的云主机了,此时,就需要一个简单易用的管理页面提供给用户了,openstack官方也很体贴的为我们已经准备好了,只是程序代码方面还存在着一些小问题,不过我已经帮大家趟过一连坑了,按照如下的配置流程是可以让大家体验到使用鼠标管理云主机的效果的。

安装并修改配置文件

[[email protected] ~]# yum install -y openstack-dashboard

[[email protected] ~]# cp /etc/openstack-dashboard/local_settings{,.bak}

[[email protected] ~]# vim /etc/openstack-dashboard/local_settings

[[email protected] ~]# grep -v ^##* /etc/openstack-dashboard/local_settings | tr -s [[:space:]]

import os

from django.utils.translation import ugettext_lazy as _

from openstack_dashboard import exceptions

from openstack_dashboard.settings import HORIZON_CONFIG

DEBUG = False

TEMPLATE_DEBUG = DEBUG

WEBROOT = ‘/dashboard/‘

ALLOWED_HOSTS = [‘*‘, ]

OPENSTACK_API_VERSIONS = {

"identity": 3,

"volume": 2,

"compute": 2,

}

OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True

OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = ‘default‘

LOCAL_PATH = ‘/tmp‘

SECRET_KEY=‘aeee32ce4909dfa6ef1b‘

SESSION_ENGINE = ‘django.contrib.sessions.backends.cache‘

CACHES = {

‘default‘: {

‘BACKEND‘: ‘django.core.cache.backends.memcached.MemcachedCache‘,

‘LOCATION‘: ‘controller:11211‘,

}

}

EMAIL_BACKEND = ‘django.core.mail.backends.console.EmailBackend‘

OPENSTACK_HOST = "controller"

OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST

OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"

OPENSTACK_KEYSTONE_BACKEND = {

‘name‘: ‘native‘,

‘can_edit_user‘: True,

‘can_edit_group‘: True,

‘can_edit_project‘: True,

‘can_edit_domain‘: True,

‘can_edit_role‘: True,

}

OPENSTACK_HYPERVISOR_FEATURES = {

‘can_set_mount_point‘: False,

‘can_set_password‘: False,

‘requires_keypair‘: False,

}

OPENSTACK_CINDER_FEATURES = {

‘enable_backup‘: False,

}

OPENSTACK_NEUTRON_NETWORK = {

‘enable_router‘: False,

‘enable_quotas‘: False,

‘enable_ipv6‘: False,

‘enable_distributed_router‘: False,

‘enable_ha_router‘: False,

‘enable_lb‘: False,

‘enable_firewall‘: False,

‘enable_vpn‘: False,

‘enable_fip_topology_check‘: False,

# Neutron can be configured with a default Subnet Pool to be used for IPv4

# subnet-allocation. Specify the label you wish to display in the Address

# pool selector on the create subnet step if you want to use this feature.

‘default_ipv4_subnet_pool_label‘: None,

# Neutron can be configured with a default Subnet Pool to be used for IPv6

# subnet-allocation. Specify the label you wish to display in the Address

# pool selector on the create subnet step if you want to use this feature.

# You must set this to enable IPv6 Prefix Delegation in a PD-capable

# environment.

‘default_ipv6_subnet_pool_label‘: None,

# The profile_support option is used to detect if an external router can be

# configured via the dashboard. When using specific plugins the

# profile_support can be turned on if needed.

‘profile_support‘: None,

#‘profile_support‘: ‘cisco‘,

# Set which provider network types are supported. Only the network types

# in this list will be available to choose from when creating a network.

# Network types include local, flat, vlan, gre, and vxlan.

‘supported_provider_types‘: [‘*‘],

# Set which VNIC types are supported for port binding. Only the VNIC

# types in this list will be available to choose from when creating a

# port.

# VNIC types include ‘normal‘, ‘macvtap‘ and ‘direct‘.

# Set to empty list or None to disable VNIC type selection.

‘supported_vnic_types‘: [‘*‘],

}

OPENSTACK_HEAT_STACK = {

‘enable_user_pass‘: True,

}

IMAGE_CUSTOM_PROPERTY_TITLES = {

"architecture": _("Architecture"),

"kernel_id": _("Kernel ID"),

"ramdisk_id": _("Ramdisk ID"),

"image_state": _("Euca2ools state"),

"project_id": _("Project ID"),

"image_type": _("Image Type"),

}

IMAGE_RESERVED_CUSTOM_PROPERTIES = []

API_RESULT_LIMIT = 1000

API_RESULT_PAGE_SIZE = 20

SWIFT_FILE_TRANSFER_CHUNK_SIZE = 512 * 1024

DROPDOWN_MAX_ITEMS = 30

TIME_ZONE = "Asia/Shanghai"

POLICY_FILES_PATH = ‘/etc/openstack-dashboard‘

LOGGING = {

‘version‘: 1,

# When set to True this will disable all logging except

# for loggers specified in this configuration dictionary. Note that

# if nothing is specified here and disable_existing_loggers is True,

# django.db.backends will still log unless it is disabled explicitly.

‘disable_existing_loggers‘: False,

‘handlers‘: {

‘null‘: {

‘level‘: ‘DEBUG‘,

‘class‘: ‘logging.NullHandler‘,

},

‘console‘: {

# Set the level to "DEBUG" for verbose output logging.

‘level‘: ‘INFO‘,

‘class‘: ‘logging.StreamHandler‘,

},

},

‘loggers‘: {

# Logging from django.db.backends is VERY verbose, send to null

# by default.

‘django.db.backends‘: {

‘handlers‘: [‘null‘],

‘propagate‘: False,

},

‘requests‘: {

‘handlers‘: [‘null‘],

‘propagate‘: False,

},

‘horizon‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘openstack_dashboard‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘novaclient‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘cinderclient‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘keystoneclient‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘glanceclient‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘neutronclient‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘heatclient‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘ceilometerclient‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘swiftclient‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘openstack_auth‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘nose.plugins.manager‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘django‘: {

‘handlers‘: [‘console‘],

‘level‘: ‘DEBUG‘,

‘propagate‘: False,

},

‘iso8601‘: {

‘handlers‘: [‘null‘],

‘propagate‘: False,

},

‘scss‘: {

‘handlers‘: [‘null‘],

‘propagate‘: False,

},

},

}

SECURITY_GROUP_RULES = {

‘all_tcp‘: {

‘name‘: _(‘All TCP‘),

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘1‘,

‘to_port‘: ‘65535‘,

},

‘all_udp‘: {

‘name‘: _(‘All UDP‘),

‘ip_protocol‘: ‘udp‘,

‘from_port‘: ‘1‘,

‘to_port‘: ‘65535‘,

},

‘all_icmp‘: {

‘name‘: _(‘All ICMP‘),

‘ip_protocol‘: ‘icmp‘,

‘from_port‘: ‘-1‘,

‘to_port‘: ‘-1‘,

},

‘ssh‘: {

‘name‘: ‘SSH‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘22‘,

‘to_port‘: ‘22‘,

},

‘smtp‘: {

‘name‘: ‘SMTP‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘25‘,

‘to_port‘: ‘25‘,

},

‘dns‘: {

‘name‘: ‘DNS‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘53‘,

‘to_port‘: ‘53‘,

},

‘http‘: {

‘name‘: ‘HTTP‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘80‘,

‘to_port‘: ‘80‘,

},

‘pop3‘: {

‘name‘: ‘POP3‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘110‘,

‘to_port‘: ‘110‘,

},

‘imap‘: {

‘name‘: ‘IMAP‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘143‘,

‘to_port‘: ‘143‘,

},

‘ldap‘: {

‘name‘: ‘LDAP‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘389‘,

‘to_port‘: ‘389‘,

},

‘https‘: {

‘name‘: ‘HTTPS‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘443‘,

‘to_port‘: ‘443‘,

},

‘smtps‘: {

‘name‘: ‘SMTPS‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘465‘,

‘to_port‘: ‘465‘,

},

‘imaps‘: {

‘name‘: ‘IMAPS‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘993‘,

‘to_port‘: ‘993‘,

},

‘pop3s‘: {

‘name‘: ‘POP3S‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘995‘,

‘to_port‘: ‘995‘,

},

‘ms_sql‘: {

‘name‘: ‘MS SQL‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘1433‘,

‘to_port‘: ‘1433‘,

},

‘mysql‘: {

‘name‘: ‘MYSQL‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘3306‘,

‘to_port‘: ‘3306‘,

},

‘rdp‘: {

‘name‘: ‘RDP‘,

‘ip_protocol‘: ‘tcp‘,

‘from_port‘: ‘3389‘,

‘to_port‘: ‘3389‘,

},

}

REST_API_REQUIRED_SETTINGS = [‘OPENSTACK_HYPERVISOR_FEATURES‘,

‘LAUNCH_INSTANCE_DEFAULTS‘]

[[email protected] ~]# systemctl restart httpd.service memcached.service

按上术官方配置后浏览器输入 http://controller/dashboard 访问仪表盘无法登陆

提示“出错啦!遇到异常情况,请刷新。如需帮助请联系管理员。”

查看httpd错误日志如下

[[email protected] ~]# tail -20f /var/log/httpd/error_log

[Tue Jul 18 22:45:26.459408 2017] [:error] [pid 8293] Login successful for user "admin".

[Tue Jul 18 22:45:30.604355 2017] [:error] [pid 8293] Internal Server Error: /dashboard/auth/login/

[Tue Jul 18 22:45:30.604412 2017] [:error] [pid 8293] Traceback (most recent call last):

[Tue Jul 18 22:45:30.604416 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response

[Tue Jul 18 22:45:30.604419 2017] [:error] [pid 8293]     response = wrapped_callback(request, *callback_args, **callback_kwargs)

[Tue Jul 18 22:45:30.604422 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper

[Tue Jul 18 22:45:30.604424 2017] [:error] [pid 8293]     return view(request, *args, **kwargs)

[Tue Jul 18 22:45:30.604427 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view

[Tue Jul 18 22:45:30.604429 2017] [:error] [pid 8293]     response = view_func(request, *args, **kwargs)

[Tue Jul 18 22:45:30.604448 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func

[Tue Jul 18 22:45:30.604452 2017] [:error] [pid 8293]     response = view_func(request, *args, **kwargs)

[Tue Jul 18 22:45:30.604454 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/openstack_auth/views.py", line 103, in login

[Tue Jul 18 22:45:30.604457 2017] [:error] [pid 8293]     **kwargs)

[Tue Jul 18 22:45:30.604460 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper

[Tue Jul 18 22:45:30.604463 2017] [:error] [pid 8293]     return view(request, *args, **kwargs)

[Tue Jul 18 22:45:30.604465 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view

[Tue Jul 18 22:45:30.604484 2017] [:error] [pid 8293]     response = view_func(request, *args, **kwargs)

[Tue Jul 18 22:45:30.604487 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func

[Tue Jul 18 22:45:30.604489 2017] [:error] [pid 8293]     response = view_func(request, *args, **kwargs)

[Tue Jul 18 22:45:30.604492 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/contrib/auth/views.py", line 51, in login

[Tue Jul 18 22:45:30.604494 2017] [:error] [pid 8293]     auth_login(request, form.get_user())

[Tue Jul 18 22:45:30.604496 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 110, in login

[Tue Jul 18 22:45:30.604499 2017] [:error] [pid 8293]     request.session.cycle_key()

[Tue Jul 18 22:45:30.604501 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py", line 285, in cycle_key

[Tue Jul 18 22:45:30.604503 2017] [:error] [pid 8293]     self.create()

[Tue Jul 18 22:45:30.604505 2017] [:error] [pid 8293]   File "/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/cache.py", line 48, in create

[Tue Jul 18 22:45:30.604508 2017] [:error] [pid 8293]     "Unable to create a new session key. "

[Tue Jul 18 22:45:30.604510 2017] [:error] [pid 8293] RuntimeError: Unable to create a new session key. It is likely that the cache is unavailable.

修正方法:

修改dashboard配置文件的SESSION_ENGINE方式

SESSION_ENGINE = ‘django.contrib.sessions.backends.file‘

官方配置是用memcached来保存会话,但代码有误,所以只能先改用file保存侍会话

登录页面

成功登录页面

实例详情页面

映像文件列表页面

网络拓扑页面

网络模型查看页面

安全组管理页面

admin用户身份登录后查看到的项目

使用网页上的vnc远程管理接口登录后的效果

    至此,一套简单的openstack实验环境搭建完成,不足之处,还望大牛指点。与此同时,也非常希望有正在学习openstack的同仁能够相互交流,如有留言告之或者直接添加公告上联系方式。

时间: 2024-10-12 03:25:12

openstack安装配置—— dnshboard安装配置的相关文章

Oracle VM + centos7.1+openstack kilo 多结点安装教程---基础环境配置(4)

声明:最近在进行openstack的kilo版本的安装,发现现有的网络教程非常少,而且多数教程并不能安装成功,故写此教程.openstack的安装较为复杂,本教程并不能保证在不同环境下也能将其安装成功.个人安装教程,也难免出错.同时,安装是在虚拟机环境下,真实安装环境需要进行更改. 转载请声明出处: 作者:张某人ER 原文链接:http://blog.csdn.net/xinxing__8185/article/details/51103863 第一部分 基础环境配置 (4) 接下来 配置com

Centos6.4配置总结--安装篇(Ⅰ)

下图是我从官网下载的CentOS-6.4-i386-bin-DVD,有两张光盘,第一张是系统盘,第二张是附属的一些软件.该系统我将要安装到VMware虚拟机上,我的本机是win8 在VMware上新建一台虚拟机,分配内存的时候注意一下,你分配的内存大小会决定你的Linux会以什么的模式安装. 该版本的Linux安装模式有两种,即文本模式和图形模式.文本模式安装的时候会没有自定义分区大小的功能,图形模式有.据说分配的计算机内存必须等于或者大于628M才会启动图形安装模式,我当时分配512M内存的时

PDI 学习2:KETTLE安装,环境变量配置,开发准备

在这里把环境变量的配置具体拿出来,有问题的同学自己比对一下: 1.安装JDK,KETTLE 1) KETTLE拷贝程序包,绿色安装: 官方下载:http://community.pentaho.com/projects/data-integration/ 2) JDK安装: 2.配置系统环境变量 ( 已有的变量,在后面新增值:没有的变量新增变量和值) 1) JDK ( 参考如下,按实际情况配置) 关注JAVA_HOME  和 PATH 变量 值 JAVA_HOME D:\Program File

JDK安装与环境变量配置方法--Java环境

第一步:下载JDK,可直接双击安装,到如下图这一步可以点击[更改],将JDK安装到自己指定的路径. 注:若无安装目录要求,可全默认设置.无需做任何修改,两次均直接点下一步即可. 第二步:安装完JDK后配置环境变量  计算机→属性→高级系统设置→高级→环境变量 第三步: DOS的批处理命令直接运行: 创建auto.bat文件,在其末尾加入: set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121 set PATH=%JAVA_HOME%\bin;C:\Pr

jdk(Java SE JDK)安装与环境变量配置攻略

2017-01-08 21:00:55  jdk安装与环境变量配置攻略   1.下载jdk安装包 附个下载链接 http://www.oracle.com/technetwork/java/javase/downloads/index.html 2.安装JDK 选择安装目录,其中安装过程中会出现两次提示 .First.安装 jdk ,Second.安装 jre .小编建议两个安装在同一文件夹的不同子文件夹中. (jdk和jre不能安装在同一文件夹的根目录下,jdk和jre安装在同一文件夹极易出错

Ubuntu下安装JDK以及相关配置

1.查看系统位数,输入以下命令即可 getconf LONG_BIT 2.下载对应的JDK文件,我这里下载的是jdk-8u60-linux-64.tar.gz 3.创建目录作为JDK的安装目录,这里选择安装位置为:/usr/java/ sudo mkdir /usr/java 4.解压文件带/usr/java/目录下,文件下载的位置是在下载目录下的 cd 下载sudo tar zxvf jdk-8u60-linux-x64.tar.gz -C /usr/java/ 5.进入到/usr/java/

ubuntu编译安装postgresql及主从配置

操作系统版本    Ubuntu 14.04 数据库软件版本     postgresql-9.4.7.tar.gz 安装方式    编译安装 软件安装目录    /usr/local/pgsql 数据存放目录    /service/postgresql/data 日志存放目录    /service/postgresql/archive 1.安装依赖包 sudo apt-get update sudo apt-get install  libreadline6-dev sudo apt-ge

debain(SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux)安装注意点及配置

1. 无线网卡驱动准备 安装时准备好驱动(我的Dell6430配置intel u系列)(下载驱动并解压放在可识别存储设备上) 2-18来自“千里之行始于足下” 2. 安装和配置 sudo 切换到root用户 apt-get install sudo 配置 /etc/sudoers,使你的帐户具有sudo权限 root ALL=(ALL:ALL) ALL wangyubin ALL=(ALL:ALL) ALL # 添加需要的用户 3. 设置 sudo 不用密码 # User privilege s

在MyEclipse配置自己安装的Tomcat(2014.08.18)

今天因为要在tomcat下运行一个java项目,第一次嘛,遇到了不少问题,总结分享一下: 第一次,我直接将 MyEclipse 生成的项目放到 tomcat 安装目录的 webapps 目录下,运行出现404,无法访问. 然后想了想,发现这是个错误的做法.应该先通过 MyEclipse 将项目部署到 Tomcat 下: 然后, MyEclipse 自带了 tomcat,我要配置自己安装的 TomCat : (请看参考资料:http://jingyan.baidu.com/article/4853