1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務時間:8:30-17:00
      你可能遇到了下面的問題
      關閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      linux安裝redis哨兵-創(chuàng)新互聯(lián)
      安裝環(huán)境

      服務器一臺:

      創(chuàng)新互聯(lián)公司成立于2013年,先為遼寧等服務建站,遼寧等地企業(yè),進行企業(yè)商務咨詢服務。為遼寧企業(yè)網(wǎng)站制作PC+手機+微官網(wǎng)三網(wǎng)同步一站式服務解決您的所有建站問題。
      • 服務器IP:172.169.3.251
      • 主從端口:6379、6380、6381
      • 哨兵端口,26379、26380、26381
      • 安裝目錄:/usr/local/redis
      • 配置文件目錄:/usr/loca/redis/conf
      redis安裝 1、下載redis
      wget https://download.redis.io/releases/redis-6.2.7.tar.gz
      2、解壓redis
      tar -zxvf redis-6.2.7.tar.gz
      mv redis-6.2.7 /usr/local/redis
      3、編譯、安裝
      cd /usr/local/redis
      make
      make install PREFIX=/usr/local/redis
      配置主從、哨兵

      在目錄 /usr/loca/redis/conf 下創(chuàng)建以下文件

      1. redis1.conf
      2. redis2.conf
      3. redis3.conf
      4. sentinel1.conf
      5. sentinel2.conf
      6. sentinel3.conf
      redis1.conf
      bind 0.0.0.0
      port 6379
      daemonize yes
      protected-mode no
      slave-read-only no
      masterauth 1234
      requirepass 1234
      redis2.conf

      replicaof 改為 redis1的ip和端口

      bind 0.0.0.0
      port 6380
      daemonize yes
      protected-mode no
      slave-read-only no
      masterauth 1234
      requirepass 1234
      replicaof 172.169.3.251 6379
      redis3.conf

      replicaof 改為 redis1的ip和端口

      bind 0.0.0.0
      port 6381
      daemonize yes
      protected-mode no
      slave-read-only no
      masterauth 1234
      requirepass 1234
      replicaof 172.169.3.251 6379
      sentinel1.conf

      myaster 后面 ip和端口 改為redis1的ip和端口

      port 26379
      dir /tmp
      protected-mode no
      daemonize yes
      sentinel monitor mymaster 172.169.3.251 6379 2
      sentinel auth-pass mymaster 1234
      sentinel down-after-milliseconds mymaster 30000
      sentinel parallel-syncs mymaster 1
      sentinel failover-timeout mymaster 10000
      sentinel deny-scripts-reconfig yes
      sentinel2.conf

      myaster 后面 ip和端口 改為redis1的ip和端口

      port 26380
      dir /tmp
      protected-mode no
      daemonize yes
      sentinel monitor mymaster 172.169.3.251 6379 2
      sentinel auth-pass mymaster 1234
      sentinel down-after-milliseconds mymaster 30000
      sentinel parallel-syncs mymaster 1
      sentinel failover-timeout mymaster 10000
      sentinel deny-scripts-reconfig yes
      sentinel3.conf

      myaster 后面 ip和端口 改為redis1的ip和端口

      port 26381
      dir /tmp
      protected-mode no
      daemonize yes
      sentinel monitor mymaster 172.169.3.251 6379 2
      sentinel auth-pass mymaster 1234
      sentinel down-after-milliseconds mymaster 30000
      sentinel parallel-syncs mymaster 1
      sentinel failover-timeout mymaster 10000
      sentinel deny-scripts-reconfig yes
      啟動服務

      start_all.sh

      #bin/bash
      REDIS_HOME=/usr/local/redis
      CONFIG_HOME=/usr/loca/redis/conf
      $REDIS_HOME/bin/redis-server $CONFIG_HOME/conf/redis1.conf &
      sleep 1s
      $REDIS_HOME/bin/redis-server $CONFIG_HOME/conf/redis2.conf &
      sleep 1s
      $REDIS_HOME/bin/redis-server $CONFIG_HOME/conf/redis3.conf &
      sleep 1s
      $REDIS_HOME/bin/redis-server $CONFIG_HOME/conf/sentinel1.conf --sentinel &
      sleep 1s
      $REDIS_HOME/bin/redis-server $CONFIG_HOME/conf/sentinel2.conf --sentinel &
      sleep 1s
      $REDIS_HOME/bin/redis-server $CONFIG_HOME/conf/sentinel3.conf --sentinel &
      chmod 777 start_all.sh
      ./start_all.sh
      查看服務
      ps -ef|grep redis

      在這里插入圖片描述

      查看集群狀態(tài)
      ./redis-cli -p 6379 -a 1234
      info replication

      在這里插入圖片描述

      應用配置
      # 哨兵的IP和端口
      spring.redis.sentinel.nodes=172.169.3.186:26379,172.169.3.186:26380,172.169.3.186:26381
      # sentinel monitor mymaster 172.169.3.251 6379 2 與 這里的 mymaster 一致
      spring.redis.sentinel.master=mymaster
      # 哨兵是否需要密碼,如果未配置,則不需要
      spring.redis.sentinel.password=
      # redis主從的密碼,配置的為1234,故需要配置
      spring.redis.password=1234

      你是否還在尋找穩(wěn)定的海外服務器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機房具備T級流量清洗系統(tǒng)配攻擊溯源,準確流量調(diào)度確保服務器高可用性,企業(yè)級服務器適合批量采購,新人活動首月15元起,快前往官網(wǎng)查看詳情吧


      網(wǎng)站名稱:linux安裝redis哨兵-創(chuàng)新互聯(lián)
      文章位置:http://www.ef60e0e.cn/article/cdjhic.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        徐水县| 呼玛县| 灵璧县| 中宁县| 宁夏| 洪湖市| 赣州市| 财经| 龙川县| 习水县| 山阳县| 徐水县| 白河县| 朝阳区| 昌吉市| 保德县| 威远县| 土默特左旗| 建德市| 泸州市| 鲁甸县| 广宁县| 崇州市| 读书| 沂源县| 蓝田县| 张掖市| 雅安市| 张家口市| 乐清市| 西平县| 西盟| 斗六市| 大宁县| 灌云县| 顺平县| 鄂伦春自治旗| 临沧市| 洛隆县| 二连浩特市| 开远市|