Need help on setting up the AWS Redis ElastiCache on Moodle

Need help on setting up the AWS Redis ElastiCache on Moodle

by Desh Deepak Dhobi -
Number of replies: 11

I am planning to use the Moodle application for one of our clients and was confused on how I can use the AWS Redis elasticache in Moodle application. 

I am on a testing phase thus was working on the segregation of the moodle application. I have segregated the database to AWS RDS, moodledata folder to AWS EFS, and now planning to use AWS Redis elasticache for cache segregation. Please help me with the required steps on how to configure Moodle application to use AWS Redis Cache.

Also, another question of mine is it possible to make the Moodle application stateless for the implementation of AWS autoscaling.

Average of ratings: -
In reply to Desh Deepak Dhobi

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The documentation for configuring the cache are here - Caching. You just need to use the Elasticache hostname/ip when configuring a new Redis instance.
In reply to Howard Miller

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Desh Deepak Dhobi -
Thank you Howard,

I went through the documentation and figured out the steps to configure the AWS Redis ElastiCache server and the Stores are in the Ready state. 


But when I went to the Test performance section for the Redis server and found that the Store was not ready. Please help me know why this is happening and is this a problem stating that the AWS ElastiCache Redis server has not been configured properly.



And also help me know if there is any way/steps to check if the moodle application of mine is served through the Redis cache or not.


Waiting for your response.
Average of ratings: Useful (1)
In reply to Desh Deepak Dhobi

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You've done it. Testing is not supported for Redis. Also, not every possible store type is. None of this is a problem.
In reply to Howard Miller

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Desh Deepak Dhobi -

Thankyou Howard,

This helped a lot. I have moved ahead and have segregated the moodle application on the AWS Platform (Database on AWS RDS, moodledata Folder mounted on AWS EFS, and moodle caches in AWS Redis elasticache server) and everything is working perfectly.

Now my other question Is "Is it possible to implement AWS CI/CD on the existing segregated moodle application?".

In reply to Desh Deepak Dhobi

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Sorry - I don't know what "AWS CI/CD" is....
In reply to Howard Miller

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Desh Deepak Dhobi -

Hello Howard, 

CI/CD means Continous Integration and Continuous Delivery. The simple workflow is The code is on Github or other code Repos, we create code build for test cases, code deploy for the deployment to a specific server.

This documentation will help you understand this.

https://docs.aws.amazon.com/whitepapers/latest/cicd_for_5g_networks_on_aws/cicd-on-aws.html

In reply to Desh Deepak Dhobi

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
TL;DR; but what is it you are actually trying to achieve? If you are using GitHub to store a "custom" (and I hope that doesn't mean modifying core code) versions of Moodle then it should be straighforward to push that to "live"
In reply to Howard Miller

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Desh Deepak Dhobi -
ok, got that.

And another question, Is it possible to separate the frontend and backend part of the moodle application and keep them on different servers. For example Frontend part on one server and the Backend part on another server.
In reply to Desh Deepak Dhobi

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
No. Moodle doesn't have a "frontend" and a "backend". Although some significant bits are now written in Javascript it was created well before that was a common notion. It's reasonable to think of Moodle as solely a server-side PHP application.

If that's what you mean...
Average of ratings: Useful (1)
In reply to Desh Deepak Dhobi

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Jesse W -

Hello Desh,

Could you please post what steps you took to enable the Redis Plugin? I am stuck on exactly at this point. 

Thank you,

FYI - I am deploying moodle on k8s using bitnami image.

-Jesse

In reply to Jesse W

Re: Need help on setting up the AWS Redis ElastiCache on Moodle

by Desh Deepak Dhobi -

Hello Jesse,


Sure, I am always there to help.


I followed the below-mentioned steps:

1) I installed the Redis dependency to enable Redis configuration in Moodle using the below-mentioned command

sudo apt-get install php7.4-redis


2) Then I followed the steps mentioned in this documentation:

https://docs.moodle.org/310/en/Redis_cache_store#:~:text=your%20web%20server.-,Configuring%20Redis%20in%20Moodle,link%20to%20add%20an%20instance.


3) And this worked for me.


Please let me know if you face any issues in between following these steps.