Prechádzať zdrojové kódy

htable: update documentation for dmq integration

Charles Chance 12 rokov pred
rodič
commit
c9395e6904
2 zmenil súbory, kde vykonal 84 pridanie a 14 odobranie
  1. 46 12
      modules/htable/README
  2. 38 2
      modules/htable/doc/htable_admin.xml

+ 46 - 12
modules/htable/README

@@ -45,6 +45,7 @@ Alex Balashov
               3.10. timer_interval (integer)
               3.11. timer_mode (integer)
               3.12. db_expires (integer)
+              3.13. enable_dmq (integer)
 
         4. Functions
 
@@ -92,11 +93,12 @@ Alex Balashov
    1.12. Set timer_interval parameter
    1.13. Set timer_mode parameter
    1.14. Set db_expires parameter
-   1.15. sht_print usage
-   1.16. sht_rm_name_re usage
-   1.17. sht_rm_value_re usage
-   1.18. sht_lock usage
-   1.19. sht_unlock usage
+   1.15. Set enable_dmq parameter
+   1.16. sht_print usage
+   1.17. sht_rm_name_re usage
+   1.18. sht_rm_value_re usage
+   1.19. sht_lock usage
+   1.20. sht_unlock usage
 
 Chapter 1. Admin Guide
 
@@ -123,6 +125,7 @@ Chapter 1. Admin Guide
         3.10. timer_interval (integer)
         3.11. timer_mode (integer)
         3.12. db_expires (integer)
+        3.13. enable_dmq (integer)
 
    4. Functions
 
@@ -169,6 +172,9 @@ Chapter 1. Admin Guide
    expiration time of cached items. The expiration time can be adjusted
    per itme via assignment operation at runtime.
 
+   Replication between multiple servers is performed automatically (if
+   enabled) via the DMQ module.
+
    You can read more about hash tables at:
    http://en.wikipedia.org/wiki/Hash_table.
 
@@ -248,7 +254,8 @@ if(is_present_hf("Authorization"))
 2.1. Kamailio Modules
 
    The following modules must be loaded before this module:
-     * No dependencies on other Kamailio modules.
+     * If DMQ replication is enabled, the DMQ module must be loaded
+       first..
 
 2.2. External Libraries or Applications
 
@@ -287,6 +294,7 @@ if(is_present_hf("Authorization"))
    3.10. timer_interval (integer)
    3.11. timer_mode (integer)
    3.12. db_expires (integer)
+   3.13. enable_dmq (integer)
 
 3.1. htable (str)
 
@@ -318,6 +326,11 @@ if(is_present_hf("Authorization"))
        an item is reset when that item is updated. Certain uses of htable
        may dictate that updates should not reset the expiration timeout,
        however, in which case this attribute can be set to 0.
+     * dmqreplicate - if set to 1, any actions (set, update, delete etc.)
+       performed upon entries in this table will be replicated to other
+       nodes (htable peers). Please note, module parameter "enable_dmq"
+       must also be set in order for this to apply (see below). Default is
+       0 (no replication).
 
    Default value is NULL.
 
@@ -325,7 +338,8 @@ if(is_present_hf("Authorization"))
 ...
 modparam("htable", "htable", "a=>size=4;autoexpire=7200;dbtable=htable_a;")
 modparam("htable", "htable", "b=>size=5;")
