Reputation: 759
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.
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.
Upvotes: 2
Views: 481
Reputation: 533
You can also use DynamoDB Session Handling from AWS sdk ( https://aws.amazon.com/ru/blogs/aws/scalable-session-handling-in-php-using-amazon-dynamodb/ ) though it will require to write tiny extension for Mediawiki.
Upvotes: 0
Reputation: 3414
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.
Upvotes: 3