欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Redis单机安装部署

程序员文章站 2022-03-10 10:36:37
...

1、创建目录

/opt/softWare/redis5.0.5

2、解压压缩包

[aaa@qq.com redis5.0.5]# tar -zxvf redis-5.0.5.tar.gz

Redis单机安装部署

3、编译安装

[aaa@qq.com redis5.0.5]# cd redis-5.0.5/

[aaa@qq.com redis-5.0.5]# ls
00-RELEASENOTES  CONTRIBUTING  deps     Makefile   README.md   runtest          runtest-moduleapi  sentinel.conf  tests
BUGS             COPYING       INSTALL  MANIFESTO  redis.conf  runtest-cluster  runtest-sentinel   src            utils

[aaa@qq.com redis-5.0.5]# make && make install PREFIX=/opt/softWare/redis5.0.5/redis-5.0.5

Redis单机安装部署

Redis单机安装部署

Redis单机安装部署

4、修改配置文件

#绑定主机iP
bind 192.168.230.21
#设置端口号
port 6379
#启用后台运行
daemonize yes
#修改redis库的数量,默认16
databases 32
#设置redis密码
requirepass 123456

5、启动

[aaa@qq.com redis-5.0.5]# cd bin/
[aaa@qq.com bin]# ls
redis-benchmark  redis-check-aof  redis-check-rdb  redis-cli  redis-sentinel  redis-server
[aaa@qq.com bin]# ./redis-server ../redis.conf 
7089:C 31 Mar 2020 08:53:08.776 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
7089:C 31 Mar 2020 08:53:08.776 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=7089, just started
7089:C 31 Mar 2020 08:53:08.776 # Configuration loaded
[aaa@qq.com bin]# netstat -lnp | grep 6379
tcp        0      0 192.168.230.21:6379     0.0.0.0:*               LISTEN      7090/./redis-server 

6、客户端连接

[aaa@qq.com bin]# ./redis-cli -h 192.168.230.21 -a 123456
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
192.168.230.21:6379> DBSIZE
(integer) 0
192.168.230.21:6379> select 31
OK
192.168.230.21:6379[31]> DBSIZE
(integer) 0
192.168.230.21:6379[31]> set aa AA
OK
192.168.230.21:6379[31]> get aa
"AA"
192.168.230.21:6379[31]>

 

相关标签: Redis