您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
本文教你如何在 CentOS for Linux 系统上安装Redis。 |
Linux下载 redis地址:
wget http://download.redis.io/releases/redis-5.0.8.tar.gz
先在 opt目录下建立一个软件包上传文件夹 :
mkdir /opt/software
把 redis-5.0.8.tar.gz 上传到 /opt/software/
安装 gcc编译环境,用来执行make 命令:
yum -y install gcc gcc-c++
tar -xzvf redis-5.0.8.tar.gz
mv /opt/software/redis-5.0.8 /usr/local/src/
make
make install PREFIX=/usr/local/redis
mkdir /etc/redis/
cp /usr/local/src/redis-5.0.8/redis.conf /etc/redis/
vim /etc/redis/redis.conf
bind 0.0.0.0 protected-mode no port 6379 tcp-backlog 511 timeout 0 tcp-keepalive 300 daemonize yes supervised no pidfile /var/run/redis_6379.pid loglevel notice logfile /var/log/redis/redis_master.log databases 16 always-show-logo yes save 900 1 save 300 10 save 60 10000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir /opt/redis_data replica-serve-stale-data yes replica-read-only yes repl-diskless-sync no repl-diskless-sync-delay 5 repl-disable-tcp-nodelay no replica-priority 100 maxmemory 10000000kb lazyfree-lazy-eviction no lazyfree-lazy-expire no lazyfree-lazy-server-del no replica-lazy-flush no appendonly yes 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 aof-use-rdb-preamble 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 stream-node-max-bytes 4096 stream-node-max-entries 100 activerehashing yes client-output-buffer-limit normal 0 0 0 client-output-buffer-limit replica 256mb 64mb 60 client-output-buffer-limit pubsub 32mb 8mb 60 hz 10 dynamic-hz yes aof-rewrite-incremental-fsync yes rdb-save-incremental-fsync yes
可以把我的配置配置文件进行复制到你的配置文件中。
mkdir /var/log/redis/mkdir /opt/redis_data
/usr/local/redis/bin/redis-server /etc/redis/redis.conf
ps -ef |grep redis
/usr/local/redis/bin/redis-cli
回车
redis-cli shutdown
kill -9 PID
(你的进程 ID,通过这个命令进行查询 ps -ef |grep redis )
或者
pkill redis
原文来自: https://www.linuxprobe.com/centos-redis.html
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。