一‘redis单实例安装配置
1.下载redis源码压缩包,并将其上传至服务器/usr/local
2.解压redis源码压缩包
  # tar -xzvf redis-3.2.12.tar.gz
3.进入redis解压缩后的目录进行编译
  # cd redis-3.2.12
  # make
4.编译成功后,再对redis进行安装
  # cd src
  # make install
5.对安装后的redis进行部署
  # mkdir -p /usr/local/redis/
  # mkdir -p /usr/local/redis/etc/
  # mkdir -p /usr/local/redis/bin
  # cd ..
  # cd ..
  # mv redis-3.2.12 redis
  # cd redis
  # cp redis.conf /usr/local/redis/etc/
  # cp mkreleasdhdr.sh redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server /usr/local/redis/bin/
  # groupadd redis
  # useradd -r -g redis
  # mkdir -p /home/redis
  # chown -R redis.redis /home/redis
  # chmod -R 755 /home/redis
  # passwd redis
  # chown -R redis.redis /usr/local/redis/
  # chmod -R 755 /usr/local/redis/  
  # vi /home/redis/.bash_profile
6.启动redis
  # su - redis
  $ cd /usr/local/redis/bin/
  $ redis-server ../etc/redis.conf
7.连接redis
  $ redis-cli -p 6379
8.关闭redis
  $ redis-cli -p 6379
  或
  $ pkill redis

二、redis集群安装配置
1.创建配置文件
  $ mdkir -p /usr/local/redis/cluster
  $ cd /usr/local/redis/etc/
  $ cp redis.conf ../cluster/redis-6379.conf
  $ cp redis.conf ../cluster/redis-6380.conf
  $ cp redis.conf ../cluster/redis-6381.conf
2.修改配置文件
  $ vi redis-6379.conf
  daemonize yes
  pidfile /var/run/redis6301.pid
  port 6379
  logfile "/usr/local/redis/cluster/6379.log"
  dbfilename dump6379.rdb
  
  $ vi redis-6380.conf
  daemonize yes
  pidfile /var/run/redis6380.pid
  port 6380
  logfile "/usr/local/redis/cluster/6380.log"
  dbfilename dump6380.rdb
  
  $ vi redis-6381.conf
  daemonize yes
  pidfile /var/run/redis6381.pid
  port 6381
  logfile "/usr/local/redis/cluster/6381.log"
  dbfilename dump6381.rdb
3.启动redis cluster
  $ cd /usr/local/redis/bin
  redis-server /usr/local/redis/cluster/redis-6379.conf
  redis-server /usr/local/redis/cluster/redis-6380.conf
  redis-server /usr/local/redis/cluster/redis-6381.conf
4.主从同步
  1)方法一
  $ redis-cli -p 6380
  auth "passwd"
  info replication
  slaveof 127.0.0.1 6379
  
  $ redis-cli -p 6381
  auth "passwd"
  info replication
  slaveof 127.0.0.1 6379
  2)方法二
  将如下行分别加入redis-6380.conf和redis-6381.conf中
  slaveof 127.0.0.1 6379
  
5.验证redis cluster
  $ redis-cli -p 6379
  auth "passwd"
  info replication
  
  $ redis-cli -p 6380
  auth "passwd"
  info replication
  
  $ redis-cli -p 6381
  auth "passwd"
  info replication
  
三、redis集群哨兵模式
1.创建配置文件
  $ mkdir -p /usr/local/redis/sentinel/
  $ cd /usr/local/redis/sentinel/
  
  $ touch sentinel-26379.conf
  $ touch sentinel-26380.conf 
  $ touch sentinel-26381.conf
2.修改配置文件
  $ vi sentinel-26379.conf
  # 后台启动
  daemonize yes
  # 启动目录
  dir "/usr/local/redis/bin"
  # 日志文件
  logfile "/usr/local/redis/sentinel/sentinel-26379.log"
  # 监听Redis主库IP地址及端口
  sentinel monitor host6379 127.0.0.1 6379 2
  
  $ vi sentinel-26380.conf
  # 后台启动
  daemonize yes
  # 启动目录
  dir "/usr/local/redis/bin"
  # 日志文件
  logfile "/usr/local/redis/sentinel/sentinel-26380.log"
  # 监听Redis主库IP地址及端口
  sentinel monitor host6379 127.0.0.1 6379 2
  
  $ vi sentinel-26381.conf
  # 后台启动
  daemonize yes
  # 启动目录
  dir "/usr/local/redis/bin"
  # 日志文件
  logfile "/usr/local/redis/sentinel/sentinel-26381.log"
  # 监听Redis主库IP地址及端口
  sentinel monitor host6379 127.0.0.1 6379 2
 
3.启动哨兵
  $ redis-sentinel /usr/local/redis/sentinel/sentinel-26301.conf
  $ redis-sentinel /usr/local/redis/sentinel/sentinel-26302.conf
  $ redis-sentinel /usr/local/redis/sentinel/sentinel-26303.conf
  
