2022-03-16 14:19:34 +01:00
|
|
|
# Setup Redis
|
|
|
|
|
|
|
|
* update apt repository cache
|
|
|
|
```
|
|
|
|
sudo apt update
|
|
|
|
```
|
|
|
|
|
|
|
|
* install redis
|
|
|
|
```
|
|
|
|
sudo apt install redis-server --no-install-recommends
|
|
|
|
```
|
|
|
|
|
|
|
|
* check if service is running
|
|
|
|
```
|
|
|
|
systemctl status redis-server
|
|
|
|
```
|
|
|
|
|
|
|
|
* verify used port
|
|
|
|
```
|
2024-02-22 14:45:58 +01:00
|
|
|
ss -tlpn|grep 6379
|
2022-03-16 14:19:34 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
* create backup of default configuration
|
|
|
|
```
|
2024-02-22 14:45:58 +01:00
|
|
|
sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.bckp
|
2022-03-16 14:19:34 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
* open config file
|
|
|
|
```
|
|
|
|
sudo vi /etc/redis/redis.conf
|
|
|
|
```
|
|
|
|
|
2024-02-22 14:45:58 +01:00
|
|
|
* increase the memory of the server by adjusting the configuration file
|
2022-03-16 14:19:34 +01:00
|
|
|
```
|
2024-02-22 14:45:58 +01:00
|
|
|
maxmemory 500000000
|
2022-03-16 14:19:34 +01:00
|
|
|
maxmemory-policy allkeys-lru
|
|
|
|
```
|
|
|
|
|
|
|
|
* apply config changes
|
|
|
|
```
|
|
|
|
sudo systemctl restart redis-server
|
|
|
|
```
|
|
|
|
|
|
|
|
* test service sending ```ping``` using the client
|
|
|
|
```
|
|
|
|
redis-cli
|
|
|
|
```
|
|
|
|
|
|
|
|
# Other
|
|
|
|
|
|
|
|
* start service
|
|
|
|
```
|
|
|
|
sudo systemctl start redis-server
|
|
|
|
```
|
|
|
|
|
|
|
|
* enable service to start with the system
|
|
|
|
```
|
|
|
|
sudo systemctl enable redis-server
|
|
|
|
```
|