Skip to content

Commit 8f50914

Browse files
author
Simon Prickett
committed
Updated setup steps for Redis Stack.
1 parent e06f224 commit 8f50914

File tree

1 file changed

+14
-40
lines changed

1 file changed

+14
-40
lines changed

README.md

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,15 @@ Spotted an error in a text segment, image or video transcript? Please [report a
88

99
## Environment Setup
1010

11-
To get the most from this course and follow along with the sample code, you'll need to have access to a Redis 7 server and have Python 3 installed.
11+
To get the most from this course and follow along with the sample code, you'll need to have access to a Redis Stack 7 server and have Python 3 installed.
1212

1313
### Prerequisites
1414

1515
In order to run the sample code, you will need:
1616

1717
* [Python 3](https://www.python.org/downloads/).
1818
* Ability to run the `pip` command for Python 3.
19-
* Access to a local or remote installation of [Redis](https://redis.io/download) version 6.2 or newer (local preferred). We've provided a Docker Compose file to make this easy for you. If you don't want to use Docker, [follow the instructions here](https://redis.io/docs/getting-started/) to install Redis using a package manager.
20-
21-
If you're using Windows, check out the following resources for help with running Redis:
22-
23-
* [Video - Installing Redis on Windows 10](https://www.youtube.com/watch?v=_nFwPTHOMIY)
24-
* [Redis Blog - Running Redis on Windows 10](https://redis.com/blog/redis-on-windows-10/)
25-
* [Microsoft - Windows Subsystem for Linux Installation Guide for Windows 10](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
19+
* Access to a local or remote installation of [Redis Stack](https://redis.io/docs/getting-started/install-stack/). (local preferred). We've provided a Docker Compose file to make this easy for you. If you don't want to use Docker, [follow the instructions here](https://redis.io/docs/getting-started/install-stack/) to install Redis Stack using a package manager.
2620

2721
### Setup
2822

@@ -38,9 +32,9 @@ pip install -r requirements.txt
3832

3933
**Note:** Ensure you activate your virtual environment in each new shell/terminal session before running any of the sample code.
4034

41-
#### Starting Redis (Docker)
35+
#### Starting Redis Stack (Docker)
4236

43-
If you're using Docker to Run Redis, start it like this:
37+
If you're using Docker to Run Redis Stack, start it like this:
4438

4539
```bash
4640
docker-compose up -d
@@ -60,54 +54,32 @@ When you are done with the container, you can shut it down like this:
6054
docker-compose down
6155
```
6256

63-
Redis will persist your data to an append only file in the `redisdata` folder, so it will be there the next time you start the container. To erase it, use `rm -rf redisdata`.
64-
65-
#### Starting Redis (when installed by a Package Manager)
66-
67-
If you installed Redis using a package manager, start the Redis server if it isn't already running. For example, if you installed Redis with the Homebrew package manager for macOS you'd start it like this:
68-
69-
```bash
70-
brew services start redis
71-
```
72-
73-
You can now run `redis-cli` to connect to Redis as follows:
74-
75-
```bash
76-
docker exec -it redis_ru202 redis-cli
77-
```
78-
79-
Type `quit` to exit `redis-cli` back to your shell.
80-
81-
When you are done with Redis, you can optionally turn off the server. For example if Redis was installed with the Homebrew package manager for macOS you'd stop the server like this:
82-
83-
```bash
84-
brew services stop redis
85-
```
57+
Redis Stack will persist your data to an append only file in the `redisdata` folder, so it will be there the next time you start the container. To erase it, use `rm -rf redisdata`.
8658

8759
### Configuration
8860

89-
By default, the code will assume that Redis is available on `localhost` at port `6379`. If your Redis instance is running elsewhere, you will need to set the `REDIS_HOST` and/or `REDIS_PORT` environment variables. For example, here's how to configure these to connect to Redis on `myredishostname` port `6380`:
61+
By default, the code will assume that Redis Stack is available on `localhost` at port `6379`. If your Redis Stack instance is running elsewhere, you will need to set the `REDIS_HOST` and/or `REDIS_PORT` environment variables. For example, here's how to configure these to connect to Redis Stack on `myredishostname` port `6380`:
9062

9163
```bash
9264
export REDIS_HOST=myredishostname
9365
export REDIS_PORT=6380
9466
```
9567

96-
If your Redis instance requires a password to connect, also set the `REDIS_PASSWORD` environment variable:
68+
If your Redis Stack instance requires a password to connect, also set the `REDIS_PASSWORD` environment variable:
9769

9870
```bash
9971
export REDIS_PASSWORD=secret123
10072
```
10173

102-
If you are using Redis 6 or 7 and need to supply a user name when connecting, you should set the `REDIS_USER` environment variable:
74+
If you need to supply a user name when connecting, you should set the `REDIS_USER` environment variable:
10375

10476
```bash
10577
export REDIS_USER=student
10678
```
10779

108-
### Test Your Connection to Redis
80+
### Test Your Connection to Redis Stack
10981

110-
To test your Redis connection and Python environment, run:
82+
To test your Redis Stack connection and Python environment, run:
11183

11284
```bash
11385
python test_connection.py
@@ -117,15 +89,17 @@ If this command outputs `True`, then you are setup and ready to run the example
11789

11890
### Running the Example Code
11991

120-
Throughout the course, you will be asked to run the example code for the various exercises. Some of these require you to open multiple shell/terminal sessions. Don't forget to start your Python virtual environment in each new shell session. You'll also need to set the environment variables `REDIS_HOST`, `REDIS_PORT` and optionally `REDIS_USER` and `REDIS_PASSWORD` if your Redis instance is not running on `localhost:6379`.
92+
Throughout the course, you will be asked to run the example code for the various exercises. Some of these require you to open multiple shell/terminal sessions. Don't forget to start your Python virtual environment in each new shell session. If your Redis Stack instance is not running on `localhost:6379` then you'll also need to set the environment variables `REDIS_HOST`, `REDIS_PORT` and optionally `REDIS_USER` and `REDIS_PASSWORD`.
12193

12294
### Optional (but recommended!): RedisInsight
12395

12496
RedisInsight is a graphical management tool for Redis. It allows you to view and edit data in Redis, and contains specialized views for looking at the contents of Redis Streams.
12597

12698
You don't need to install or use RedisInsight to be successful with this course, but we'd recommend you give it a try.
12799

128-
[Download RedisInsight here](https://redis.com/redis-enterprise/redis-insight/) (it's free!). Once installed, add a new Redis database and supply the hostname, port and optionally password for the Redis instance that you're using for this course (this will usually be `localhost`, `6379` and no password).
100+
[Download RedisInsight here](https://redis.com/redis-enterprise/redis-insight/) (it's free!). Once installed, add a new Redis database and supply the hostname, port and optionally username and password for the Redis instance that you're using for this course (this will usually be `localhost`, `6379` and no username or password).
101+
102+
If you're using the Docker Compose file provided with this course, you can also try out a limited version of RedisInsight in your browser by visiting `http://localhost:8081` - this version can only connect to the Redis Stack instance in the Docker container. Use the Desktop version of RedisInsight to manage connections to multiple remote and/or local Redis instances.
129103

130104
## Questions?
131105

0 commit comments

Comments
 (0)