2

I'm working on implementing the master slave using sentinels in Redis with spring boot application. And while creating the JedisSentinelPool using sentinels I'm getting the following error

Cannot get master address from sentinel running @myIpaddress:6379

Below is the code.

        final String MASTER_NAME = "mymaster";
        final String PASSWORD = "empower";
        final Set sentinels;

        sentinels = new HashSet();
        sentinels.add("127.0.0.1:6379");
        sentinels.add("127.0.0.1:2222");
        sentinels.add("127.0.0.1:3333");

        JedisSentinelPool pool = new JedisSentinelPool(MASTER_NAME, sentinels);

My question is how do I run the sentinels and how do I fix this issue. Any kind of help is appreciated.

Thanks in advance.

Veswanth
  • 1,061
  • 9
  • 22

1 Answers1

0

bind your ip address to 127.0.0.1

# Example sentinel.conf
# By default Sentinel will not be reachable from interfaces different than
# localhost, either use the 'bind' directive to bind to a list of network
# interfaces, or disable protected mode with "protected-mode no" by
# adding it to this configuration file.
#
# Before doing that MAKE SURE the instance is protected from the outside
# world via firewalling or other means.
#
# For example you may use one of the following:
#
bind 10.10.21.192 127.0.0.1
truekiller
  • 470
  • 6
  • 19