赞
踩
目录
注意:安装redis前要安装jdk。
- [root@lxm148 install]# tar -zxf redis-5.0.8.tar.gz -C /opt/soft/
-
- [root@lxm148 install]# cd /opt/soft/
-
- [root@lxm148 soft]# ls
- flume190 hadoop313 hive312 jdk180 mysql8 redis-5.0.8
-
- [root@lxm148 soft]# cd redis-5.0.8/
[root@lxm148 redis-5.0.8]# yum install -y gcc-c++
查看gcc是否安装成功:gcc -v
[root@lxm148 redis-5.0.8]# make
执行成功。
make install检查:
安装成功。
来到redis默认安装路径
- [root@lxm148 redis-5.0.8]# cd /usr/local/bin/
-
- [root@lxm148 bin]# ls
- redis-benchmark redis-check-rdb redis-sentinel
- redis-check-aof redis-cli redis-server
-
- [root@lxm148 bin]# mkdir config
-
- [root@lxm148 bin]# cp /opt/soft/redis-5.0.8/redis.conf ./config/
-
- [root@lxm148 bin]# cd config/
-
- [root@lxm148 config]# ls
- redis.conf
- [root@lxm148 config]# vim redis.conf
-
- 69 # bind 127.0.0.1 # 将69行注释掉
-
- 88 protected-mode no # 将安全模式改为no
-
- 136 daemonize yes
来到/usr/local/目录下,执行以下命令:
- # 开启redis服务
- [root@lxm148 local]# ./bin/redis-server ./bin/config/redis.conf
- 20118:C 12 May 2023 22:42:15.938 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
- 20118:C 12 May 2023 22:42:15.938 # Redis version=5.0.8, bits=64, commit=00000000, modified=0, pid=20118, just started
- 20118:C 12 May 2023 22:42:15.938 # Configuration loaded
-
- # 开启redis客户端,执行命令测试
- [root@lxm148 local]# ./bin/redis-cli -p 6379
- 127.0.0.1:6379> ping
- PONG
- 127.0.0.1:6379> set name zhangsan
- OK
- 127.0.0.1:6379> get name
- "zhangsan"
- 127.0.0.1:6379> keys *
- 1) "name"
- 127.0.0.1:6379>
- [root@lxm148 ~]# ps -ef |grep redis
- root 20119 1 0 22:42 ? 00:00:00 ./bin/redis-server 127.0.0.1:6379
- root 20123 14840 0 22:42 pts/1 00:00:00 ./bin/redis-cli -p 6379
- root 20149 20129 0 22:45 pts/2 00:00:00 grep --color=auto redis
- 127.0.0.1:6379> shutdown
- not connected> exit
-
- # 检查redis进行是否关闭
- [root@lxm148 local]# ps -ef | grep redis
- root 20152 14840 0 22:46 pts/1 00:00:00 grep --color=auto redis
开启redis服务,输入下面的命令进行redis的性能测试
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。