Install Redis on CentOS 7.5

Chưa phân loại
Redis is a quick database like server that can be used as a in memory cache or data store. Its very popular in the context of scalable websites because it can store data in memory and be sharded to store large volumes of data and provide lightening fast results to users on the world wide web. Today we will look at how to install Redis on CentOS 7.5 and get started with its usage.

Update Yum

First start by updating your system to keep other packages up to date with yum update.

Extra Packages for Enterprise Linux(EPEL)

Redis server is not in the default repository on a standard CentOS7 install, so we need to install the EPEL package to get access to more packages.

[root@centos7-linuxhint ~]# yum install epel-release

After installing epel, you need to run yum update again.

[root@centos7-linuxhint ~]# yum update

Install Redis Server Package

Now that the EPEL has been added a simple yum install command will install the redis server software.

[root@centos7-linuxhint ~]# yum -y install redis

After installation you will have redis-server and redis-cli commands in your system. And also you can see a redis service has been installed

Start the Redis Server

Even though technically you can start a redis server using the inbuilt commands, lets use the service that is provided with CentOS to do the start, stop and status of redis server on the system.

[root@centos7-linuxhint ~]# service redis start

It should be running now, check it with status command:

Storing and Retrieving Data

Ok, now that Redis is running, lets start with a trivial example and store a key and value pair and then see how to query it. We will use redis-cli with default options which will connect to a server on localhost and the default redis port. Also note in the real world, you should consider setting up proper security to your Redis instances.

We will use the set and get commands in order to store a key value pair in the server. Here is a screen shot of an example:

You can also use the inline help to get a list of all the possible commands and the help text with them. Enter interactive mode from the redis-cli and then type help as shown below:

Redis: More information

For more information check out the following links below:

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

How to use elementary OS file manager?

In the history of operating systems, getting a file manager was a remarkable achievement. It’s so important that even...

How to install Qt 5.9.1 (Qt Creator 4.3.1 included) on Ubuntu 17.04

Qt 5.9.1 the most recent release, is a cross-platform application framework that is widely used for developing apps with...

Install Sublime Text 3 on Ubuntu

Install Sublime Text 3 on Ubuntu 17.10 Sublime Text is a very popular text editor for programmers and developers. It supports...
Bài Viết

Bài Viết Mới Cập Nhật

Huớng dẫn dùng proxy cho ios, iphone 2023

Cách gắn set proxy cho điện thoại android, oppo, giả lập android, Ldplayer Bằng Proxydroid

Mua Proxy Socks5 VN Chơi Game Gia Lập Tăng Cường Trải Nghiệm Chơi Game

Mua Proxy Mỹ, Us Nuôi Tài Khoản Etsy, eBay Tìm Hiểu Về Mua Proxy Mỹ tại

Mua Proxy Game – Giải pháp tuyệt vời cho việc chơi game trên mạng mà không bị giới hạn về vị trí địa lý