Linux安装Redis
1.下载redis
http://download.redis.io/releases/
2. 解压
cd /root/tools/redis
[root@hadoop3 redis]# tar -zxvf redis-5.0.14.tar.gz
3. 切换到目录下
[root@hadoop3 redis-5.0.14]#make
[root@hadoop3 redis-5.0.14]#make install
4. 查看redis的可执行文件
[root@hadoop3 redis-5.0.14]# ls /usr/local/bin/
redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server
5. 配置redis
[root@hadoop3 redis]# cp redis.conf /etc/redis6379.conf
6. 创建日志文件
[root@hadoop3 redis-5.0.14]# mkdir -p /var/log/redis/log
7. 启动redis并指定redis日志文件
# /usr/local/bin/redis-server /etc/redis6379.conf 1>/var/log/redis/redis.log 2>/var/log/redis/redis.log &
8. 查看启动
[root@hadoop3 ~]# lsof -i:6379
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
redis-ser 38111 root 6u IPv4 304869 0t0 TCP localhost:6379 (LISTEN)
9. 客户端连接redis,测试redis
[root@hadoop3 redis-5.0.14]# redis-cli
127.0.0.1:6379> set redisKey value
OK
127.0.0.1:6379> get redisKey
"value"
127.0.0.1:6379> del redisKey
(integer) 1
redis6.2.6 redis服务端相关配置