Repository: stratos Updated Branches: refs/heads/lvs_extension 2e3e2d2df -> 33460d56e
Update LVS statistics reader Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/33460d56 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/33460d56 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/33460d56 Branch: refs/heads/lvs_extension Commit: 33460d56ebe1def7e4eb72c36b157d7a3be08203 Parents: 2e3e2d2 Author: Gayan Gunarathne <[email protected]> Authored: Wed May 27 12:05:01 2015 +0530 Committer: Gayan Gunarathne <[email protected]> Committed: Wed May 27 12:05:01 2015 +0530 ---------------------------------------------------------------------- extensions/load-balancer/lvs-extension/README.md | 14 +------------- .../stratos/lvs/extension/LVSStatisticsReader.java | 4 ++-- 2 files changed, 3 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/33460d56/extensions/load-balancer/lvs-extension/README.md ---------------------------------------------------------------------- diff --git a/extensions/load-balancer/lvs-extension/README.md b/extensions/load-balancer/lvs-extension/README.md index 3003aea..13de2e0 100644 --- a/extensions/load-balancer/lvs-extension/README.md +++ b/extensions/load-balancer/lvs-extension/README.md @@ -6,7 +6,7 @@ tenant application signups and domain mapping information received from Stratos ## How it works 1. Wait for the complete topology event message to initialize the topology. -2. Configure keepal +2. Configure Keepalived 3. Listen to topology, application, application signup, domain mapping events. 4. Reload Keepalived instance with the new topology configuration. 5. Periodically publish statistics to Complex Event Processor (CEP). @@ -14,17 +14,5 @@ tenant application signups and domain mapping information received from Stratos ## Statistics publishing Set cep.stats.publisher.enabled to true in lvs-extension.sh file to enable statistics publishing. -///Following need to removed -Please note that -Nginx must be compiled with HttpStubStatusModule module to read statistics. Execute the following command to make - sure that HttpStubStatusModule module is installed: -``` -nginx -V 2>&1 | grep -o with-http_stub_status_module -``` -If HttpStubStatusModule is installed the following output will be given: -``` -with-http_stub_status_module -``` - ## Installation Please refer INSTALL.md for information on the installation process. http://git-wip-us.apache.org/repos/asf/stratos/blob/33460d56/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java ---------------------------------------------------------------------- diff --git a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java index f707090..cfb3435 100644 --- a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java +++ b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java @@ -34,7 +34,7 @@ import java.io.IOException; public class LVSStatisticsReader implements LoadBalancerStatisticsReader { private static final Log log = LogFactory.getLog(LVSStatisticsReader.class); - private static final String IPVSADM_STATS_COMMAND = "sudo ipvsadm -l --stats | grep TCP"; + private static final String IPVSADM_STATS_COMMAND = "sudo ipvsadm -L -n |grep Route"; //"ipvsadm -l --stats | grep TCP" private TopologyProvider topologyProvider; @@ -55,7 +55,7 @@ public class LVSStatisticsReader implements LoadBalancerStatisticsReader { if ((output != null) && (output.length() > 0)) { array = output.split("\n"); for (int i = 0; i < array.length; i++) { - weight = Integer.parseInt(array[i].substring(38, 42).toString().trim()); + weight = Integer.parseInt(array[i].substring(46, 50).toString().trim()); totalWeight += weight; } }
