Redis stand-alone installation

Source: Internet
Author: User
Tags truncated

Echo 1 >/proc/sys/vm/overcommit_memory

echo Vm.overcommit_memory=1 >>/etc/sysctl.conf

Sysctl Vm.overcommit_memory=1

Sysctl-p


Tar zxvf redis-2.8.20.tar.gz

CD redis-2.8.20

Make Prefix=/opt/redis Install

Make

Cp/opt/soft/redis/utils/redis_init_script/etc/rc.d/init.d/redis

cd/etc/rc.d/init.d/

Vim/etc/rc.d/init.d/redis

############################ #redis ######################################################## #3

#!/bin/sh

#chkconfig: 2345 80 90

#

# simple Redis INIT.D script conceived to work on Linux systems

# as it does use of the/proc filesystem.


redisport=6379

Exec=/opt/redis/bin/redis-server

Cliexec=/opt/redis/bin/redis-cli


Pidfile=/var/run/redis.pid

conf= "/etc/redis/${redisport}.conf"


Case "$" in

Start

If [-F $PIDFILE]

Then

echo "$PIDFILE exists, process is already running or crashed"

Else

echo "Starting Redis server ..."

$EXEC $CONF &

Fi

;;

Stop

if [!-F $PIDFILE]

Then

echo "$PIDFILE does not exist, process was not running"

Else

pid=$ (Cat $PIDFILE)

echo "Stopping ..."

$CLIEXEC-P $REDISPORT shutdown

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

Do

echo "Waiting for Redis to shutdown ..."

Sleep 1

Done

echo "Redis stopped"

Fi

;;

*)

echo "Please use Start or stop as first argument"

;;

Esac

################################# #redis ################################################



Chkconfig--add Redis

Mkdir/etc/redis

Cp/opt/soft/redis/redis.conf/etc/redis/6379.conf

Vim/etc/redis/6379.conf

############################# #6379. conf###########################################

Daemonize Yes

Pidfile/var/run/redis.pid

Port 6379

Tcp-backlog 511

Timeout 0

Tcp-keepalive 0

LogLevel Notice

LogFile ""

Databases 16

Save 900 1

Save 300 10

Save 60 10000

Stop-writes-on-bgsave-error Yes

Rdbcompression Yes

Rdbchecksum Yes

Dbfilename Dump.rdb

Dir./

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

AppendOnly No

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

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 Yesdaemonize Yes

Pidfile/var/run/redis.pid

Port 6379

Tcp-backlog 511

Timeout 0

Tcp-keepalive 0

LogLevel Notice

LogFile ""

Databases 16

Save 900 1

Save 300 10

Save 60 10000

Stop-writes-on-bgsave-error Yes

Rdbcompression Yes

Rdbchecksum Yes

Dbfilename Dump.rdb

Dir./

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

AppendOnly No

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

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

##################### #6379. conf##################################


chmod 755/etc/init.d/redis

/etc/init.d/redis start


Vim/etc/profile

########## #profile ############

Export path= $PATH:/opt/redis/bin;

######### #profile #############

Source/etc/profile

The entire installation ends here

This article is from the "interested people, things become" blog, please be sure to keep this source http://wuxinglai.blog.51cto.com/9136815/1672034

Redis stand-alone installation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.