码迷,mamicode.com
首页 > 其他好文 > 详细

Redis-3.2.3 安装部署

时间:2016-08-31 02:12:57      阅读:310      评论:0      收藏:0      [点我收藏+]

标签:

1.redis下载安装

cd /usr/local/src
tar -zxvf redis-3.2.3.tar.gz
wget http://download.redis.io/releases/redis-3.2.3.tar.gz
cd redis-3.2.3
make PREFIX=/usr/local/redis-3.2.3 install
ln -s /usr/loca/redis-3.2.3 /usr/local/redis

2.redis启动脚本

cp /usr/local/src/redis-3.2.3/utils/redis_init_script /etc/init.d/redis
chmod +x /etc/init.d/redis
vim /etc/init.d/redis
  6 REDISPORT=6379
  7 EXEC=/usr/local/redis/bin/redis-server   # 启动命令更改
  8 CLIEXEC=/usr/local/redis/bin/redis-cli

3.redi配置文件

mkdir /etc/redis
cp /usr/local/src/redis-3.2.3/redis.conf /etc/redis/6379.conf


# 修改redis的配置文件
[root@localhost ~]# vim /etc/init.d/6379.conf
  61 bind 192.168.2.10              # 绑定IP地址

  88 # In high requests-per-second environments you need an high backlog in order
  89 # to avoid slow clients connections issues. Note that the Linux kernel
  90 # will silently truncate it to the value of /proc/sys/net/core/somaxconn so
  91 # make sure to raise both the value of somaxconn and tcp_max_syn_backlog
  92 # in order to get the desired effect.
  93 tcp-backlog 511	            # 修改/proc/sys/net/core/somaxconn值

 128 daemonize yes                  # no改成yes

 163 logfile "/etc/redis/redis_6379.log"  # 日志文件

 247 dir /etc/redis/redis_6379      # 数据目录

 480 requirepass xiaoyi		    # 开启密码认证


[root@localhost ~]# cat /proc/sys/net/core/somaxconn
128
[root@localhost ~]# echo 512 >/proc/sys/net/core/somaxconn
[root@localhost ~]# cat /proc/sys/net/core/somaxconn      
512

[root@localhost ~]# mkdir /etc/redis/redis_6379

[root@localhost local]# /etc/init.d/redis start

 

Redis-3.2.3 安装部署

标签:

原文地址:http://www.cnblogs.com/sunmmi/p/5824326.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!