-modparam("htable", "htable", "c=>size=4;autoexpire=7200;initval=1;")
+modparam("htable", "htable", "c=>size=4;autoexpire=7200;initval=1;dmqreplicate=1
+;")
 ...
 
 3.2. db_url (str)
@@ -453,6 +467,26 @@ modparam("htable", "timer_mode", 1)
 modparam("htable", "db_expires", 1)
 ...
 
+3.13. enable_dmq (integer)
+
+   If set to 1, will enable DMQ replication of actions performed upon
+   entries in all tables having "dmqreplicate" parameter set. Any update
+   action performed via psuedo-variables, MI and RPC commands will be
+   repeated on all other nodes. Therefore, it is important to ensure the
+   table definition (size, autoexpire etc.) is identical across all
+   instances.
+
+   Currently, values are not replicated on load from DB as it is expected
+   that in these cases, all servers will load their values from the same
+   DB.
+
+   Default value is 0.
+
+   Example 1.15. Set enable_dmq parameter
+...
+modparam("htable", "enable_dmq", 1)
+...
+
 4. Functions
 
    4.1. sht_print()
@@ -469,7 +503,7 @@ modparam("htable", "db_expires", 1)
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
    ONREPLY_ROUTE, BRANCH_ROUTE.
 
-   Example 1.15. sht_print usage
+   Example 1.16. sht_print usage
 ...
 sht_print();
 ...
@@ -482,7 +516,7 @@ sht_print();
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
    ONREPLY_ROUTE, BRANCH_ROUTE.
 
-   Example 1.16. sht_rm_name_re usage
+   Example 1.17. sht_rm_name_re usage
 ...
 sht_rm_name_re("ha=>.*");
 ...
@@ -495,7 +529,7 @@ sht_rm_name_re("ha=>.*");
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
    ONREPLY_ROUTE, BRANCH_ROUTE.
 
-   Example 1.17. sht_rm_value_re usage
+   Example 1.18. sht_rm_value_re usage
 ...
 sht_rm_value_re("ha=>.*");
 ...
@@ -506,7 +540,7 @@ sht_rm_value_re("ha=>.*");
 
    This function can be used from ANY_ROUTE.
 
-   Example 1.18. sht_lock usage
+   Example 1.19. sht_lock usage
 ...
 sht_lock("ha=>test");
 ...
@@ -517,7 +551,7 @@ sht_lock("ha=>test");
 
    This function can be used from ANY_ROUTE.
 
-   Example 1.19. sht_unlock usage
+   Example 1.20. sht_unlock usage
 ...
 sht_lock("ha=>test");
 $sht(ha=>test) = $sht(ha=>test) + 10;

+ 38 - 2
modules/htable/doc/htable_admin.xml

@@ -30,6 +30,10 @@
 		default expiration time of cached items. The expiration time can
 		be adjusted per itme via assignment operation at runtime.
 	</para>
+	<para>
+		Replication between multiple servers is performed automatically (if 
+		enabled) via the DMQ module.
+	</para>
 	<para>
 		You can read more about hash tables at:
 		http://en.wikipedia.org/wiki/Hash_table.
@@ -121,7 +125,7 @@ if(is_present_hf("Authorization"))
 			<itemizedlist>
 			<listitem>
 			<para>
-				<emphasis>No dependencies on other &kamailio; modules</emphasis>.
+				<emphasis>If DMQ replication is enabled, the DMQ module must be loaded first.</emphasis>.
 			</para>
 			</listitem>
 			</itemizedlist>
@@ -272,6 +276,11 @@ if(is_present_hf("Authorization"))
 			<emphasis>updateexpire</emphasis> - if set to 1 (default), the time until expiration of an item is reset when that item is updated.  Certain uses of htable may dictate that updates should not reset the expiration timeout, however, in which case this attribute can be set to 0.
 		</para>
 		</listitem>
+		<listitem>
+		<para>
+			<emphasis>dmqreplicate</emphasis> - if set to 1, any actions (set, update, delete etc.) performed upon entries in this table will be replicated to other nodes (htable peers). Please note, module parameter "enable_dmq" must also be set in order for this to apply (see below). Default is 0 (no replication).
+		</para>
+		</listitem>
 		</itemizedlist>
 		<para>
 		<emphasis>
@@ -284,7 +293,7 @@ if(is_present_hf("Authorization"))
 ...
 modparam("htable", "htable", "a=&gt;size=4;autoexpire=7200;dbtable=htable_a;")
 modparam("htable", "htable", "b=&gt;size=5;")
-modparam("htable", "htable", "c=&gt;size=4;autoexpire=7200;initval=1;")
+modparam("htable", "htable", "c=&gt;size=4;autoexpire=7200;initval=1;dmqreplicate=1;")
 ...
 </programlisting>
 		</example>
@@ -501,6 +510,33 @@ modparam("htable", "timer_mode", 1)
 ...
 modparam("htable", "db_expires", 1)
 ...
+</programlisting>
+		</example>
+	</section>
+	<section>
+		<title><varname>enable_dmq</varname> (integer)</title>
+		<para>
+			If set to 1, will enable DMQ replication of actions performed upon 
+			entries in all tables having "dmqreplicate" parameter set. Any update 
+			action performed via psuedo-variables, MI and RPC commands will be 
+			repeated on all other nodes. Therefore, it is important to ensure the
+			table definition (size, autoexpire etc.) is identical across all instances.
+		</para>
+		<para>
+			Currently, values are not replicated on load from DB as it is expected 
+			that in these cases, all servers will load their values from the same DB.
+		</para>
+		<para>
+		<emphasis>
+			Default value is 0.
+		</emphasis>
+		</para>
+		<example>
+		<title>Set <varname>enable_dmq</varname> parameter</title>
+		<programlisting format="linespecific">
+...
+modparam("htable", "enable_dmq", 1)
+...
 </programlisting>
 		</example>
 	</section>