- #Install redis on ec2 how to#
- #Install redis on ec2 install#
- #Install redis on ec2 code#
- #Install redis on ec2 password#
Note that we MUST address remote servers using internal IP addresses because otherwise our network traffic would leave and re-enter our Virtual Private Cloud which would not only be inefficient from a performance point of view but also insecure. To reconfigure the LMS to use a remote Memcached server we should modify the ‘localhost:11211’ parameter from ‘localhost’ to the Internal IP address of the newly-created remote Memcached server following the format, ‘172.x.x.x:11211’. KEY_PREFIX: dev.mongo_metadata_inheritance We can see that in total there are four subsystems containing Memcached configuration parameters, and furthermore that two of these yml files contain multiple references to Memcached, as follows: /edx/etc/ecommerce.yml: - localhost:11211įor example, the first occurrence of Memcached configuration for lms.yml looks similar to the following: CACHES:īACKEND: .memcached.MemcachedCache For example, Memcached is assigned to Linux port number 27017, thus we can execute the the following command to identify all Open edX configuration files that contain Memcached configuration parameters: sudo grep -r '11211' /edx/etc/*.yml To identify which yml files require modification you can use the Linux command, ‘grep’ to search for the Linux port number corresponding to the service you are scaling. Test connectivity to your new remote redis-server service by executing this command from the command line of your edxapp server: redis-cli -a THE-STRONG-PASSWORD-FROM-MY-PASSWORDS.YML -h ping Reboot the remote Memcached/Redis serverĪfterwards you should reboot your new remote Memcached/Server server sudo reboot 4. Requirepass "THE-STRONG-PASSWORD-FROM-MY-PASSWORDS.YML" 3.
#Install redis on ec2 password#
# change from 'bind 127.0.0.1 ::1' to the followingĪlso add the password for redis-server, which you can find either by opening the same file on your edxapp server and looking on or around row 509, or alternatively, you can find the value in /home/ubuntu/my-passwords.yml as the key REDIS_PASSWORD on or around row 45. Configure redis-server to accept remote connectionsĮdit the file /etc/redis/nf on or around row 69 as follows: # Specify which IP address to listen on.
# but you should try command just in case. # redis-tools usually is automatically installed along with redis-server,
#Install redis on ec2 install#
Install redis-server service # First, make sure that your local package index is updated Take note of this value, which will be titled, “Private IPv4 addresses”ġ. You’ll access your new remote Memcached server via the internal IP address, which is automatically assigned by AWS when you create the new EC2 instance. Take Note of The Internal IP Address That is Assigned Note that on the first row, SSH, you should try to limit access to your bastion server, if you use one. This firewall configuration limits remote access of the server to Memcached, regardless of whatever other services might still be installed and running internally on the server. You should create a separate EC2 Security Group for your new Memcached EC2 instance, as follows: Create a new EC2 Security Group for Memcached Note that you’d only need a different SSH key if for example, completely different teams manage the Open edX and Memcached environments.
I re-use the existing SSH key that i used for the original Open edX EC2 instance. Launch a new t2.medium EC2 instance from the AMI that you created.
You can safely start with a t2.small or t2.medium EC2 instance size which will probably server your needs for the lifetime of your Open edX platform.ġ. Note that you will only need to focus on vertical scaling for Memcached and Redis on Open edX. When scaling Memcached and Redis I do not migrate data. I install the latest versions of memcached and redis-server, regardless of the versions that the original Open edX server is using. As of this writing Open edX Lilac runs on Ubuntu 20.04 LTS. This article describes my preferred approach, which is to use AWS EC2 console to create a new Ubuntu EC2 instance using the same version of Ubuntu on which your Open edX platform currently runs. By scaling, I mean migrating Open edX’s local Memcached service to its own independent Ubuntu EC2 instance.
#Install redis on ec2 how to#
This article explains how to migrate the Memcached service.
#Install redis on ec2 code#
To scale the Open edX platform you first must physically separate the executable program code from the data that is managed by these four subsystems. The Open edX platform persists data across five distinct subsystems: MySQL, MongoDB, the Ubuntu file system, Memcached, and since the Lilac release in May 2021, Redis. If you’re looking for a general overview of how to scale the Open edX platform then you should read this first, “ Scaling Open edX“.