1. 程式人生 > >Redis Sentinel配置使用過程中的一個坑(DENIED Redis is running in protected mode)

Redis Sentinel配置使用過程中的一個坑(DENIED Redis is running in protected mode)

        根據官網示例配置完sentinel.conf,大致新增如下配置項:

    port 26379
    sentinel monitor mymaster 172.17.16.7 6379 2
    sentinel auth-pass mymaster 123456
    sentinel down-after-milliseconds mymaster 30000
    sentinel failover-timeout mymaster 900000
    sentinel parallel-syncs mymaster 1

        隨後啟動sentinel

       # ./redis-sentinel sentinel.conf

       java程式中使用JedisSentinelPool建立redis連線池

   Set sentinels = new HashSet();
   sentinels.add("172.17.16.7:26379");
   sentinels.add("172.17.16.8:26379");
   sentinels.add("172.17.16.9:26379");
   JedisSentinelPool sentinelPool = new JedisSentinelPool("mymaster", sentinels, "123456");
      報錯:
   DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to    clients.......

      使用redis-cli -h 127.0.0.1 -p 26379連線sentinel可以執行命令,而使用redis-cli -h 172.17.16.7 -p 26379連線sentinel執行命令則會報同上的錯誤。

      查遍了網上沒有找到相關的問題分析和解決的案例,所以只能自己猜測和排查,初步懷疑是通過172.17.16.7訪問sentinel時受限。

      由於此錯誤和redis server的protect-mode為yes的訪問錯誤頗為相似,官方在redis.conf的註釋說明中有protected-mode這一配置項,但sentinel.conf的註釋中完全沒有提到過該配置項,我很疑惑,但還是嘗試在sentinel.conf中加入

   protected-mode no
      之後儲存並重新啟動sentinel,之後用Java程式建立連線池,沒有報錯,且可以對redis server進行資料處理,問題解決。

      本文原創,轉載請註明出處!




 

相關推薦

Redis Sentinel配置使用過程一個DENIED Redis is running in protected mode

        根據官網示例配置完sentinel.conf,大致新增如下配置項: port 26379 sentinel monitor mymaster 172.17.16.7 6379 2 sentinel auth-pass mymaster

redis解決DENIED Redis is running in protected mode because prote

本文轉載自:http://news.tuxi.com.cn/news/16541999999012402/4020207.html 在應用上telnet埠和ping都沒有問題,為什麼還獲取不到值呢。 先安裝一個redis客戶端進行測試:yum -y install r

redis 錯誤 Error reply to PING from master: '-DENIED Redis is running in protected mode because prote

做主從的時候,碰到下面問題 Error reply to PING from master: ‘-DENIED Redis is running in protected mode because p

Spring 整合 Redis報錯 DENIED Redis is running in protected mode because protected mode is enabled, no b

Spring 整合 Redis報錯 DENIED Redis is running in protected mode because protected mode is enabled, no bind address was sp… 1.因為是第一次

Redis連線報錯:DENIED Redis is running in protected mode because protected mode is enabled

問題:Could not get a resource from the pool, Connection refused: connect 該問題說,redis目前處於受保護模式,不允許非本地客

操作redis時出現 DENIED Redis is running in protected mode

在操作redis時,出現DENIED Redis is running in protected mode這說明redis是執行在保護模式開啟redis的redis.conf 檔案通過/ 找到 protected-mode yes將yes 改成no 即可。友情提示:通過 :n

DENIED Redis is running in protected mode because protected mode is enabled, no bind address was spe

(error) DENIED Redis is running in protected mode because protected mode is enabled Redis protected-mode 是3.2 之後加入的新特性,在Redis.co

關於Jedis連線Linux上的redis出現 DENIED Redis is running in protected mode問題的解決方案

  最近有段時間沒有寫部落格了,今天抽出時間寫寫,之前開發的時候redis部署在Linux是其他人搞得,我沒怎麼參與,於是閒

菜鳥幫你跳過openstack配置過程

如果 working ack 大坑 nbsp 模式 con ror centos 一:前言 對於一個以前做java全棧工程師而言,而且沒學過Linux,很少用虛擬機(還是在大學的時候簡單的用過),去配置openstack我想我入的坑肯定比有基礎的一

Caused by: redis.clients.jedis.exceptions.JedisDataException: DENIED Redis is running in protected m

問題描述: java.lang.IllegalStateException: Failed to execute CommandLineRunner at org.springframework.boot.SpringApplication.ca

the system is running in low_graphics mode解決方法試驗成功且完整有圖

       前幾日,一個朋友突然找我,說自己安裝的ubuntu系統有問題,讓我看看能不能解決,問題是安裝時可以正常啟動的ubuntu系統,現在開啟卻提示the system is running in low_graphics mode,並且剛開始還能選擇ok,後來彈出提

tensorflow-GPU的配置詳解細數配置過程遇見的與解決方式

細數自己搭建TensorFlow-gpu環境中遇到的坑及解決方式:1、安裝anaconda,一路下來點選next,然後預設配置(這裡不再細講)2、安裝裝TensorFlow-gpu -->pip install tensorflow-gpu(也可以選擇自己想要的版本安裝

kafka 並發數配置過程踩到的 InstanceAlreadyExistsException

static 靜態初始化塊 obj -c 異常 判斷 con lba comm 2017-07-05 13:09:15.460 [kafka_spout:7-MultipleThreadSpoutExecutors] WARN o.a.kafka.common.utils.

Android開發過程及解決方法收錄

1.某個控制元件要放在Linearlayout佈局的底部(底部導航條) <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.

redis叢集搭建過程踩過的幾個

這兩天在玩redis的叢集,搭建過程中遇到了以下幾個問題 首先是redis:[ERR] Not all 16384 slots are covered by nodes. 不是所有的slot都被分配

阿里雲Centos7 安裝 k8s 叢集使用過程

個人備忘 下面這個地址能滿足大部分需求 : 上文:5.2 的配置三臺伺服器都要修改 ,5.3 的命令 [[email protected] ~]# etcdctl mk /atomic.io/network/config '{ "Network": "1

nodejs備忘總結(一) -- node和express安裝與配置,新建簡單專案附安裝配置過程遇到問題的解決方法

安裝node 本文以安裝node_v8.9.0為例(win10環境),下載node-v8.9.0-x64.msi外掛 下載後,安裝,安裝目錄預設為C:\Program Files\nodejs 配置環境變數,系統變數->path,新增“C:\Program Files\nodejs\”

selenium與chromedriver配置過程遇到的

Starting ChromeDriver 2.34.522940 (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1) on port 15464Only local connections are allowed.4月 12, 2018 5

在Navicat 寫MySQL儲存過程一個

今天在Navicat上寫了一個儲存過程,然後執行執行都沒有什麼問題,可是部署執行的時候總是有問題。 後來在navicat上又仔細看了很久。還是沒問題,執行了也沒問題。 進linux mysql -uxxx -pxxx執行,還是報錯:ERROR 1064 (42000):

iPad使用相機一個UIModalPresentationStyle,UIStatusBar)

今天解決了一個相機相關的bug,感覺有些人可能也會遇到,就說一下吧。 問題是這樣子的,我們應用在使用者資訊頁面,需要支援更換頭像,這裡需要能夠直接從相機獲