|  | 
|  | 1 | +--- | 
|  | 2 | +title: "Install on AWS EC2" | 
|  | 3 | +linkTitle: "Install on AWS EC2" | 
|  | 4 | +weight: 3 | 
|  | 5 | +description: > | 
|  | 6 | + How to install RedisInsight on AWS EC2 | 
|  | 7 | +--- | 
|  | 8 | +This tutorial shows you how to install RedisInsight on an AWS EC2 instance and manage ElastiCache Redis instances using RedisInsight. To complete this tutorial you must have access to the AWS Console and permissions to launch EC2 instances. | 
|  | 9 | + | 
|  | 10 | +Step 1: Create a new IAM Role (optional) | 
|  | 11 | +-------------- | 
|  | 12 | + | 
|  | 13 | +RedisInsight needs read-only access to S3 and ElastiCache APIs. This is an optional step. | 
|  | 14 | + | 
|  | 15 | +1. Log in to the AWS Console and navigate to the IAM screen. | 
|  | 16 | +1. Create a new IAM Role. | 
|  | 17 | +1. Under *Select type of trusted entity*, choose EC2. The role is used by an EC2 instance. | 
|  | 18 | +1. Assign the following permissions: | 
|  | 19 | + * AmazonS3ReadOnlyAccess | 
|  | 20 | + * AmazonElastiCacheReadOnlyAccess | 
|  | 21 | + | 
|  | 22 | +Step 2: Launch EC2 Instance | 
|  | 23 | +-------------- | 
|  | 24 | + | 
|  | 25 | +Next, launch an EC2 instance. | 
|  | 26 | + | 
|  | 27 | +1. Navigate to EC2 under AWS Console. | 
|  | 28 | +1. Click Launch Instance. | 
|  | 29 | +1. Choose 64-bit Amazon Linux AMI. | 
|  | 30 | +1. Choose at least a t2.medium instance. The size of the instance depends on the memory used by your ElastiCache instance that you want to analyze. | 
|  | 31 | +1. Under Configure Instance: | 
|  | 32 | + * Choose the VPC that has your ElastiCache instances. | 
|  | 33 | + * Choose a subnet that has network access to your ElastiCache instances. | 
|  | 34 | + * Ensure that your EC2 instance has a public IP Address. | 
|  | 35 | + * Assign the IAM role that you created in Step 1. | 
|  | 36 | +1. Under the storage section, allocate at least 100 GiB storage. | 
|  | 37 | +1. Under security group, ensure that: | 
|  | 38 | + * Incoming traffic is allowed on port 5540 | 
|  | 39 | + * Incoming traffic is allowed on port 22 only during installation | 
|  | 40 | +1. Review and launch the ec2 instance. | 
|  | 41 | + | 
|  | 42 | +Step 3: Verify permissions and connectivity | 
|  | 43 | +---------- | 
|  | 44 | + | 
|  | 45 | +Next, verify that the EC2 instance has the required IAM permissions and can connect to ElastiCache Redis instances. | 
|  | 46 | + | 
|  | 47 | +1. SSH into the newly launched EC2 instance. | 
|  | 48 | +1. Open a command prompt. | 
|  | 49 | +1. Run the command `aws s3 ls`. This should list all S3 buckets. | 
|  | 50 | + 1. If the `aws` command cannot be found, make sure your EC2 instance is based of Amazon Linux. | 
|  | 51 | +1. Next, find the hostname of the ElastiCache instance you want to analyze and run the command `echo info | nc <redis host> 6379`. | 
|  | 52 | +1. If you see some details about the ElastiCache Redis instance, you can proceed to the next step. | 
|  | 53 | +1. If you cannot connect to redis, you should review your VPC, subnet, and security group settings. | 
|  | 54 | + | 
|  | 55 | +Step 4: Install Docker on EC2 | 
|  | 56 | +------- | 
|  | 57 | + | 
|  | 58 | +Next, install Docker on the EC2 instance. Run the following commands: | 
|  | 59 | + | 
|  | 60 | +1. `sudo yum update -y` | 
|  | 61 | +1. `sudo yum install -y docker` | 
|  | 62 | +1. `sudo service docker start` | 
|  | 63 | +1. `sudo usermod -a -G docker ec2-user` | 
|  | 64 | +1. Log out and log back in again to pick up the new docker group permissions. | 
|  | 65 | +1. To verify, run `docker ps`. You should see some output without having to run `sudo`. | 
|  | 66 | + | 
|  | 67 | +Step 5: Run RedisInsight in the Docker container | 
|  | 68 | +------- | 
|  | 69 | + | 
|  | 70 | +Finally, install RedisInsight using one of the options described below. | 
|  | 71 | + | 
|  | 72 | +1. If you do not want to persist your RedisInsight data: | 
|  | 73 | + | 
|  | 74 | +```bash | 
|  | 75 | +docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest | 
|  | 76 | +``` | 
|  | 77 | +2. If you want to persist your RedisInsight data, first attach the Docker volume to the `/data` path and then run the following command: | 
|  | 78 | + | 
|  | 79 | +```bash | 
|  | 80 | +docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest -v redisinsight:/data | 
|  | 81 | +``` | 
|  | 82 | + | 
|  | 83 | +If the previous command returns a permission error, ensure that the user with `ID = 1000` has the necessary permission to access the volume provided (`redisinsight` in the command above). | 
|  | 84 | + | 
|  | 85 | +Find the IP Address of your EC2 instances and launch your browser at `http://<EC2 IP Address>:5540`. Accept the EULA and start using RedisInsight. | 
|  | 86 | + | 
|  | 87 | +RedisInsight also provides a health check endpoint at `http://<EC2 IP Address>:5540/api/health/` to monitor the health of the running container. | 
|  | 88 | + | 
|  | 89 | +Summary | 
|  | 90 | +------ | 
|  | 91 | + | 
|  | 92 | +In this guide, we installed RedisInsight on an AWS EC2 instance running Docker. As a next step, you should add an ElastiCache Redis Instance and then run the memory analysis. | 
0 commit comments