redis单机安装

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 "$1" 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 is 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

整个安装至此结束

时间: 2024-10-07 23:22:55

redis单机安装的相关文章

001. Redis 单机安装

一. 编译安装 #将redis解压到/opt下 tar zxvf redis-3.0.7.tar.gz -C /opt #进入redis目录,并编译 cd /opt/redis-3.0.7 && make MALLOC=libc #安装redis make install 二. 修改配置 #创建目录 mkdir /usr/local/etc/redis-cluster/redis-7000 /usr/local/etc/redis-cluster/redis-7001 #创建配置文件 cp

redis的单机安装与配置以及生产环境启动方案

简单介绍一下redis的单机安装与配置,方便自己记录安装步骤的同时方便他人获取知识. 首先,从官网下载最新版的(稳定版)的redis安装包.官网地址如下:https://redis.io/download 下载源码包后,redis需要编译安装.需要安装gcc和tcl,gcc用于编译tcl用于测试. 使用命令安装gcc,yum install gcc,一路选择yes,gcc就可以安装成功. 接下来安装tcl,首先获取tcl源码包(见百度云盘)或者使用命令:wget http://downloads

Redis单机环境安装

=============================================================================================== 基本环境 单机安装 =============================================================================================== 1.安装gcc yum install gcc ========================

Redis单机版本的安装

我的是centos-6.5的环境,安装redis的单机版本 1.下载redis源文件redis-3.0.0.tar.gz到一个目录,我的下载目录是/software 2.编译安装源文件的先觉条件是安装gcc-c++ yum -y install gcc-c++ 3.进入redis源文件所在的目录:cd /software,解压 tar -zxvf redis-3.0.0.tar.gz 4.进入解压后的redis目录: cd redis-3.0.0 5.编译redis源文件 make 6.安装re

Redis 单机版本安装

亲装! 1.linux 系统镜像 redis 版本  使用redis-3.2.8.tar.gz(截止2017年4月的最新稳定版) 在安装之前先安装下redis 需要的环境 wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gztar -xzvf tcl8.6.1-src.tar.gzcd  /usr/local/tcl8.6.1/unix/./configure  make && make install 2.安装 tar

redis单机多实例_主从复制

上一篇讲到了redis单机单实例的安装http://my.oschina.net/xinxingegeya/blog/389155, 这一篇主要安装单机多实例,以及主从复制的配置.这就是一个redis的集群了. 单机多实例的配置 [[email protected] redis_7000]# pwd /opt/redis-2.8.19/redis_7000 [[email protected] redis_7000]# ./src/redis-cli -p 7000 127.0.0.1:7000

redis的安装和配置

概述 对redis来说,在学习和工作中,安装配置环节无疑是最简单的.无论是单机安装.sentinel主从还是cluster模式,都只需要一个安装包,每个节点给一个配置文件,然后使用配置文件启动就可以了.当然,在试验环节,我们可以连配置文件都省了,直接启动也是可以的. 这样说来,其实理解redis基础安装,主要在于理解配置文件,那么配置文件中有哪些内容呢? 如果是单机安装,那么配置文件中规定了端口号.是否后台运行.log文件名称及存放位置.访问密码等. 如果是主从模式,除了单机模式的参数外,还可以

unix(mac)单机安装neo4j

单机版安装 单机安装十分简单: 1)将neo4j的community版本下载完毕后,进行解压,运行的命令是:tar –zvxf neo4j-community-2.0.1.tar.gz 2)修改conf/neo4j-server.properties配置文件,将org.neo4j.server.webserver.address=0.0.0.0注释字符去掉 3)最后进入bin目录,启动neo4j的服务即可. 4) 输入 http://ip:7474/webadmin 即可进入neo4j控制台 集

Linux redis的安装与配置

Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API.从2010年3月15日起,Redis的开发工作由VMware主持. 1.环境 # lsb_release LSB Version:    :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarchDistri