关闭

can't login openstack dashboard

337人阅读 评论(0) 收藏 举报
分类:

基于M版本的HA环境。

运行一段时间后(期间追加安装了不少服务:heat,  aodh, ceilometer等)。突然发现无法登录dashboard了。

查看日志(/var/log/httpd/error.log)发现如下record

======

[Wed Jun 01 01:55:22.232869 2016] [:error] [pid 30560] Login successful for user "admin".
[Wed Jun 01 01:55:22.292997 2016] [:error] [pid 30560] Total Cookie size for user_id: ce6760c4525f4a0a8b8ac805a568d317 is 4248B >= 4093B. You need to configure file-based or database-backed sessions instead of cookie-based sessions: http://docs.openstack.org/developer/horizon/topics/deployment.html#session-storage
[Wed Jun 01 01:55:30.014698 2016] [:error] [pid 30560] Total Cookie size for user_id: ce6760c4525f4a0a8b8ac805a568d317 is 4193B >= 4093B. You need to configure file-based or database-backed sessions instead of cookie-based sessions: http://docs.openstack.org/developer/horizon/topics/deployment.html#session-storage

======

查看代码,发现是因为openstack返回给浏览器的cookie超过了最大值:

======

cat  /usr/lib/python2.7/site-packages/horizon/middleware.py


            max_cookie_size = getattr(
                settings, 'SESSION_COOKIE_MAX_SIZE', None)
            session_cookie_name = getattr(
                settings, 'SESSION_COOKIE_NAME', None)
            session_key = request.COOKIES.get(session_cookie_name)
            if max_cookie_size is not None and session_key is not None:
                cookie_size = sum((
                    len(key) + len(value)
                    for key, value in six.iteritems(request.COOKIES)
                ))
                if cookie_size >= max_cookie_size:
                    LOG.error(
                        'Total Cookie size for user_id: %(user_id)s is '
                        '%(cookie_size)sB >= %(max_cookie_size)sB. '
                        'You need to configure file-based or database-backed '
                        'sessions instead of cookie-based sessions: '
                        'http://docs.openstack.org/developer/horizon/topics/'
                        'deployment.html#session-storage'
                        % {
                            'user_id': request.session.get(
                                'user_id', 'Unknown'),
                            'cookie_size': cookie_size,
                            'max_cookie_size': max_cookie_size,
                        }
                    )


================

第一想法是修改openstack设定的cookie max size。

后来查了资料,浏览器也是有cookie限制的(如下所示)

后来再请教大牛:浏览器cookie限制无法修改:那我改openstack有毛用。

老老实实把cookie改成数据库模式吧(后续分析)


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:43633次
    • 积分:1133
    • 等级:
    • 排名:千里之外
    • 原创:71篇
    • 转载:3篇
    • 译文:0篇
    • 评论:6条
    最新评论