CentOS7下安装Redis服务

1、查看Redis安装源

yum search redis
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
==================================================================================== N/S matched: redis =====================================================================================
collectd-redis.x86_64 : Redis plugin for collectd
collectd-write_redis.x86_64 : Redis output plugin for collectd
hiredis.x86_64 : Minimalistic C client library for Redis
hiredis-devel.x86_64 : Development files for hiredis
opensips-redis.x86_64 : Redis connector
pcp-pmda-redis.x86_64 : Performance Co-Pilot (PCP) metrics for Redis
perl-Apache-Session-Redis.noarch : Redis driver for Apache::Session::NoSQL
perl-Redis.noarch : Perl binding for Redis database
php-nrk-Predis.noarch : PHP client library for Redis
php-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store
php-phpiredis.x86_64 : Client extension for Redis
python-redis.noarch : Python 2 interface to the Redis key-value store
python-trollius-redis.noarch : Redis client for the Python event loop PEP3156 for Trollius.
python2-django-redis.noarch : Full featured redis cache backend for Django
redis-trib.noarch : Cluster management script for Redis
rubygem-redis.noarch : A Ruby client library for Redis
rubygem-redis-doc.noarch : Documentation for rubygem-redis
syslog-ng-redis.x86_64 : redis support for syslog-ng
uwsgi-logger-redis.x86_64 : uWSGI - redislog logger plugin
uwsgi-router-redis.x86_64 : uWSGI - Plugin for Redis router support
redis.x86_64 : A persistent key-value database

  Name and summary matches only, use "search all" for everything.
redis.x86_64 : A persistent key-value database

  Name and summary matches only, use "search all" for everything.

 

如果Redis安装源不存在,先下载安装源信息

#下载fedora的epel仓库
yum install epel-release

2、安装Redis

yum install redis.x86_64 -y

3、配置Redis

vim /etc/redis.conf

4、配置访问密码

################################## SECURITY ###################################
requirepass password

5、查看Redis后台访问进程

ps aux|grep redis
root     32523  0.0  0.3 142956  5816 pts/1    Sl   16:18   0:00 redis-server 127.0.0.1:6379
root     32566  0.0  0.0 112704   976 pts/1    R+   16:30   0:00 grep --color=auto redis

root     32566  0.0  0.0 112704   976 pts/1    R+   16:30   0:00 grep --color=auto redis

6、杀掉原有Redis进程

kill -9 32523

7、加载有密码的Redis,必须加载配置文件启动Redis进程,否则密码不生效。

redis-server /etc/redis.conf &

8、访问Redis服务器

redis-cli

9、查看全部Key信息

127.0.0.1:6379> keys *

提示

(error) NOAUTH Authentication required.

10、输入密码访问

auth password

提示

OK

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值