First we download the package to the specified directory
tar -zxvf redis-2.8.19.tar.gz cd redis-2.8.19 makemake PREFIX=/usr/local/redis install
/usr/local/redis/etc/cp redis.conf /usr/local/redis/etc/ cd /usr/local/redis/bin/cp redis-benchmark redis-cli redis-server /usr/bin/
vim/usr/local/redis/etc/redis.conf # Modify configuration # Redis Run as daemon # No indicates that the daemon is not running (consumes a terminal) daemonize yes# the client is idle for a long time after disconnecting, The default is 0 to turn off this feature timeout 300# set Redis log level, default level: Notice loglevel Verbose# set the output mode of the log file, if the Redis default is run as daemon: "" # And the log output is set to stdout, then the log information is output to/dev/null logfile stdout
Let's take a look at the configuration file
6379.conf
Daemonize yespidfile/var/run/redis_6379.pidport 6379tcp-backlog 511timeout 0tcp-keepalive 0loglevel noticelogfile/ Usr/local/redis/logs/redis_6379.logdatabases 16save 1save 10save 10000stop-writes-on-bgsave-error Yesrdbcompression yesrdbchecksum Yesdbfilename Dump.rdbdir/usr/local/redis/6379slave-serve-stale-data Yesslave-read-only Yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noslave-priority 100appendonly 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-entries 512list-max-ziplist-value 64set-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-increment Al-fsync Yes
6380.conf
Daemonize yespidfile/var/run/redis_6380.pidport 6380tcp-backlog 511timeout 0tcp-keepalive 0loglevel noticelogfile/ Usr/local/redis/logs/redis_6380.logdatabases 16save 1save 10save 10000stop-writes-on-bgsave-error Yesrdbcompression yesrdbchecksum Yesdbfilename Dump.rdbdir/usr/local/redis/6380slave-serve-stale-data Yesslave-read-only Yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noslave-priority 100appendonly 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-entries 512list-max-ziplist-value 64set-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-increment Al-fsync Yes
参考文章:1190000003084917
Redis source code compilation and installation