Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Redis deployment

2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

# download and install # #

Cd / usr/local/src

Wget http://download.redis.io/releases/redis-3.0.7.tar.gz

Tar zxf redis-3.0.7.tar.gz

Cd redis-3.0.7

Make PREFIX=/usr/local/redis MALLOC=libc install

# copy startup script # #

Cd utils/

Ls

Cp redis_init_script / etc/init.d/redis

Vim / etc/init.d/redis

EXEC=/usr/local/redis/bin/redis-server

CLIEXEC=/usr/local/redis/bin/redis-cli

Save exit

Chmod 755 / etc/init.d/redis

# configuration file # #

Mkdir / etc/redis

Cp redis.conf / etc/redis/

Cd / etc/redis

Ll

Cp redis.conf 6379.conf

Vim 6379.conf / / modify the configuration file. The following are all filtered out by me and can be changed according to your own requirements.

Daemonize yes

Pidfile / var/run/redis_6379.pid

Port 6379

Tcp-backlog 511

Bind 192.168.141.188

Timeout 0

Tcp-keepalive 0

Loglevel notice

Logfile "/ var/log/redis_6379.log"

Databases 16

Save 900 1

Save 300 10

Save 60 10000

Stop-writes-on-bgsave-error yes

Rdbcompression yes

Rdbchecksum yes

Dbfilename dump_6379.rdb

Dir / var/lib/redis_6379

Slave-serve-stale-data yes

Slave-read-only yes

Repl-diskless-sync no

Repl-diskless-sync-delay 5

Repl-disable-tcp-nodelay no

Slave-priority 100

Necessary for requirepass candy / / password production

Appendonly yes

Appendfilename "appendonly_6379.aof"

Appendfsync everysec

No-appendfsync-on-rewrite no

Auto-aof-rewrite-percentage 100

Auto-aof-rewrite-min-size 64mb

Aof-load-truncated 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-entries 512

List-max-ziplist-value 64

Set-max-intset-entries 512

Zset-max-ziplist-entries 128

Zset-max-ziplist-value 64

Hll-sparse-max-bytes 3000

Activerehashing yes

Client-output-buffer-limit normal 0 0 0

Client-output-buffer-limit slave 256mb 64mb 60

Client-output-buffer-limit pubsub 32mb 8mb 60

Hz 10

Aof-rewrite-incremental-fsync yes

Echo 512 > / proc/sys/net/core/somaxconn

Mkdir-p / var/lib/redis_6379

# launch # #

/ etc/init.d/redis start

Less / var/log/redis_6379.log

Sysctl vm.overcommit_memory=1

Echo never > / sys/kernel/mm/transparent_hugepage/enabled

# # change startup script #

Vim / etc/init.d/redis

Stop)

If [!-f $PIDFILE]

Then

Echo "$PIDFILE does not exist, process is not running"

Else

PID=$ (cat $PIDFILE)

Echo "Stopping..."

$CLIEXEC-h 192.168.141.188-p $REDISPORT-a candy shutdown

While [- x / proc/$ {PID}]

Save exit

/ etc/init.d/redis stop

/ etc/init.d/redis start

Tail-f / var/log/redis_6379.log

2598:M 05 Apr 13:54:47.382 # Server started, Redis version 3.0.7

2598 seconds M 05 Apr 13 Switzerland 54 seconds 47.382 * seconds

2598 Apr M 05 13 Switzerland 54 47.382 * The server is now ready to accept connections on port 6379

At this point, it starts normally

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report