Skip to main content

Installing Redis in Linux Environment

MAKE SURE THE LINUX ENVIRONMENT IS CONNECTED-OUT TO THE INTERNET! MAKE SURE THAT THE LINUX ENVIRONMENT CAN COMMUNICATE WITH THE EBA SERVER'S ENVIRONMENT, CAN PING!

In order to install SSH in the linux environment:

sudo apt update sudo apt install openssh-server

The terminal for Redis setup opens:

1- sudo apt-get install redis 2- sudo service redis status 3- sudo nano /etc/redis/redis.conf

(This command will turn the terminal into a kind of text editor, make settings including bind, save, password, then ctrl+o and then save by pressing enter, exit the text editor with ctrl+x)

4- sudo ufw status verbose If it is not enabled, -> sudo ufw enabled (port connections can start to be blocked automatically, including ssh, you can also activate after the rule definitions below) If it is not installed -> sudo apt-get install ufw 5- sudo ufw allow {redisport}/tcp ---- Ex: sudo ufw allow 6379/tcp 6- sudo ufw allow 22/tcp (we allow ssh port) note: You can find more detailed rule definitions on the Internet (eg. Like allowing requests from specific IP) 7- sudo service redis restart 8- sudo service redis-server restart 9- sudo service redis-server status

Command guide for Redis flush

On a Linux system: redis-cli -h {redis bind ip} -p {redis port} -a {redis parola} flushall Ex: redis-cli -h 10.10.10.10 -p 6379 -a Bimser123 flushall

Open admin cmd from Windows system and redise on linux: 1- ssh linuxtakiusername@linuxIP 2- Enter the password, it will not show you the password but it will write it in the terminal 3- Redis-CLI -H {Redis Bind IP} -P {Redis Port} -A {Redis Password} Flushall Ex: redis-cli -h 10.10.10.10 -p 6379 -a Bimser123 flushall 4- exit

Or you can create bash file in linux environment

Open it to the terminal:

1- Which bash (shows where the file to be created will go) 2- Nano Flushall_Redis.sh (opens a text editor in this terminal. Type the flush information at the top, save it with ctrl+o, and exit with ctrl+x) 3- chmod +x Flushall_Redis.sh (this will convert the text you wrote into an executable bash script) 4- ./Flushall_Redis.sh (Executes the generated file) (You can also create a bash file to a specific file path if you want. you can find it on the Internet.)

In the Windows environment, also open cmd as admin and say:

1- ssh linuxusername@linuxIP 2- Enter the password, it will not show you the password but it will write it in the terminal 3- ./Flushall_Redis.sh (executes the script) 4- exit (exit ssh)