使用动态路由的卡迈里奥负载均衡

问题描述:

如何使用以下信息划分3台服务器之间的所有传入流量? 我正在配置3个或更多星号服务器的kamailio。我在数据库上配置了dr_rules.gwlist表。使用动态路由的卡迈里奥负载均衡

mysql> select * from dr_gateways; 
+------+------+--------------------+-------+------------+-------+-------------+ 
| gwid | type | address   | strip | pri_prefix | attrs | description | 
+------+------+--------------------+-------+------------+-------+-------------+ 
| 5 | 10 | 192.168.50.11:5060 |  0 | NULL  | NULL |    | 
| 6 | 10 | 192.168.50.12:5060 |  0 | NULL  | NULL |    | 
| 9 | 10 | 192.168.50.16:5060 |  0 | NULL  | NULL |    | 
+------+------+--------------------+-------+------------+-------+-------------+ 
3 rows in set (0.00 sec) 

mysql> select * from dr_rules; 
+--------+---------+----------+-----------------+----------+---------+-----------------------+-------------+ 
| ruleid | groupid | prefix | timerec   | priority | routeid | gwlist    | description | 
+--------+---------+----------+-----------------+----------+---------+-----------------------+-------------+ 
|  13 | 0  | 70704070 |     |  0 | 0  | 6,9;9,6;6,9,5 |    | 
+--------+---------+----------+-----------------+----------+---------+-----------------------+-------------+ 
7 rows in set (0.00 sec) 

我想平衡与70704070前缀3服务器的后续优先级的所有通信:

gwid6 = 40%

gwid9 = 40%

gwid5 = 20%

使用RANDOM https://kamailio.org/docs/modules/1.3.x/cfgutils.html#AEN165

之后,使用调度程序或其他网关管理模块(或仅从带有htable缓存的db读取)