Home  >  Article  >  Database  >  How to use RPM package to install redis in CentOS

How to use RPM package to install redis in CentOS

WBOY
WBOYforward
2023-05-26 11:47:481419browse

Redis is a high-performance key-value database. The emergence of redis has largely compensated for the shortcomings of keyvalue storage such as memcached, and can play a very good supplementary role to relational databases in some situations.

How to use RPM package to install redis in CentOS

Preliminary preparation

Platform: centos 6.5 x86_64

Installation: redis-3.0.7-4.el6.art.x86_64. rpm

Download rpm package

Open the address http://pkgs.org/download/redis and enter to download the corresponding rpm package according to your own Linux platform and the redis version that needs to be installed. Here we Take redis 3.0.7 as an example to install:

[root@21yunwei src]#  wget   http://www6.atomicorp.com/channels/atomic/centos/6/x86_64/RPMS/redis-3.0.7-4.el6.art.x86_64.rpm

Installation

[root@21yunwei src]# rpm  -ivh  redis-3.0.7-4.el6.art.x86_64.rpm

You need to pay attention here. If it is a new system or the jemalloc library is not installed, an error will usually be reported:

[root@21yunwei src]# rpm  -ivh  redis-3.0.7-4.el6.art.x86_64.rpmwarning: redis-3.0.7-4.el6.art.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 4520afa9: NOKEY
error: Failed dependencies:
libjemalloc.so.1()(64bit) is needed by redis-3.0.7-4.el6.art.x86_64

Solution:

yum install epel-release  -y
yum install jemalloc -y

Install again, problem solved:

[root@21yunwei src]# rpm   -ivh    redis-3.0.7-4.el6.art.x86_64.rpmwarning: redis-3.0.7-4.el6.art.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 4520afa9: NOKEY
Preparing...                ########################################### [100%]  1:redis                  ########################################### [100%]

Run and set up auto-start

Start the newly installed redis:

[root@21yunwei src]# /etc/init.d/redis  startStarting redis-server:                                     [  OK  ]

Set up self-start

[root@21yunwei src]# chkconfig  redis on

The redis installed here has not been set or optimized, and is the default; the specific use still needs to be adjusted according to your own business needs or security settings.

The above is the detailed content of How to use RPM package to install redis in CentOS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete