Skip to content

Commit

Permalink
add more instruction for the redis deployment (sotopia-lab#45)
Browse files Browse the repository at this point in the history
* add more instruction for the redis deployment

* Update all_the_issues.md

* Update all_the_issues.md

* Update all_the_issues.md

* fix pre-commit bug

* Update all_the_issues.md

* make it as a new question

---------

Co-authored-by: Hao Zhu <prokilchu@gmail.com>
  • Loading branch information
lwaekfjlk and ProKil authored Apr 15, 2024
1 parent c50169b commit f5caafb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/all_the_issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,20 @@ Then you can start your database with:
sudo docker run -d -e REDIS_ARGS="--requirepass QzmCUD3C3RdsR" --name redis-stack -p 6379:6379 -p 8001:8001 -v /home/ubuntu/redis-data/:/data/ redis/redis-stack:latest
```

Redis saves snapshots of the database every few minutes. You can find them in the corresponding folder (for example, `\data\dump.rdb`). Use the `sudo docker cp <container_id>:/data/dump.rdb /tmp` to obtain the snapshot from the container (in this case, the copied data is stored in `/tmp/snap-private-tmp/snap.docker/tmp`).
Redis saves snapshots of the database every few minutes. You can find them in the corresponding folder (for example, `./data/dump.rdb`). Use the `sudo docker cp <container_id>:/data/dump.rdb /tmp` to obtain the snapshot from the container (in this case, the copied data is stored in `/tmp/snap-private-tmp/snap.docker/tmp`).

## Why I am facing authorization error when fetching data from hosted redis server?

When utilizing the database in python code (as introduced in [here](https://github.com/sotopia-lab/sotopia/blob/main/notebooks/redis_stats.ipynb)), make sure you use in the command line:

```sh
export REDIS_OM_URL="redis://:QzmCUD3C3RdsR@localhost:6379"
```

If you plan to add environmental variables in the python code like this:

```sh
os.environ['REDIS_OM_URL'] = "redis://:QzmCUD3C3RdsR@localhost:6379"
```

We need to make sure this line of code is put before `import redis` to make sure that you will not face additional authorization error.

0 comments on commit f5caafb

Please sign in to comment.