• 搭建redis主从复制,遇到的问题总结


    1.首先安装各个redis

    --解压 tar -zxvf redis.gz

    --编译:

        进行redis的make命令

        如果出现缺少gcc ,则运行 yum install -y gcc g++ gcc-c++ make 

        如果出现 jemalloc/jemalloc.h:没有那个文件或目录,则运行 make MALLOC=libc

        如果出现 You need tcl 8.5 or newer in order to run the Redis test ,则运行 

    wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
    tar xzvf tcl8.6.1-src.tar.gz  -C /usr/local/
    cd  /usr/local/tcl8.6.1/unix/
    ./configure
    make
    make install 
    

    --最后,执行 make install

    2.搭建主从过程中问题

     --我选择的是两台虚拟机,其中都关闭了防火墙 service iptables stop,redis.conf中配置了appendonly no

     --参数 bind 127.0.0.1 去掉 

    --参数 protected-mode 改为 no

    --参数 slaveof ip地址 端口号 填写(只在从上配置,主机把配置)

    --参数 masterauth <master-password>   和  requirepass foobared  可以设置密码,可以不设置

    其中,用jedis中连接使用主redis,否则报错 READONLY You can't write against a read only slave.

        

  • 相关阅读:
    获得当前python解释器的路径
    AirtestIDE
    大数据到底有多大?TB、PB、EB到底是多少?
    时间的单位有
    windows10 彻底关闭自动更新
    Microsoft Windows10系统时间显示秒的方法
    host文件路径(Windows)
    Mina学习之IoHandler
    Mina学习之IoFilter
    Mina学习之IoSession
  • 原文地址:https://www.cnblogs.com/wonder2636/p/5574607.html
Copyright © 2020-2023  润新知