Linux install redis cli
Replace 12111 with the port number you have configured on nf file. semanage port -a -t redis_port_t -p tcp 12111 Run the following command and then restart the redis service. sudo nano /etc/nfĪfter changing the port, Save and close the file and restart the redis service for the changes to take effect.Īfter changing the port If you face issue as shown below, Creating Server TCP listening socket 0.0.0.0:12111: bind: Permission denied 127.0.0.1:6379> exit Running Redis on Custom PortĪs we know that Redis by default runs on the port 6379.For security reasons, If you wish to run redis server on different port. To exit from the redis-cli shell, Execute the command. You can check the details such as Number of clients connected with the redis server, Replication status, Memory & CPU used, Cluster status and much more. redis-cliĪnd run ping to test the connectivity from the redis shell.You should get a response as PONG.įrom this, We can confirm that the redis server is working as expected.įrom the redis shell, run info to get the overall status of the redis server. Run the below command to test the connectivity with the Redis server. We use redis-cli , the Redis command line interface, using which we can send command to the redis server and we can read the replies sent by the server from the terminal. netstat -nltp |grep redis Connecting Redis Now If you run the below command, You can see that redis will accept connections from any host. Replace bind 127.0.0.1 to 0.0.0.0 , Save and close the file.įor the changes the take effect, We need to restart the redis service.
To allow connections from the remote hosts, We need to edit nf file and configure as shown below.
Using the below command, You can check the same. redis-server -version redis-cli -versionīy default, Redis will be running on localhost and listening on port 6379. To check the version of redis installed on the system, Execute the following commands. To check the status of the redis service, systemctl status redisĮnable the redis service to automatically start on system reboot. To start the redis service, Execute the below command. You can find the rvice file under /usr/lib/systemd/system folder. Lets install redis on the system using the command, sudo yum install redis -yīy default, While installing redis It will automatically configure systemd service file for us to easily manage the redis service.
#LINUX INSTALL REDIS CLI UPDATE#
Then update the system using the below command. We have to add EPEL repository to the system in order to install Redis on the system. Update the default package repository to the latest available version using the below command. Installing Redis on Centos 7īefore proceeding further, Make sure you have root or sudo privileges to the system. In addition to being fully in-memory, Redis enables data persistence and high availability through replication and backups. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis is an open source, in-memory data structure store, used as a database, cache and message broker.
Okay, Lets get started with the installation of Redis on Centos 7.
I have also published articles which covers Installation and Configuration of Database engines on Ubuntu operating systems.Check it out.
#LINUX INSTALL REDIS CLI HOW TO#
In this article, We have explained how to Install Redis on Centos 7.