Skip to content

Commit

Permalink
Updating RedisInsight on Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktarStarastsenka committed Jan 29, 2024
1 parent 073d22e commit dcc33b0
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 72 deletions.
17 changes: 8 additions & 9 deletions docs/install/install-redisinsight/env-variables.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
---
Title: Supported environment variables
date: 2024-01-30 10:00:00
weight: 60
categories: ["RI"]
path: install/install-redisinsight/env-variables
altTag: Supported environment variables
title: "Environment variables"
linkTitle: "Environment variables"
weight: 4
description: >
RedisInsight supported environment variables
---
You can configure RedisInsight with the following environment variables.

| Variable | Purpose | Default | Additional Info |
| Variable | Purpose | Default | Additional info |
| --- | --- | --- | --- |
| RI_APP_PORT | The port that RedisInsight listens on | <ul><li> docker: 5540 <li> desktop: 5530 </ul> | See [Express Documentation](https://expressjs.com/en/api.html#app.listen)|
| RI_APP_HOST | The host that RedisInsight listens on | <ul><li> docker: 0.0.0.0 <li> desktop: 127.0.0.1 </ul> | See [Express Documentation](https://expressjs.com/en/api.html#app.listen)|
| RI_APP_HOST | The host that RedisInsight connects to | <ul><li> docker: 0.0.0.0 <li> desktop: 127.0.0.1 </ul> | See [Express Documentation](https://expressjs.com/en/api.html#app.listen)|
| RI_SERVER_TLS_KEY | Private key for HTTPS | n/a | Private key in [PEM format](https://www.ssl.com/guide/pem-der-crt-and-cer-x-509-encodings-and-conversions/#ftoc-heading-3). May be a path to a file or a string in PEM format.|
| RI_SERVER_TLS_CERT | Certificate for supplied private key | n/a | Public certificate in [PEM format](https://www.ssl.com/guide/pem-der-crt-and-cer-x-509-encodings-and-conversions/#ftoc-heading-3)|
| RI_ENCRYPTION_KEY | Key to encrypt data with | n/a | Redisinsight stores sensitive information (database passwords, Workbench history, etc.) locally (using [sqlite3](https://github.com/TryGhost/node-sqlite3)). This variable allows to store sensitive information encrypted using the specified encryption key. <br /> `Note:` The same encryption key should be provided for subsequent `docker run` commands with the same volume attached to decrypt the information. |
| RI_ENCRYPTION_KEY | Key to encrypt data with | n/a | Redisinsight stores sensitive information (database passwords, Workbench history, etc.) locally (using [sqlite3](https://github.com/TryGhost/node-sqlite3)). This variable allows you to store sensitive information encrypted using the specified encryption key. <br />Note: The same encryption key should be provided for subsequent `docker run` commands with the same volume attached to decrypt the information. |
| RI_LOG_LEVEL | Configures the log level of the application. | `info` | Supported logging levels are prioritized from highest to lowest: <ul> <li>error<li> warn<li>info<li> http<li> verbose<li> debug<li> silly</ul> |
| RI_FILES_LOGGER | Log to file | `true` | By default, you can find log files in the following folders: <ul> <li> docker: `/data/logs` <li> desktop: `<user-home-dir>/.refisinsight-app/logs` </ul>|
| RI_STDOUT_LOGGER | Log to STDOUT | `true` | |
73 changes: 36 additions & 37 deletions docs/install/install-redisinsight/install-on-aws.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---
Title: Install RedisInsight on AWS EC2
date: 2024-01-30 10:00:00
weight: 50
categories: ["RI"]
path: install/install-redisinsight/install-on-aws/
altTag: Install RedisInsight on AWS EC2
title: "Install on AWS EC2"
linkTitle: "Install on AWS EC2"
weight: 1
description: >
How to install RedisInsight on AWS EC2
---
This tutorial shows 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.
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.

Step 1: Create a new IAM Role (Optional)
Step 1: Create a new IAM Role (optional)
--------------

RedisInsight needs read-only access to S3 and ElastiCache APIs. This is an optional step.

1. Login to AWS Console, and navigate to IAM screen
1. Create a new IAM Role
1. Under *Select type of trusted entity*, choose EC2. In other words, the role is used by an EC2 instance
1. Log in to the AWS Console and navigate to the IAM screen.
1. Create a new IAM Role.
1. Under *Select type of trusted entity*, choose EC2. The role is used by an EC2 instance.
1. Assign the following permissions:
* AmazonS3ReadOnlyAccess
* AmazonElastiCacheReadOnlyAccess
Expand All @@ -25,32 +24,32 @@ Step 2: Launch EC2 Instance

Next, launch an EC2 instance.

1. Navigate to EC2 under AWS Console
1. Click Launch Instance
1. Choose 64 bit Amazon Linux AMI
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
1. Navigate to EC2 under AWS Console.
1. Click Launch Instance.
1. Choose 64-bit Amazon Linux AMI.
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.
1. Under Configure Instance:
* Choose the VPC that has your ElastiCache instances
* Choose a subnet that has network access to your ElastiCache instances
* Ensure that your EC2 instance has a public IP Address
* Assign the IAM role that you created in Step 1
1. Under the storage section, ensure at least 100 GiB storage
* Choose the VPC that has your ElastiCache instances.
* Choose a subnet that has network access to your ElastiCache instances.
* Ensure that your EC2 instance has a public IP Address.
* Assign the IAM role that you created in Step 1.
1. Under the storage section, allocate at least 100 GiB storage.
1. Under security group, ensure that:
* Incoming traffic is allowed on port 5540
* Incoming traffic is allowed on port 22 only during installation
1. Review and launch the ec2 instance
1. Review and launch the ec2 instance.

Step 3: Verify Permissions and Connectivity
Step 3: Verify permissions and connectivity
----------

Next, verify that the EC2 instance has the required IAM permissions, and can connect to ElastiCache Redis instances.
Next, verify that the EC2 instance has the required IAM permissions and can connect to ElastiCache Redis instances.

1. SSH into the newly launched EC2 instance
1. Open a command prompt
1. Run the command `aws s3 ls`. This should list S3 buckets
1. If the `aws` command cannot be found, make sure your ec2 instance is based of amazon linux
1. Next, find the hostname an ElastiCache instance you want to analyze, and run the command `echo info | nc <redis host> 6379`
1. If you see some details about the ElastiCache redis instance, you can proceed to the next step
1. SSH into the newly launched EC2 instance.
1. Open a command prompt.
1. Run the command `aws s3 ls`. This should list all S3 buckets.
1. If the `aws` command cannot be found, make sure your EC2 instance is based of Amazon Linux.
1. Next, find the hostname of the ElastiCache instance you want to analyze and run the command `echo info | nc <redis host> 6379`.
1. If you see some details about the ElastiCache Redis instance, you can proceed to the next step.
1. If you cannot connect to redis, you should review your VPC, subnet, and security group settings.

Step 4: Install Docker on EC2
Expand All @@ -63,31 +62,31 @@ Next, install Docker on the EC2 instance. Run the following commands:
1. `sudo service docker start`
1. `sudo usermod -a -G docker ec2-user`
1. Log out and log back in again to pick up the new docker group permissions.
1. To verify, run `docker ps`. You should see some output without having to run sudo
1. To verify, run `docker ps`. You should see some output without having to run `sudo`.

Step 5: Run RedisInsight Docker Container
Step 5: Run RedisInsight in the Docker container
-------

Finally, we can now install RedisInsight. Run the following command to download and run the RedisInsight docker image.
Finally, install RedisInsight. Run the following command to download and run the RedisInsight Docker image.

1. If you do not want to persist your RedisInsight data.
1. If you do not want to persist your RedisInsight data:

```bash
docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest
```
2. If you want to persist your RedisInsight data, attach docker volume to the `/data` path.
2. If you want to persist your RedisInsight data, attach the Docker volume to the `/data` path.

```bash
docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest -v redisinsight:/data
```

If the previous command returns a permission error, ensure that the user with `ID = 1000` has necessary permission to access the volume provided (`redisinsight` in the command above).
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).

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.
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.

RedisInsight also provides a health check endpoint at `http://<EC2 IP Address>:5540/api/health/` to monitor the health of the running container.

Summary
------

In this guide, we installed RedisInsight on an EC2 instance running Docker. As a next step, you should now add an ElastiCache Redis Instance and then run the memory analysis.
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.
22 changes: 10 additions & 12 deletions docs/install/install-redisinsight/install-on-docker.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
Title: Install RedisInsight on Docker
date: 2024-01-30 10:00:00
weight: 30
categories: ["RI"]
path: install/install-redisinsight/install-on-docker/
altTag: Install RedisInsight on Docker
title: "Install on Docker"
linkTitle: "Install on Docker"
weight: 2
description: >
How to install RedisInsight on Docker
---
This tutorial shows how to install RedisInsight on [Docker](https://www.docker.com/) so you can use RedisInsight in development.
See a separate guide for installing [RedisInsight on AWS]({{< relref "/docs/install/install-on-aws.md" >}}).
See a separate guide for installing [RedisInsight on AWS](/docs/install/install-redisinsight/install-on-aws/).

## Install Docker

Expand All @@ -17,20 +16,19 @@ The first step is to [install Docker for your operating system](https://docs.doc

Next, run the RedisInsight container.

1. If you do not want to persist your RedisInsight data.
1. If you do not want to persist your RedisInsight data:

```bash
docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest
```
2. If you want to persist your RedisInsight data, attach docker volume to the `/data` path.
2. If you want to persist your RedisInsight data, attach the Docker volume to the `/data` path:

```bash
docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest -v redisinsight:/data
```

If the previous command returns a permission error, ensure that the user with `ID = 1000` has necessary permission to access the volume provided (`redisinsight` in the command above).
If the previous command returns a permission error, ensure that the user with `ID = 1000` has the necessary permissions to access the volume provided (`redisinsight` in the command above).


Then, point your browser to `[http://localhost:5540](http://localhost:5540)`.
Next, point your browser to `[http://localhost:5540](http://localhost:5540)`.

RedisInsight also provides a health check endpoint at `http://localhost:5540/api/health/` to monitor the health of the running container.
27 changes: 13 additions & 14 deletions docs/install/install-redisinsight/install-on-k8s.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
---
Title: Install RedisInsight on Kubernetes
date: 2024-01-30 10:00:00
weight: 40
categories: ["RI"]
path: install/install-redisinsight/install-on-k8s/
altTag: Install RedisInsight on Kubernetes
title: "Install on Kubernetes"
linkTitle: "Install on Kubernetes"
weight: 3
description: >
How to install RedisInsight on Kubernetes
---
In this walkthrough, we will install RedisInsight on [Kubernetes](https://kubernetes.io/).
This tutorial shows how to install RedisInsight on [Kubernetes](https://kubernetes.io/) (K8s).
This is an easy way to use RedisInsight with a [Redis Enterprise K8s deployment](https://redis.io/docs/about/redis-enterprise/#:~:text=and%20Multi%2Dcloud-,Redis%20Enterprise%20Software,-Redis%20Enterprise%20Software).

## Create the RedisInsight deployment and service

Below is an annotated YAML file that will create a RedisInsight
deployment and a service in a k8s cluster.
deployment and a service in a K8s cluster.

1. Create a new file redisinsight.yaml with the content below
1. Create a new file named `redisinsight.yaml` with the content below.

```yaml
# RedisInsight service with name 'redisinsight-service'
Expand Down Expand Up @@ -69,13 +68,13 @@ spec:
emptyDir: {} # node-ephemeral volume https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
```
2. Create the RedisInsight deployment and service
2. Create the RedisInsight deployment and service:
```sh
kubectl apply -f redisinsight.yaml
```

3. Once the deployment and service are successfully applied and complete, access RedisInsight. This can be accomplished by using the `<external-ip>` of the service we created to reach redisinsight.
3. Once the deployment and service are successfully applied and complete, access RedisInsight. This can be accomplished by listing using the `<external-ip>` of the service we created to reach RedisInsight.

```sh
$ kubectl get svc redisinsight-service
Expand Down Expand Up @@ -255,11 +254,11 @@ spec:
kubectl apply -f redisinsight.yaml
```

{{< note >}}
{{< alert title="Note" >}}
If the deployment will be exposed by a service whose name is 'redisinsight', set `RI_APP_HOST` and `RI_APP_PORT` environment variables to override the environment variables created by the service.
{{< /note >}}
{{< /alert >}}

3. Once the deployment has been successfully applied and the deployment complete, access RedisInsight. This can be accomplished by exposing the deployment as a K8s Service or by using port forwarding, as in the example below:
3. Once the deployment has been successfully applied and the deployment is complete, access RedisInsight. This can be accomplished by exposing the deployment as a K8s Service or by using port forwarding, as in the example below:

```sh
kubectl port-forward deployment/redisinsight 5540
Expand Down

0 comments on commit dcc33b0

Please sign in to comment.