This commit is contained in:
2024-04-19 10:27:36 +02:00
parent fcb6bbe566
commit 35c96e715c
7852 changed files with 4815 additions and 8 deletions

View File

@ -0,0 +1,3 @@
Additional permission under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or combining it with [name of library] (or a modified version of that library), containing parts covered by the terms of [name of library's license], the licensors of this Program grant you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of [name of library] used as well as that of the covered work.

View File

@ -0,0 +1,43 @@
![redis](./img/logo.png)
# Redis
Redis is a versatile and fast data store that supports strings, hashes, lists, sets, streams, and more. It also offers programmability, extensibility, persistence, clustering, and high availability features, as well as Redis Stack for modern data models and processing engines.
# Management UI
Redis Commander is a web-based management tool for Redis. It is a simple and intuitive tool that allows you to interact with Redis, monitor key space, and execute commands.
Navigate to http://localhost:8081 to access the Redis Commander UI.
![redis-commander](./img/ui.png)
## Prerequisites
- Docker
- Docker Compose
## Running the Stack
### Standalone
Inside the `standalone` directory, run `docker-compose up` to start the connector.
### Port Configurations
- `6379` - Master Redis port
- `6380` - Slave Redis port
### Configuration
All the configurations are available in the `standalone/conf` directory.
- `redis.conf` - Master Redis configuration file
- `redis-replica.conf` - Replica Redis configuration file
- `redis-commander.json` - Redis Commander configuration file
### Data Persistence
- `standalone/data` - Master Redis data directory
- `standalone/data-replica` - Replica Redis data directory

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

View File

@ -0,0 +1,4 @@
data
data-replica
.conf

View File

@ -0,0 +1,18 @@
{
"connections": [
{
"label": "standalone",
"host": "redis",
"port": 6379,
"password": "password",
"dbIndex": 0
},
{
"label": "replica",
"host": "redis-replica",
"port": 6379,
"password": "password",
"dbIndex": 0
}
]
}

View File

@ -0,0 +1,30 @@
# All option are available at https://redis.io/docs/management/config-file/
# Bind to all interfaces
bind 0.0.0.0
# Specify the port for Redis to listen on
port 6379
# Enable slave mode
replicaof redis 6379
# Enable persistence
appendonly yes
# Set the path to the appendonly file
appendfilename "appendonly.aof"
# Set the path to the directory containing the appendonly file
dir /data-replica
# Set the path to the dump file
dbfilename "dump.rdb"
# Set the path to the directory containing the dump file
dir /data-replica
# Optional: Set a password for authentication
masterauth password
requirepass password

View File

@ -0,0 +1,29 @@
# All option are available at https://redis.io/docs/management/config-file/
# Bind to all interfaces
bind 0.0.0.0
# Specify the port for Redis to listen on
port 6379
# Enable master mode
# replica-serve-stale-data no
# replica-read-only yes
replication-mode master
# Enable persistence
appendonly yes
# Set the path to the appendonly file
appendfilename "appendonly.aof"
# Set the path to the directory containing the appendonly file
dir /data
# Set the path to the dump file
dbfilename "dump.rdb"
# Set the path to the directory containing the dump file
dir /data
# Optional: Set a password for authentication
requirepass password

View File

@ -0,0 +1,49 @@
version: '3.9'
services:
redis:
build:
context: ./docker
dockerfile: redis.Dockerfile
container_name: redis
ports:
- '6379:6379'
volumes:
- ./data:/data
- .conf/redis.conf:/usr/local/etc/redis/redis.conf
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
healthcheck:
test: redis-cli ping
start_period: 15s
interval: 5s
timeout: 10s
retries: 5
redis-replica:
build:
context: ./docker
dockerfile: redis.Dockerfile
container_name: redis-replica
ports:
- '6380:6379'
volumes:
- ./data-replica:/data
- .conf/redis-replica.conf:/usr/local/etc/redis/redis.conf
command: ["redis-server", "/usr/local/etc/redis/redis.conf", "--slaveof", "redis", "6379"]
healthcheck:
test: redis-cli ping
start_period: 15s
interval: 5s
timeout: 10s
retries: 5
redis-commander:
container_name: redis-commander
hostname: redis-commander
image: ghcr.io/joeferner/redis-commander:latest
restart: always
volumes:
- ./conf/redis-commander.json:/redis-commander/config/local-production.json
ports:
- "8081:8081"

View File

@ -0,0 +1 @@
FROM redis:latest