doushao1948 2016-10-13 04:12
浏览 93

在负载平衡环境中在AWS / EC2上托管MediaWiki的会话问题

I have a MediaWiki application installed on a single AWS EC2 server with its own RDS Database server, which works well. For load balancing purposes, I installed another EC2 server with a load balancer to handle additional web server traffic.

I edited the LocalSettings.php and pointed it to a load balanced URL $wgServer = "http://xxxxxxxxx.elb.amazonaws.com" , I then restated the apache servers.

The application does not work consistently any longer – here are some of the symptoms.

  1. After logging in, the end user is shown the log in link as if the user never logged in at all.
  2. The Data may or may when user edits information.

After I shutdown one of the web servers in the load balancer – everything works well again. I suspect this is due to session state etc.

How can I make the application work in a load balanced environment?

I also looked at https://meta.wikimedia.org/wiki/Help:Logging_and searched for information in but it does not give me clues how to solve this.

Installed from https://releases.wikimedia.org/mediawiki/1.22/mediawiki-1.22.6.tar.gz on an EC2 Linux server.

  • 写回答

2条回答 默认 最新

  • douke6857 2016-10-13 15:32
    关注

    Yes, it is due to the user's sessions not being distributed across both EC2 instances. You can change how Mediawiki stores the session data. This answer describes using MySQL. After making the change to Mediawiki on both EC2 instances the users' session will be available to both instances.

    A (less than ideal) alternative is to configure Sticky Sessions on the AWS ELB.

    评论

报告相同问题?

悬赏问题

  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图