Linux安装启动Redis

#make进行编译
[liangjiaojiao@hadoop100 redis-6.2.1]$ make

一、错误1

#执行命令完成安装
make MALLOC=libc

二、 错误

步骤:1.cd 到redis文件中的src目录
           2.chmod +x mkreleasehdr.sh
           3.make 

三、编译成功

四、安装

make install

 五、验证 【默认安装在/usr/local/bin】

[root@hadoop100 redis-6.2.1]# cd /usr/local/bin
[root@hadoop100 bin]# ls
redis-benchmark  redis-check-aof  redis-check-rdb  redis-cli  redis-sentinel  redis-server

六、推荐使用后台启动

即先将redis-6.2.1文件下的redis.conf复制到其它目录

[root@hadoop100 redis-6.2.1]# ls
00-RELEASENOTES  COPYING   MANIFESTO   runtest-cluster    src
BUGS             deps      README.md   runtest-moduleapi  tests
CONDUCT          INSTALL   redis.conf  runtest-sentinel   TLS.md
CONTRIBUTING     Makefile  runtest     sentinel.conf      utils
[root@hadoop100 redis-6.2.1]# cp redis.conf /etc/redis.conf

 后台启动设置 daemonize no 改成 yes

#启动
[root@hadoop100 bin]# redis-server /etc/redis.conf
#查看进程状态-》是否启动成功
[root@hadoop100 bin]# ps -ef | grep redis
liangji+   6301      1  0 19:37 ?        00:00:07 file-roller /home/liangjiaojiao/下载/redis6.2.1安装文件.zip
root      12165      1  0 20:55 ?        00:00:00 redis-server 127.0.0.1:6379
root      12187  11183  0 20:56 pts/7    00:00:00 grep --color=auto redis

#用客户端访问 redis-cli
[root@hadoop100 bin]# redis-cli
127.0.0.1:6379> ping
PONG

七、Redis关闭

#方法一:杀掉进程
[root@hadoop100 bin]# ps -ef | grep redis
liangji+   6301      1  0 19:37 ?        00:00:07 file-roller /home/liangjiaojiao/下载/redis6.2.1安装文件.zip
root      12318      1  0 21:00 ?        00:00:00 redis-server 127.0.0.1:6379
root      12329  11183  0 21:00 pts/7    00:00:00 grep --color=auto redis
[root@hadoop100 bin]# kill -9 12318
[root@hadoop100 bin]# ps -ef | grep redis
liangji+   6301      1  0 19:37 ?        00:00:07 file-roller /home/liangjiaojiao/下载/redis6.2.1安装文件.zip
root      12345  11183  0 21:00 pts/7    00:00:00 grep --color=auto redis
#方法二:单实例关闭 redis-cli shutdown
[root@hadoop100 bin]# ps -ef | grep redis
liangji+   6301      1  0 19:37 ?        00:00:07 file-roller /home/liangjiaojiao/下载/redis6.2.1安装文件.zip
root      12626      1  0 21:19 ?        00:00:00 redis-server 127.0.0.1:6379
root      12659  11183  0 21:19 pts/7    00:00:00 grep --color=auto redis
[root@hadoop100 bin]# redis-cli
127.0.0.1:6379> shutdown
not connected> 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值