您好,登錄后才能下訂單哦!
本文教你如何在 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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。