Skip to content

Redis Installation ​

FastBee uses Redis for caching, sessions, and distributed coordination. The steps below use Docker as an example.

Prerequisites ​

  • Docker is installed.
  • The bridge network for inter-container communication exists: docker network create -d bridge fastbee-bridge
  • Host port 6379 is free; the /var/data/redis and /var/data/redis/data directories hold the configuration and data for persistence, and Docker creates them automatically when mounting.

Installing on an Operating System ​

There are plenty of similar tutorials and documents, and Windows and Linux have different installation methods, so they are not covered in detail here. The Docker-based installation is mainly introduced below.

Docker Installation ​

提示

Before running the container, if there is no bridge network, create one first for inter-container communication: docker network create -d bridge fastbee-bridge

Run the following command to install, where requirepass is the access password.

shell
docker run \
--name redis \
--publish 6379:6379 \
--volume /var/data/redis:/usr/local/etc/redis  \
--volume /var/data/redis/data:/data  \
--network fastbee-bridge \
--restart unless-stopped \
--detach \
redis:7.0.0 \
--requirepass "fastbee" \
--appendonly yes

Verification ​

shell
# Confirm the container is running
docker ps --filter name=redis

# Connect with the password and test; expected output: PONG
docker exec -it redis redis-cli -a "fastbee" ping

# Confirm AOF persistence is enabled; expected value: "yes"
docker exec -it redis redis-cli -a "fastbee" config get appendonly

Troubleshooting ​

IssuePossible CauseSolution
Container exits right after startupPort 6379 is occupied or the mounted directories lack permissionsRun docker logs redis to find the cause; adjust the --publish port or fix directory permissions
Client reports NOAUTHNo access password providedUse redis-cli -a or run AUTH first; the password in the application config must match --requirepass
The backend cannot reach RedisNetwork unreachable or password mismatchConfirm the backend can reach port 6379 on the Redis host; for containerized deployments join the fastbee-bridge network, and verify the password
Data lost after restartData directory not mounted or persistence not enabledKeep --volume /var/data/redis/data:/data and --appendonly yes