redis安装部署

卸载

查看redis进程关闭服务

[root@CentOS-003 src]# ps -ef | grep redis
root     1420426       1  0 10:18 ?        00:00:00 ./redis-server *:6379
root     1420476 1392800  0 10:18 pts/0    00:00:00 grep --color=auto redis
[root@CentOS-003 src]# pkill redis-server
[root@CentOS-003 src]# 

查找相关目录文件

[root@CentOS-003 /]# find /opt/ -path "*redis*"
/opt/redis-6.2.6.tar.gz
/opt/redis-6.2.6
/opt/redis-6.2.6/.github
/opt/redis-6.2.6/.github/ISSUE_TEMPLATE
/opt/redis-6.2.6/.github/ISSUE_TEMPLATE/bug_report.md

[root@CentOS-003 /]# find / -name redis
/var/lib/selinux/targeted/active/modules/100/redis
/usr/share/selinux/targeted/default/active/modules/100/redis
[root@CentOS-003 /]# 

删除相关目录文件

[root@CentOS-003 /]# rm -rf /opt/redis*

安装

Redis

1.上传文件并解压

[root@CentOS-004 ~]# cd /opt/
[root@CentOS-004 opt]# tar xzf redis-6.2.6.tar.gz

2.安装并复制配置文件

[root@CentOS-003 opt]#  cd redis-6.2.6/
[root@CentOS-003 redis-6.2.6]# make
[root@CentOS-003 redis-6.2.6]# make PREFIX=/usr/local/redis install
[root@CentOS-003 redis-6.2.6]# cp redis.conf /usr/local/redis/

[root@CentOS-003 redis]# /usr/local/redis/bin/redis-server /usr/local/redis/redis.conf
[root@CentOS-003 redis]# ln -s /usr/local/redis/bin/redis-server /usr/bin/redis-server

3.本地启动

[root@CentOS-003 redis-6.2.6]# cd /usr/local/redis		
[root@CentOS-003 redis]# ./bin/redis-server

4.后台启动

修改redis配置文件将daemonize设置为yes 

[root@CentOS-003 redis]# cd /usr/local/redis
[root@CentOS-003 redis]# vi redis.conf 

# By default Redis does not run as a daemon. Use 'yes' if you need it.

# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.

# When Redis is supervised by upstart or systemd, this parameter has no impact. daemonize no

设置密码登录

# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES # JUST COMMENT OUT THE FOLLOWING LINE.

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#bind 127.0.0.1 -::1

# The requirepass is not compatable with aclfile option and the ACL LOAD

# command, these will cause requirepass to be ignored.

#

requirepass 123456

启动

[root@CentOS-003 redis]# redis-server /usr/local/redis 

查看进程

ps -ef | grep -i redis

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值