首页 > 系统服务 > 详细

linux中Redis单机安装

时间:2020-09-30 17:10:40      阅读:64      评论:0      收藏:0      [点我收藏+]

Redis安装

Linux版本:CentOS release 6.9

Redis 版本:redis-3.2.12.tar.gz

默认端口:6379

1、执行解压命令

tar -xzf redis-3.2.12.tar.gz

技术分享图片

2、执行编译命令

make MALLOC=libc

技术分享图片

 

 

 技术分享图片

3、执行安装到指定目录命令,此次指定目录为 /my/mysys/redis

make PREFIX=/my/mysys/redis install

技术分享图片

完成后目录结构

技术分享图片

4、配置文件 复制配置文件到安装目录

mv /my/mysys/redis-3.2.12/redis.conf ./

技术分享图片

 

 

 5、修改配置文件

将其中的"daemonize no"行改为"daemonize yes",让其在后台运行

6、启动redis

redis目录中执行启动命令   ./bin/redis-server redis.conf

技术分享图片

 

 

 7、测试连接到redis

redis目录中执行连接命令 ./bin/redis-cli -p 6379

技术分享图片

 

 

 8、关闭redis

redis目录中执行关闭命令 ./bin/redis-cli -p 6379 shutdown

技术分享图片

 

 

*可能出现的问题

1缺少gcc命令

技术分享图片

解决方法

技术分享图片

2、错误:jemalloc/jemalloc.h

 

技术分享图片

 

解决

技术分享图片

 

 技术分享图片

 

 

配置文件

bind *
protected-mode no
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
supervised no
pidfile /etc/redis/redis.pid
loglevel notice
logfile ""
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./
slave-serve-stale-data yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
slave-priority 100
maxmemory 500mb
maxmemory-policy noeviction
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes
requirepass 123456

 

 

linux中Redis单机安装

原文:https://www.cnblogs.com/xuchen0117/p/13754697.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!