一‘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. UDAF(用户自定义聚合函数)求众数

    除了逐行处理数据的udf,还有比较常见的就是聚合多行处理udaf,自定义聚合函数.类比rdd编程就是map和reduce算子的区别. 自定义UDAF,需要extends org.apache.spar ...

  2. Install rapyuta Robot Cloud Engine on Ubuntu12.04

    Prepare on ubuntu12.04 sudo apt-get install vim Install fuerte ROS sudo sh -c 'echo "deb http:/ ...

  3. django 2.1 配sql server 2008R2

     请教了不少高手和度娘终于把这个事搞定了(基本上断断续续查试了2周时间),,,,,,,, 环境:  1-Microsoft Windows     2-Microsoft SQL SERVER2008 ...

  4. spring bean的初始化以及销毁

    spring bean初始化或销毁时执行某些方法,有很多使用场景.比如初始化时,启动bean中的线程池.销毁时释放资源,个人比较喜欢实现InitializingBean和 DisposableBean ...

  5. 新手如何学习python(python学习路线图)

    现在互联网巨头,都已经转投到人工智能领域,而人工智能最好的编程语言就是python,未来前景显而易见.这是小编给大家整理的python学习路线图,按照此教程一步步的学习来,肯定会对python有更深刻 ...

  6. 使用shiro框架,解决跳转页面出现404的问题

    shiro框架是一个安全框架,在进行登录的时候,如果没有配置路径,它会跳到shiro的默认配置的路径“/”下面,所以总是会出现404的错误,因为它的路径是保存在session中 所以需要我们把sess ...

  7. JS设计模式(7)组合模式

    什么是组合模式? 定义:1.将对象组合成树形结构以表示"部分-整体"的层次结构.2.组合模式使得用户对单个对象和组合对象的使用具有一致性.3.无须关心对象有多少层,调用时只需在根部 ...

  8. linux --- 6. 项目部署

    一.负载均衡 .准备三台机器,准备3台虚拟机,或者和俩同桌交流一下 192.168.226.128 是nginx资源服务器,返回页面的 192.168.226.129 用作nginx负载均衡服务器 1 ...

  9. centos6.5下安装Redis

    已有redis-3.2.1.tar.gz文件 拖到centos系统的桌面 现在在桌面目录下 tar -zxv -f redis-3.2.1.tar.gz以解压压缩包 cd redis-3.2.1以切换 ...

  10. 论文笔记:Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks

    Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks ICML 2017 Paper:https://arxiv.org/ ...