Kategorie: Linux

Installation of Redis server in Debian 11

This guide describes how to install Redis server in Debian 11
We made in a few minutes using the console.

We log into the console and perform the installation:

apt-get install redis-server -y

We can check the service status by issuing an order:

systemctl status redis-server

Poniżej wynik:

? redis-server.service - Advanced key-value store
     Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2021-09-26 02:40:45 UTC; 3s ago
       Docs: http://redis.io/documentation,
             man:redis-server(1)
   Main PID: 379829 (redis-server)
     Status: "Ready to accept connections"
      Tasks: 5 (limit: 9510)
     Memory: 6.9M
        CPU: 62ms
     CGroup: /system.slice/redis-server.service
             ??379829 /usr/bin/redis-server 127.0.0.1:6379

Sep 26 02:40:45 debian11 systemd[1]: Starting Advanced key-value store...
Sep 26 02:40:45 debian11 systemd[1]: Started Advanced key-value store.

By default, Redis listens on port 6379. You can verify it using the following command:

To check the redis listening, we can execute the command:

ss -antpl | grep redis

We will see a similar log:

LISTEN 0      511        127.0.0.1:6379       0.0.0.0:*    users:(("redis-server",pid=379829,fd=6))                                                                                                      
LISTEN 0      1024       127.0.0.1:9121       0.0.0.0:*    users:(("redis_exporter",pid=14922,fd=3))                                                                                                     
LISTEN 0      511            [::1]:6379          [::]:*    users:(("redis-server",pid=379829,fd=7))  

We edit the redis configuration file:

nano /etc/redis/redis.conf

and add a sign # before. The whole should look like:

#bind 127.0.0.1 ::1

Thanks to this, our redis server will only listen locally.

We also set the amount of RAM in this file:

maxmemory 500mb 
maxmemory-policy allkeys-lru

We reboot:

systemctl restart redis-server

We can get to redis from the console by issuing a command:

redis-cli

Now for an example of operation.

issue the command:

127.0.0.1:6379> ping

We get the answer

PONG

So everything works perfectly fine.

Linux

Udostępnij
Opublikowane przez
Linux

Recent posts

KeePass2 2.52 w Ubuntu 22.04

The guide below describes how to install KeePass on Ubuntu. Całość wykonamy za pomocą kilku poleceń

2 years temu

Installing Master PDF editor in Ubuntu 22.04

Master PDF Editor is a comprehensive PDF program, which includes many features. Oprócz tworzenia i edycji

2 years temu

iotop - memory monitoring

Iotop jest prostym narzędziem dla systemów Uniksowych umożliwiającym monitorowanie użycia dowolnego nośnika pamięci flash/hdd/ssd w

2 years temu

Run multiple commands in one cron job

You can separate two or more commands with semicolons (;), Semicolon (;): służy do oddzielania

2 years temu

Changing the exif data of a photo in the Linux terminal

Poniższy poradnik opisuje w jaki sposób za pomocą konsoli możemy dokonać edycji danych zdjęcia exif.

2 years temu

Installing Rocket.Chat Server on Rocky Linux 8

The following guide describes how to install Rocket.Chat on Rocky Linux 8 Całość bardzo prosto zainstalujemy

2 years temu