linux怎么查看本机内存大小
258
2022-09-14
2021-01-19 Redis-5.0.5安装部署
Redis下载
wget
Redis安装
进入下载目录解压会生成一个redis-5.0.5的目录
tar
安装GCC依赖(如果有GCC可以跳过)
yum install
编译&安装
cd
编译安装
make
make install
运行Redis,可在任意目录下运行,因为redis-server命令在/usr/local/bin目录里面,而该目录又配置在PATH中,所以你可以像执行ls、mkdir等命令的方式去执行redis-cli或者redis-server等命令。
redis-server
redis-cli
Redis配置
复制文件到配置文件目录
cp
设置redis配置文件
vim /etc/redis/redis.conf
内容如下
bind 0.0.0.0 ::1protected-mode yesport 6379tcp-backlog 511timeout 0tcp-keepalive 300daemonize nosupervised nologlevel noticedatabases 16save 900 1save 300 10save 60 10000stop-writes-on-bgsave-error yesrdbcompression yesrdbchecksum yesdbfilename dump.rdbslave-serve-stale-data yesslave-read-only yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noslave-priority 100requirepass 123456appendonly noappendfilename "appendonly.aof"appendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mbaof-load-truncated 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 3000activerehashing yesclient-output-buffer-limit normal 0 0 0client-output-buffer-limit slave 256mb 64mb 60client-output-buffer-limit pubsub 32mb 8mb 60hz 10aof-rewrite-incremental-fsync yes
加载配置文件并启动服务端
redis-server redis.conf
启动1客户端
redis-cli
将Redis添加到Systemctl
vi
加入如下代码
[Unit]Description=redisAfter=network.target[Service]#Type=forkingPIDFile=/var/run/redis_6379.pidExecStart=/TRS/APP/redis/src/redis-server /TRS/APP/redis/redis.confExecReload=/bin/kill -s HUP $MAINPIDExecStop=/bin/kill -s QUIT $MAINPIDPrivateTmp=true[Install]WantedBy=multi-user.target
重新加载systemctl
systemctl daemon-reloadsystemctl reload redis.service
$ systemctl enable
开启防火墙3306
firewall-cmd --permanent --add-port=6379/tcpfirewall-cmd --reload
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~