How To Install Redis Server
Larn how to install Redis on Linux with this unproblematic tutorial. Redis is an open up-source database, precisely, it's an in-memory data construction store that can be used every bit a database, cache & message banker. Information technology does not possess the limits offered by the relational database & tin be used to store a vast corporeality of data, with support for a number of data structures like strings, hashes, lists, sets, sorted sets, bitmaps, hyper logs, etc.
Redis also provides a number of features like born replication (master-slave replication), Lua scripting, LRU eviction, transactions, and dissimilar levels of on-deejay persistence & also provides high availability.
Typical apply cases are session caching, total page cache, bulletin queue applications, leaderboards, and counting among others.
Recommended Read: Installing MEMCACHED in Ubuntu & RHEL/CentOS
Also Read: Install Varnish Enshroud for Apache Web Server to Speed upwardly Website
Install Redis on Linux
Pre-requisites
Before we can go along with the installation of Redis on our Centos/RHEL servers, we need to brand certain that the following packages must be installed on our systems,
1- CentOS/RHEL seven
We demand to install the following packages,
$ yum install wget gcc make
ii- CentOS/RHEL6
Install the following packages,
$ yum install tcl wget gcc brand
Stride 1- Downloading Redis
At the time of writing this tutorial, Redis 6.0.ten is the latest version. So to download the redis half dozen.0.ten, open up your final & execute the following command,
$ wget https://download.redis.io/releases/redis-vi.0.x.tar.gz
Next, we volition extract the downloaded tar package,
$ tar -xvf redis-6.0.10.tar.gz
Footstep 2- Compiling & Installing Redis
At present that we have extracted the bundle, we will compile & install Redis. Firstly, open up the extracted folder,
$ cd redis-6.0.10
& then goto folder 'deps',
$ cd deps
Now, nosotros volition compile the packages by executing the post-obit commands,
$ make hiredis lua jemalloc linenoise
$ make geohash-int
Next, we will move back to the primary directory i.e. 'redis-6.0.10'
$ cd ../
& will run 'make' & 'brand install' commands
$ brand
$ make installation
One time these commands have been executed, nosotros will move onto to installing the 'init' script.
Step 3- Installing init scripting
Init script volition setup a redis service with port number, config file, log file & a information directory. To run run init script,
$ cd utils\
& run the install_server.sh script,
$ ./install_server.sh
Nosotros will now be asked with some information regarding redis server, as shown beneath,
Welcome to the redis service installer
This script will assist you easily set up a running redis server
Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file proper noun [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Delight select the data directory for this case [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to arrest.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
For this installation, nosotros have used all the default settings, but we can modify any settings every bit per our need.
Notation:- Nosotros can also set upwards a number of redis instances by running this script once again & changing the port number for the new redis case.
Step iv- Starting the Redis service
To start the Redis service, the command is
$ service redis_6379 start
OR, run,
$ systemctl start redis_6379
If you lot are using more than ane redis instance or accept changed the port number for redis example, and then you tin supervene upon 6379 with the port number yous accept called to end/start the redis service.
Stride v- Checking if the Redis service is working
To login to redis server & bank check if redis is working fine, open up the terminal & run the command,
$ redis-cli
Once continued, you will go prompt like
127.0.0.1:6379>
We can now issue 'Ping' control & if the redis service is up, we will become 'PONG ' every bit a response,
127.0.0.one:6379> ping
PONG
Footstep six (OPTIONAL) Accessing redis from the remote system
By default, redis is accessible from localhost only if you wish to access redis server from a remote location then we need to make some changes in the configuration file. Open up the configuration file for the instance, i.eastward. /etc/6379.conf,
$ vi /etc/redis/6379.conf
& wait for 'bind 127.0.0.i'. Nosotros tin can either replace 127.0.0.1 with 0.0.0.0 or add IP address of our server to information technology. Information technology should look like
bind 0.0.0.0
or
bind 127.0.0.1 192.168.1.100
Now leave the file afterward saving the changes & restart the service for changes to take issue.
$ service redis_6379 restart
Remember if using multiple or different port numbers, changes are to made to all the configuration files for respective port numbers.
At present to check if we tin can log in to redis from a remote system, log in to remote system start & enter the post-obit control from the terminal,
$ redis-cli -h 192.168.1.100 -p 6379
where 192.168.ane.100 is the IP address of the Redis server with 6379 equally the Redis case port number.
This completes our tutorial on how to install Redis on Linux. For whatsoever queries or questions, you lot are most welcome to contact us using the comment box below.
If you lot remember we take helped you or simply want to back up us, delight consider these :-
Connect to us: Facebook | Twitter
Linux TechLab is thankful for your continued back up.
Source: https://linuxtechlab.com/how-install-redis-server-linux/
Posted by: haygoodcapaidep35.blogspot.com

0 Response to "How To Install Redis Server"
Post a Comment