4.查看哨兵
  $ tail -f /usr/local/redis/sentinel/sentinel-26379.log
  $ tail -f /usr/local/redis/sentinel/sentinel-26380.log
  $ tail -f /usr/local/redis/sentinel/sentinel-26381.log

Redis for linux安装配置之—-源码安装的更多相关文章

  1. 004-nginx简介、安装配置【源码安装和mac安装】、基本使用

    一.概述 1.1.Nginx是什么 Nginx是一款轻量级的Web服务器,也是一款轻量级的反向代理服务器[常用]. 1.2.Nginx能干什么 Nginx能干的事情很多,这里简要罗列一些: 1:直接支 ...

  2. Mysql for Linux安装配置之—— 源码安装

    1.安装 --假设已经有mysql-5.5.10.tar.gz以及cmake-2.8.4.tar.gz两个源码压缩文件1)先安装cmake(mysql5.5以后是通过cmake来编译的)   # ta ...

  3. Kali Linux 下安装配置MongoDB数据库 ubuntu 下安装配置MongoDB源码安装数据库

    Kali Linux 下安装配置MongoDB数据库   1.下载mongodb.tgz 压缩包: 2.解压到:tar -zxvf mongodb.tgz /usr/local/mongodb 3.创 ...

  4. CentOS Linux release 7.3源码安装zabbix

    CentOS Linux release 7.3安装zabbix 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 前言: 我去年用用centos6的环境搭建了一下 zabbix3.0 ...

  5. 【SystemTap】 Linux下安装使用SystemTap源码安装SystemTap

    转自 http://blog.csdn.net/zklth/article/details/6248558 文章 http://blog.csdn.net/zklth/archive/2010/09/ ...

  6. Red hat Linux 安装Node.js 源码安装

    1. 下载源码包 http://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz 2.准备安装环境,>python2.6, gcc, g++ pytho ...

  7. nginx安装,手动源码安装

    什么是Nginx? Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务.Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Ra ...

  8. linux下mysql的源码安装

    mysql有多中安装方法,本文只涉及编译安装,对其他方法感兴趣的可以自行百度. 1.首先获取mysql软件安装包,这里用wget下载 [root@localhost ~]# wget http://d ...

  9. linux下无root源码安装软件

    先进入源码文件夹下指定安装路径 ./configure --prefix=/public/home/ztu/usr/samtools 编译 make 安装 make install 写入环境变量 vi ...

随机推荐

  1. C# AsyncCallback异步回调用法示例

    using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...

  2. Interesting (manacher + 前缀和处理)

    题意:相邻的两端回文串的价值为两个回文串总的区间左端点 × 区间右端点.然后计算目标串中所有该情况的总和. 思路:首先用manacher求出所有中心点的最大半径,然后我们知道对于左区间我们把贡献记录在 ...

  3. Linux安装 centos 7 最小化 安装

    我用的是vmware 15 ,我将用图片的形式带领大家安装,没有说到的地方为默认选项    最好把文件放到一个单独的文件夹中    简单密码点击两次DONE 即可,虚拟机密码不必那么复杂,工作环境请设 ...

  4. nginx的启动、停止、重载配置、验证配置

    [1]启动 启动nginx系统方式: (1)命令 nginx -c /usr/local/nginx/conf/nginx.conf 说明:-c 参数指定运行nginx系统的自定义配置文件. 若加:使 ...

  5. mysql(5.7以上)查询报错:ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by

    执行mysql命令查询时: select * from table_name错误信息如: [Err] 1055 - Expression #1 of ORDER BY clause is not in ...

  6. 超详MySQL5.7.17压缩包安装图文教程

    靠吹风机暖手写完这篇教程...网络上关于MySQL 5.7.17的安装教程很少且不详细,所以总结了这样一篇文章,希望能帮到大家:(相较于Oracle的安装,MySQL还是简单得多) 1. 下载网址:h ...

  7. dataguard从库数据库丢失恢复例子(模拟丢失数据文件)

    准备工作,使用如下脚本进行数据库的全备份[oracle@localhost ~]$ more rman_backup.sh #!/bin/sh RMAN_OUTPUT_LOG=/home/oracle ...

  8. JS对象、数据类型区别、函数

    对象 基本数据类型都是单一的值,值和值之间没有任何联系,变量之间独立,不能成为一个整体. 对象属于一种符合的数据类型,对象中可以保存对个不同数据类型的属性. 对象分类:  1.内建对象   由ES标准 ...

  9. Perl调用外部命令(其他脚本、系统命令)的方法和区别

    1. `command`; 使用反引号调用外部命令能够捕获其标准输出,并按行返回且每行结束处附带一个回车.反引号中的变量在编译时会被内插为其值.   2. open LIST "ls -l| ...

  10. 远程连接报错“This could be due to CredSSP encryption oracle remediation.”

    description: 当远程服务器上没有“Encryption Oracle Remediation" setting in local group policy. 尝试远程连接会出现上 ...