centos系统下openstack安装dashboard登录后出现server error
2017-03-28 21:37
477 查看
dashboard登录出错,提示无法进入页面,服务器错误
安装dashboard,配置文件,通过命令行web浏览器links进入http://controller/dashboard,能够正常 显示网站,但是输入admin的用户以及default的默认域后,发现无法进入页面查看controller节点的httpd错误文件
~# vim /var/log/httpd/error_log
发现了错误报告:
[Mon Mar 27 14:20:36.204588 2017] [:error] [pid 3224] “Unable to create a new session key. ”
[Mon Mar 27 14:20:36.204588 2017] [:error] [pid 3224]RuntimeError:Unable to create a new session key. It is likely that the cache is unavailable
看起来像是缓存一样的问题
在配置dashboard的时候只有一个地方涉及到了存储
那么就可能是这里的问题
于是去找了找相关的资料,找到一个:
I was getting this error running a local, development version of a Django project, because it was periodically having trouble connecting to a non-local cache. I realized that I could change my session backend to a file-based session to address the issue .
In the settings file for this local, development version of Django, I simply set the following value:
SESSION_ENGINE = ‘django.contrib.sessions.backends.file’
This is not the solution I would use in a production environment, and not the solution I would suggest to the original poster, but it took me a few minutes to figure out what the issue was and this is one of the only results that appeared when I Googled, so I figured I’d post here possibly to help out others with a similar issue.
翻译过来就是:我在运行一个本地的开发者版本的Django项目的时候遇到了这个问题,因为他周期性的会在连接一个非本地缓存的时候遇到问题,我意识到我可以改变为基于文件的缓存来解决这件事,因此我把SESSION_ENGINE改为django.contrib.session.backends.file
于是我去试了一下,确实成功的解决了这个问题,也能够登录dashboard了,但是这样总觉得以后会出什么问题,毕竟和官方给的不一样,小白不是很懂,所以还是去查一下
Django中的Session有3种存储方式:放在数据库、缓存或者文件系统中,其中设置session在缓存中,可以使用django.contrib.session.backends.cache方法,或者django.contrib.session.backends.cache_db存放在缓存与数据库中,第一种方法不能保证session总能取到(比如缓存溢出时Session会丢失),另外一种方式就是存在文件系统上,就是将cache改为file,保存在缓存中能够获得较好的性能,但是可能会出现一些问题
所以说应该是采取了保存在文件中的方法,之前httpd中的错误提到了缓存不可用(It is likely that the cache is unavailable)
后来查到这个
要使用 Django 的缓冲区系统来保存 Session,需要将 SESSION_ENGINE 设置为 “django.contrib.sessions.backends.cache” 。您必须确保您已经配置了缓冲区,也就是memcached的缓存
也就是说,错误有可能是在memcached里面发生的,但是memcached好像没什么复杂的配置,所以查看一下日志看看
然而并没有找到memcached的日志,但是却发现了一个东西
网上通用的进入memcached的方法:
~# telnet xxx.xxx.xxx.xxx 11211
我使用了
~# telnet 10.0.0.11 11211
~# telnet controller 11211
都无法进入,后来一想,反正memcached也是装在本机上的,127.0.0.1总能进吧
~# telnet 127.0.0.1 11211
成功进入
考虑到,会不会是因为memcached没有配置允许通过本机ip来访问,才会出现的缓存不可用的错误?通过浏览器无法通过10.0.0.11:11211进入,于是搜了一下memcached的配置文件地址
~# vim /etc/sysconfig/memcached
里面有一项:OPTIONS=”-1 127.0.0.1, ::1”
将地址127.0.0.1改为10.0.0.11(即控制节点ip)后保存文件
重启memcached服务
~# systemctl restart memcached.service
通过links连接http://controller:11211,重新登录
问题成功解决
总结
问题根源在于memcached没有配置为外部可访问,而openstack的官方文档中,memcached没有进行配置,因此导致在django存session在缓存中的时候,不能通过LOACTION的controller:11211来进行访问,导致缓存不可用的问题,而解决办法则是进行memcached的配置文件修改,使其能够通过本机ip地址进行访问,就能解决问题了相关文章推荐
- 解决VMware8安装CentOS等系统时出现Fatal IO error 11(Resource temporarilt unavaliable) on Xshell:1问题
- 在VMware8.0.4安装centos6.3出现蓝屏,显示“anaconda: Fatal IO error 104 (Connection reset by peer) on X server :1.0. install exited abnormally [1/1]”?
- 安装centos 5.9系统,出现Error: Cannot find a valid baseurl for repo: base报错
- 打开Openstack dashboard出现Internal Server Error
- 打开Openstack dashboard出现Internal Server Error
- 虚拟机VMware7.0.0安装CentOS-6.2出现fatal IO error 104 connection reset by peer on xserver:1.0解决
- 安装centos 5.9系统,出现Error: Cannot find a valid baseurl for repo: base报错
- Ubuntu系统安装CUDA或NVIDIA驱动后出现循环登录问题的Solution (附:building kernel modules error)
- centos系统安装openstack—dashboard安装和展示
- 由于CentOS的系统安装了epel-release-latest-7.noarch.rpm 导致在使用yum命令时出现Error: xz compression not available问题
- 安装Destoon系统出现500 Internal Server Error错误的原因
- 由于CentOS的系统安装了epel-release-latest-7.noarch.rpm 导致在使用yum命令时出现Error: xz compression not available问题。
- 虚拟机安装CentOS 6.2出现;Error processing drive:的问题
- CentOS 6.2 二进制安装apache2.4.3出现configure: error: APR-util not found. Please read the documentation的解决方
- CentOS 源码编译安装Pure-FTPd(配置系统用户登录)
- window server 2012 系统无法登录 出现“此工作站和主域间的信任关系失败”
- centos5.5开机登录后提示“您的会话只持续了不到10秒钟,如果您没有注销,就意味着安装可能出现了问题”
- EBS 登录时出现500 Internal Server Error的解决方法
- 安装Win7和Ubuntu12.04双系统后,意外删除Ubuntu12.04引导文件,出现error:unknown filesystem;grub rescue>错误的解决方案
- centos-5.8安装gnome桌面系统,安装并配置vncserver远程登录