Skip to content

Commit

Permalink
Fix ndb_redis Cluster implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbock committed Apr 24, 2017
1 parent e94e9d8 commit 3c1f6a5
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 139 deletions.
10 changes: 10 additions & 0 deletions src/modules/ndb_redis/doc/ndb_redis_admin.xml
Expand Up @@ -157,6 +157,12 @@ modparam("ndb_redis", "cmd_timeout", 500)
<para>
If set to 1, the module will connect to servers indicated in the "MOVED" reply.
</para>
<para>
The module needs to know all existing REDIS-Nodes at startup.
The nodes are searched by the name "ip:port", e.g. if REDIS
replies with "MOVED 127.0.0.1:4711", ndb_redis needs to know
the databases "127.0.0.1:4711".
</para>
<para>
<emphasis>
Default value is <quote>0</quote> (disabled).
Expand All @@ -166,6 +172,10 @@ modparam("ndb_redis", "cmd_timeout", 500)
<title>Set <varname>cluster</varname> parameter</title>
<programlisting format="linespecific">
...
modparam("ndb_redis", "server", "name=127.0.0.1:26001;addr=127.0.0.1;port=26001")
modparam("ndb_redis", "server", "name=127.0.0.1:26004;addr=127.0.0.1;port=26004")
modparam("ndb_redis", "server", "name=127.0.0.1:26008;addr=127.0.0.1;port=26008")
...
modparam("ndb_redis", "cluster", 1)
...
</programlisting>
Expand Down
15 changes: 1 addition & 14 deletions src/modules/ndb_redis/ndb_redis_mod.c
Expand Up @@ -61,7 +61,6 @@ static int fixup_redis_cmd6(void** param, int param_no);

static int w_redis_free_reply(struct sip_msg* msg, char* res);

static int mod_init(void);
static void mod_destroy(void);
static int child_init(int rank);

Expand Down Expand Up @@ -114,7 +113,7 @@ struct module_exports exports = {
0, /* exported MI functions */
mod_pvs, /* exported pseudo-variables */
0, /* extra processes */
mod_init, /* module initialization function */
0, /* module initialization function */
0, /* response function */
mod_destroy, /* destroy function */
child_init /* per child init function */
Expand All @@ -136,18 +135,6 @@ static int child_init(int rank)
return 0;
}

/**
*
*/
static int mod_init(void)
{
if (init_list() < 0) {
LM_ERR("failed to initialize redis connections\n");
return -1;
}
return 0;
}

/**
*
*/
Expand Down

0 comments on commit 3c1f6a5

Please sign in to comment.