How to install Redis 3.2 on CentOS 6 and 7

What is Redis?

Redis is a flexible open-source, key value data store, used as a database, cache and message broker. Redis allows the user to store vast amounts of data without the limits of a relational database.
In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log. Persistence can be optionally disabled, if you just need a feature-rich, networked, in-memory cache.

Install necessary packages

On CentOS 6:

yum install wget make gcc tcl

 

On CentOS 7

yum install wget make gcc

 

Install Redis 3.2

For installing Redis 3.2 you have to download the source file and compile it because Redis 3.2 is not available in any repository yet.

On CentOS 6 and CentOS 7

wget http://download.redis.io/releases/redis-3.2.8.tar.gz

 

Now you have to extract the file that you just downloaded by typing:

tar -xvzf redis-3.2.8.tar.gz

 

Change directory with the command below:

cd redis-3.2.8

 

It’s time to compile your Redis step by step:

cd deps
make hiredis lua jemalloc linenoise
make geohash-int

 


Now run below command to get back to the parent directory and run the next command:

cd ../
make
make install

 


And for getting sure running a test:

make test

 

It’s going to take a few minutes, you can check that everything is ok.

Install init script

In this section, we are going to install “init script” to manage the process of Redis.

cd utils

./install_server.sh

 


You will be prompt for some configuration you can hit “Enter” to accept all the default values or you can set yours.

Finally, your Redis server is installed and you can start the service by the command below:

For CentOS 6

service redis_6379 start

 

For CentOS 7

systemctl start redis_6379

 

If you want to test your Redis server you can easily use the instruction below:

redis-cli
> set test "HugeServer"
> get test

 

 

The answer should be “HugeServer”

If you need a control panel for your Redis Server you may use Phpredmin or Redmon

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值