Sentinel as a daemon

1,932 views
Skip to first unread message

gabron

unread,
Aug 31, 2012, 2:05:05 PM8/31/12
to redi...@googlegroups.com
Is there a built in way at the moment to get Sentinel to run as a daemon.  Redis has the daemon setting, I was wondering if that existed for Sentinel as well.  If not is it planned?

thanks

Salvatore Sanfilippo

unread,
Sep 1, 2012, 11:56:08 AM9/1/12
to redi...@googlegroups.com
Hello,

you can use "daemonize yes" in Sentinel.conf as usual.
Basically all the redis.conf configuration directives are supported,
like loglevel, paths, and so forth.

Cheers,
Salvatore
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/redis-db/-/ukOUJf2NMG0J.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.



--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org

Beauty is more important in computing than anywhere else in technology
because software is so complicated. Beauty is the ultimate defence
against complexity.
— David Gelernter

Josiah Carlson

unread,
Sep 2, 2012, 10:20:34 PM9/2/12
to redi...@googlegroups.com
Salvatore,

Sorry to thread-jack, but how do sentinels discover slave listening
port information?

I've looked through the spec document and the general documentation,
and neither mentions how it happens. As far as I can tell, slaves are
not sending their host/port information to the master, so the master
doesn't know about IP/port information. Also, sentinel configuration
makes no mention of slaves to be monitored, and the spec says that all
sentinels connect and check on all slaves of all configured masters.
Am I missing something obvious? How is a sentinel to know that slave X
is listening on IP Y and port Z (where Z != 6379), if it only knows
about the master?

Regards,
- Josiah

Didier Spezia

unread,
Sep 3, 2012, 4:05:44 AM9/3/12
to redi...@googlegroups.com
Hi Josiah,

I believe it is the job of the new REPLCONF command which is executed
on the master by the slaves at the beginning of the synchronization process.

/* REPLCONF <option> <value> <option> <value> ...
* This command is used by a slave in order to configure the replication
* process before starting it with the SYNC command.
*
* Currently the only use of this command is to communicate to the master
* what is the listening port of the Slave redis instance, so that the
* master can accurately list slaves and their listening ports in
* the INFO output.
*
* In the future the same command can be used in order to configure
* the replication to initiate an incremental replication instead of a
* full resync. */

Sentinel probably executes an INFO command on the master whose output now includes
information on its slaves.

Regards,
Didier.

Salvatore Sanfilippo

unread,
Sep 3, 2012, 4:59:06 AM9/3/12
to redi...@googlegroups.com
On Mon, Sep 3, 2012 at 10:05 AM, Didier Spezia <didi...@gmail.com> wrote:
> Sentinel probably executes an INFO command on the master whose output now
> includes
> information on its slaves.

Exactly that :)

Salvatore

Josiah Carlson

unread,
Sep 3, 2012, 1:38:33 PM9/3/12
to redi...@googlegroups.com
Awesome! I knew I was missing something.

Thank you Didier and Salvatore,
- Josiah
Reply all
Reply to author
Forward
0 new messages