Hi Imesh,
As mentioned by Janaka we found that the cause for this problem is that the
backend name used by HAProxyStatisticsReader to execute the getWeight
method is different from the HAProxyConfigWriter which writes the backend
name. Changing the naming convention we were able to overcome this problem
and successfully execute the socat commands.

Regards,

On Sat, Dec 5, 2015 at 9:28 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Janaka,
>
> Yes seems like thrift-client-config.xml file in haproxy extension has not
> been updated. If you prefer you can send a pull request to fix it. Will
> include the fix in the next release.
>
> Regarding the second issue:
>
> // echo "get weight <backend>/<server>" | socat stdio <stats-socket>
> command = String.format("%s/get-weight.sh %s %s %s", scriptsPath, backendId, 
> member.getMemberId(), statsSocketFilePath);
> try {
>     output = CommandUtils.executeCommand(command);
>     if ((output != null) && (output.length() > 0)) {
>         array = output.split(" ");
>         if ((array != null) && (array.length > 0)) {
>             weight = Integer.parseInt(array[0]);
>             if (log.isDebugEnabled()) {
>                 log.debug(String.format("Member weight found: [cluster] %s 
> [member] %s [weight] %d", member.getClusterId(), member.getMemberId(), 
> weight));
>             }
>             totalWeight += weight;
>         }
>     }
> }
>
>
> We expect the first item of the array to be an integer. Will you be able
> to execute socat stdio <stats-socket> and share the result?
>
> Thanks
>
>
> On Fri, Dec 4, 2015 at 5:27 PM, Janaka Bandara <
> bandaraukju...@cse.mrt.ac.lk> wrote:
>
>> Hi,
>>
>> I am trying to set up Stratos 4.1.4 with HAProxy (1.6.2) on Amazon
>> EC2. I encountered an error from the ThriftClientConfigParser,
>> "username is not found", and bypassed it by rewriting
>> <HAProxy_EXTENSION_HOME>/conf/thrift-client-config.xml according to
>> the structure used in
>> <Stratos_HOME>/repository/conf/thrift-client-config.xml.
>>
>> However, now I'm facing a different error while the extension is running:
>>
>> java.lang.NumberFormatException: For input string: "No"
>>         at
>> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>>         at java.lang.Integer.parseInt(Integer.java:492)
>>         at java.lang.Integer.parseInt(Integer.java:527)
>>         at
>> org.apache.stratos.haproxy.extension.HAProxyStatisticsReader.getInFlightRequestCount(HAProxyStatisticsReader.java:84)
>>         at
>> org.apache.stratos.load.balancer.common.statistics.notifier.LoadBalancerStatisticsNotifier.run(LoadBalancerStatisticsNotifier.java:83)
>>         at java.lang.Thread.run(Thread.java:745)
>>
>> Investigating further, I found that the backend ID used in generating
>> the HAProxy config (HAProxyConfigWriter) is different from the one
>> used in HAProxyStatisticsReader, and as a result HAProxy generates a
>> "No such backend." response for the "get weight" query executed by
>> HAProxyStatisticsReader.
>>
>> In our case, the config file contains
>> "backend
>> 4b2a1ee5-a02f-8dab-7f78-c2baba1d739f.alias-php-http.test.org_http_80_backend"
>> whereas the extension's query for HAProxy is
>> "get weight
>> 4b2a1ee5-a02f-8dab-7f78-c2baba1d739f.alias-php-http.test.org-http-members/4b2a1ee5-a02f-8dab-7f78-c2baba1d739f.alias-php-http.php3.domainff00df59-7ba2-423f-95cd-912db08b5303"
>>
>> Is there any workaround to overcome this issue?
>>
>> Regards,
>> Janaka
>>
>> --
>> U.K.J.U. Bandara,
>> B.Sc. Eng. (Hons.) Undergraduate,
>> Department of Computer Science and Engineering,
>> University of Moratuwa.
>>
>
>
>
> --
> Imesh Gunaratne
>
> Senior Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>



-- 


*Ridwan Shariffdeen*
​
​Joint PD Director | Rotaract District Committee
​​

IPP | Rotaract Club of University of Moratuwa


Final Year Undergraduate | Computer Science & Engineering,University of
Moratuwa

m:+94 772562002 | e:rshariffd...@gmail.com | w:http://bit.ly/ridwanNaruto |
a: Mount Lavinia
<http://facebook.com/ridwan.naruto>  <http://linkedin.com/in/rshariffdeen>
<http://twitter.com/narutoridwan>
<http://plus.google.com/u/0/117443860077215662076>
<http://github.com/ridwannaruto>

Reply via email to