本篇内容主要讲解“CentOS上安装怎么Redis”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“CentOS上安装怎么Redis”吧!
Redis 是一个高性能的key-value数据库。 redis的出现,很大程度补偿了memcached这类keyvalue存储的不足,在部 分场合可以对关系数据库起到很好的补充作用。
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.0protected-mode noport 6379tcp-backlog 511timeout 0tcp-keepalive 300daemonize yessupervised nopidfile /var/run/redis_6379.pidloglevel noticelogfile /var/log/redis/redis_master.logdatabases 16always-show-logo yessave 900 1save 300 10save 60 10000stop-writes-on-bgsave-error yesrdbcompression yesrdbchecksum yesdbfilename dump.rdbdir /opt/redis_datareplica-serve-stale-data yesreplica-read-only yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noreplica-priority 100maxmemory 10000000kblazyfree-lazy-eviction nolazyfree-lazy-expire nolazyfree-lazy-server-del noreplica-lazy-flush noappendonly yesappendfilename "appendonly.aof"appendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mbaof-load-truncated yesaof-use-rdb-preamble yeslua-time-limit 5000slowlog-log-slower-than 10000slowlog-max-len 128latency-monitor-threshold 0notify-keyspace-events ""hash-max-ziplist-entries 512hash-max-ziplist-value 64list-max-ziplist-size -2list-compress-depth 0set-max-intset-entries 512zset-max-ziplist-entries 128zset-max-ziplist-value 64hll-sparse-max-bytes 3000stream-node-max-bytes 4096stream-node-max-entries 100activerehashing yesclient-output-buffer-limit normal 0 0 0client-output-buffer-limit replica 256mb 64mb 60client-output-buffer-limit pubsub 32mb 8mb 60hz 10dynamic-hz yesaof-rewrite-incremental-fsync yesrdb-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
到此,相信大家对“CentOS上安装怎么Redis”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。