How can i use proxy server for my backend servers.

2018-01-05 Thread Kuldip Madnani
Hi,

I would like to use a http proxy, to access my backends that are defined in
my haproxy configuration. Is there a way we can define http_proxy in
HAProxy configuration?

Thanks,
Kuldip


Encrypt password for statistics page.

2017-03-03 Thread Kuldip Madnani
Hi,

Does anybody know how can we hide the password for HAProxy statistics page
in haproxy.cfg or encrypt it somehow.

Thanks,
Kuldip Madnani



  <https://mailtrack.io/> Sent with Mailtrack
<https://mailtrack.io/install?source=signature=en=k.madnan...@gmail.com=22>


Unable to compile HAProxy on RHEL7

2016-07-22 Thread Kuldip Madnani
I want to compile HAProxy version 1.6.7 for which i am using the following
steps:

1. tar xzvf haproxy-1.6.7.tar.gz
2.  make TARGET="generic" USE_STATIC_PCRE=1 USE_OPENSSL=1 USE_LIBCRYPT=1
USE_ZLIB=1

But getting this error:

$ make TARGET="generic" USE_STATIC_PCRE=1 USE_OPENSSL=1 USE_LIBCRYPT=1
USE_ZLIB=1
gcc -Iinclude -Iebtree -Wall  -O2 -g -fno-strict-aliasing
-Wdeclaration-after-statement   -DTPROXY -DCONFIG_HAP_CRYPT -DUSE_ZLIB
 -DENABLE_POLL -DUSE_OPENSSL  -DUSE_PCRE -I/usr/local/include
 -DCONFIG_HAPROXY_VERSION=\"1.6.7\" -DCONFIG_HAPROXY_DATE=\"2016/07/13\" \
  -DBUILD_TARGET='"generic"' \
  -DBUILD_ARCH='""' \
  -DBUILD_CPU='"generic"' \
  -DBUILD_CC='"gcc"' \
  -DBUILD_CFLAGS='"-O2 -g -fno-strict-aliasing
-Wdeclaration-after-statement"' \
  -DBUILD_OPTIONS='"USE_LIBCRYPT=1 USE_ZLIB=1 USE_OPENSSL=1
USE_STATIC_PCRE=1"' \
   -c -o src/haproxy.o src/haproxy.c
In file included from include/types/proxy.h:33:0,
 from include/proto/log.h:32,
 from include/common/cfgparse.h:29,
 from src/haproxy.c:63:
include/common/regex.h:31:18: fatal error: pcre.h: No such file or directory
 #include 
  ^
compilation terminated.
make: *** [src/haproxy.o] Error 1


Could anybody please help?

Thanks,
Kuldip



Sent with MailTrack



skipping incompatible /usr/lib/libcrypt.so when searching for -lcrypt

2014-07-17 Thread Kuldip Madnani
Does anybody know about this error, and how it can be fixed:

I installed the required devel packages and the compilation went fine but i
could see a message at the bottom(skipping incompatible
/usr/lib/libcrypt.so when searching for -lcrypt) .Is it severe or can be
ignored?

gcc  -g -o haproxy src/haproxy.o src/sessionhash.o src/base64.o
src/protocol.o src/uri_auth.o src/standard.o src/buffer.o src/log.o
src/task.o src/chunk.o src/channel.o src/listener.o src/time.o src/fd.o
src/pipe.o src/regex.o src/cfgparse.o src/server.o src/checks.o src/queue.o
src/frontend.o src/proxy.o src/peers.o src/arg.o src/stick_table.o
src/proto_uxst.o src/connection.o src/proto_http.o src/raw_sock.o
src/appsession.o src/backend.o src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o
src/lb_map.o src/lb_fas.o src/stream_interface.o src/dumpstats.o
src/proto_tcp.o src/session.o src/hdr_idx.o src/ev_select.o src/signal.o
src/acl.o src/sample.o src/memory.o src/freq_ctr.o src/auth.o
src/compression.o src/payload.o src/hash.o src/pattern.o src/map.o
src/ev_poll.o src/ev_epoll.o src/ssl_sock.o src/shctx.o ebtree/ebtree.o
ebtree/eb32tree.o ebtree/eb64tree.o ebtree/ebmbtree.o ebtree/ebsttree.o
ebtree/ebimtree.o ebtree/ebistree.o   -lcrypt  -lz  -lssl -lcrypto
-L/usr/lib -lpcreposix -lpcre
/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.so when searching for
-lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
gcc -Iinclude -Iebtree -Wall  -O2 -g -fno-strict-aliasing
-DCONFIG_HAP_LINUX_SPLICE -DTPROXY -DCONFIG_HAP_LINUX_TPROXY
-DCONFIG_HAP_CRYPT -DUSE_ZLIB  -DENABLE_POLL -DENABLE_EPOLL
-DUSE_CPU_AFFINITY -DASSUME_SPLICE_WORKS -DUSE_ACCEPT4 -DNETFILTER
-DUSE_GETSOCKNAME -DUSE_OPENSSL  -DUSE_SYSCALL_FUTEX -DUSE_PCRE
-I/usr/include  -DCONFIG_HAPROXY_VERSION=\1.5.2\
-DCONFIG_HAPROXY_DATE=\2014/07/12\ \
  -DSBINDIR='/usr/local/sbin' \
   -c -o src/haproxy-systemd-wrapper.o
src/haproxy-systemd-wrapper.c
gcc  -g -o haproxy-systemd-wrapper src/haproxy-systemd-wrapper.o   -lcrypt
 -lz  -lssl -lcrypto -L/usr/lib -lpcreposix -lpcre
/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.so when searching for
-lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc


Re: skipping incompatible /usr/lib/libcrypt.so when searching for -lcrypt

2014-07-17 Thread Kuldip Madnani
What minimum version of libcrypt.so and libc.so is required to perfectly
compile haproxy 1.5.2?


On Thu, Jul 17, 2014 at 2:17 PM, Sasha Pachev sa...@asksasha.com wrote:

 This means that you have incompatible (from the point of view of ld)
 versions of libcrypt.so and libc.so that would have otherwise been
 first preference to resolve the dependencies, but since the
 compilation succeeded those apparently were found somewhere else. If
 haproxy starts up and is able to serve requests, you should be OK, but
 I would still check out why you have incompatible versions installed.
 A good place to start is

 file /usr/lib/libc.so


 On Thu, Jul 17, 2014 at 10:55 AM, Kuldip Madnani k.madnan...@gmail.com
 wrote:
  Does anybody know about this error, and how it can be fixed:
 
  I installed the required devel packages and the compilation went fine
 but i
  could see a message at the bottom(skipping incompatible
 /usr/lib/libcrypt.so
  when searching for -lcrypt) .Is it severe or can be ignored?
 
  gcc  -g -o haproxy src/haproxy.o src/sessionhash.o src/base64.o
  src/protocol.o src/uri_auth.o src/standard.o src/buffer.o src/log.o
  src/task.o src/chunk.o src/channel.o src/listener.o src/time.o src/fd.o
  src/pipe.o src/regex.o src/cfgparse.o src/server.o src/checks.o
 src/queue.o
  src/frontend.o src/proxy.o src/peers.o src/arg.o src/stick_table.o
  src/proto_uxst.o src/connection.o src/proto_http.o src/raw_sock.o
  src/appsession.o src/backend.o src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o
  src/lb_map.o src/lb_fas.o src/stream_interface.o src/dumpstats.o
  src/proto_tcp.o src/session.o src/hdr_idx.o src/ev_select.o src/signal.o
  src/acl.o src/sample.o src/memory.o src/freq_ctr.o src/auth.o
  src/compression.o src/payload.o src/hash.o src/pattern.o src/map.o
  src/ev_poll.o src/ev_epoll.o src/ssl_sock.o src/shctx.o ebtree/ebtree.o
  ebtree/eb32tree.o ebtree/eb64tree.o ebtree/ebmbtree.o ebtree/ebsttree.o
  ebtree/ebimtree.o ebtree/ebistree.o   -lcrypt  -lz  -lssl -lcrypto
  -L/usr/lib -lpcreposix -lpcre
  /usr/bin/ld: skipping incompatible /usr/lib/libcrypt.so when searching
 for
  -lcrypt
  /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for
 -lc
  gcc -Iinclude -Iebtree -Wall  -O2 -g -fno-strict-aliasing
  -DCONFIG_HAP_LINUX_SPLICE -DTPROXY -DCONFIG_HAP_LINUX_TPROXY
  -DCONFIG_HAP_CRYPT -DUSE_ZLIB  -DENABLE_POLL -DENABLE_EPOLL
  -DUSE_CPU_AFFINITY -DASSUME_SPLICE_WORKS -DUSE_ACCEPT4 -DNETFILTER
  -DUSE_GETSOCKNAME -DUSE_OPENSSL  -DUSE_SYSCALL_FUTEX -DUSE_PCRE
  -I/usr/include  -DCONFIG_HAPROXY_VERSION=\1.5.2\
  -DCONFIG_HAPROXY_DATE=\2014/07/12\ \
-DSBINDIR='/usr/local/sbin' \
 -c -o src/haproxy-systemd-wrapper.o
  src/haproxy-systemd-wrapper.c
  gcc  -g -o haproxy-systemd-wrapper src/haproxy-systemd-wrapper.o
 -lcrypt
  -lz  -lssl -lcrypto -L/usr/lib -lpcreposix -lpcre
  /usr/bin/ld: skipping incompatible /usr/lib/libcrypt.so when searching
 for
  -lcrypt
  /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for
 -lc



 --
 Sasha Pachev

 Fast Running Blog.
 http://fastrunningblog.com
 Run. Blog. Improve. Repeat.



Binaries for HAProxy.

2014-07-16 Thread Kuldip Madnani
Hi,

Where can i find the compiled binaries for haproxy.My system configuration
is this :

$ uname -a
Linux  2.6.32-279.22.1.el6.x86_64 #1 SMP Sun Jan 13 09:21:40 EST 2013
x86_64 x86_64 x86_64 GNU/Linux

Thanks  Regards,
Kuldip


Re: Binaries for HAProxy.

2014-07-16 Thread Kuldip Madnani
My Linux Distribution is :

Red Hat Enterprise Linux Server release 6.3 (Santiago)


On Wed, Jul 16, 2014 at 9:03 AM, Mathew Levett mat...@loadbalancer.org
wrote:

 Hi Kuldip,

 I think you may need to provide a little more information, it may be that
 your Linux distribution may already have haproxy in their repository.
 However the information supplied does not really show what your running.
 Do you know the distribution name?

 If its Debian then something like 'apt-get install haproxy' may be all you
 need, RedHat based distros may use yum so 'yum install haproxy'.  however
 its also not that hard to compile the latest version from source and is
 well documented in the download file.

 Usually on a list like this you need to supply as much information as
 possible so the people here can help.

 Kind Regards,

 Mathew


 On 16 July 2014 14:50, Kuldip Madnani k.madnan...@gmail.com wrote:

 Hi,

 Where can i find the compiled binaries for haproxy.My system
 configuration is this :

 $ uname -a
 Linux  2.6.32-279.22.1.el6.x86_64 #1 SMP Sun Jan 13 09:21:40 EST 2013
 x86_64 x86_64 x86_64 GNU/Linux

 Thanks  Regards,
 Kuldip





Re: Binaries for HAProxy.

2014-07-16 Thread Kuldip Madnani
:130: error: âstruct bind_confâ has no member named
âfileâ
include/proto/listener.h:131: error: âstruct bind_confâ has no member named
âlineâ
include/proto/listener.h:133: error: âstruct bind_confâ has no member named
âby_feâ
include/proto/listener.h:133: error: âstruct bind_confâ has no member named
âby_feâ
include/proto/listener.h:133: error: âstruct bind_confâ has no member named
âby_feâ
include/proto/listener.h:133: error: âstruct bind_confâ has no member named
âby_feâ
include/proto/listener.h:133: error: âstruct bind_confâ has no member named
âby_feâ
include/proto/listener.h:135: error: âstruct bind_confâ has no member named
âargâ
include/proto/listener.h:137: error: âstruct bind_confâ has no member named
âuxâ
include/proto/listener.h:138: error: âstruct bind_confâ has no member named
âuxâ
include/proto/listener.h:139: error: âstruct bind_confâ has no member named
âuxâ
include/proto/listener.h:141: error: âstruct bind_confâ has no member named
âlistenersâ
include/proto/listener.h:141: error: âstruct bind_confâ has no member named
âlistenersâ
include/proto/listener.h:141: error: âstruct bind_confâ has no member named
âlistenersâ
In file included from src/haproxy.c:107:
include/proto/ssl_sock.h: At top level:
include/proto/ssl_sock.h:46: error: expected declaration specifiers or
â...â before âSSL_CTXâ
src/haproxy.c:153: error: âMAX_WBITSâ undeclared here (not in a function)
src/haproxy.c: In function âdisplay_build_optsâ:
src/haproxy.c:254: error: expected â)â before âZLIB_VERSIONâ
src/haproxy.c:272: error: expected â)â before âOPENSSL_VERSION_TEXTâ
src/haproxy.c:274: warning: implicit declaration of function
âSSLeay_versionâ
src/haproxy.c:274: error: âSSLEAY_VERSIONâ undeclared (first use in this
function)
src/haproxy.c:274: error: (Each undeclared identifier is reported only once
src/haproxy.c:274: error: for each function it appears in.)
src/haproxy.c:275: error: âOPENSSL_VERSION_NUMBERâ undeclared (first use in
this function)
src/haproxy.c:275: warning: implicit declaration of function âSSLeayâ
src/haproxy.c:308: warning: implicit declaration of function âpcre_versionâ
src/haproxy.c:308: warning: format â%sâ expects type âchar *â, but argument
2 has type âintâ
src/haproxy.c: In function âdeinitâ:
src/haproxy.c:1188: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1188: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1188: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1188: warning: left-hand operand of comma expression has no
effect
src/haproxy.c:1188: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1188: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1188: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1196: error: âstruct bind_confâ has no member named âfileâ
src/haproxy.c:1197: error: âstruct bind_confâ has no member named âargâ
src/haproxy.c:1198: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1198: warning: type defaults to âintâ in declaration of
â__retâ
src/haproxy.c:1198: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1198: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1198: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1198: error: âstruct bind_confâ has no member named âby_feâ
src/haproxy.c:1198: error: âstruct bind_confâ has no member named âby_feâ
make: *** [src/haproxy.o] Error 1


On Wed, Jul 16, 2014 at 9:18 AM, Ryan O'Hara roh...@redhat.com wrote:

 On Wed, Jul 16, 2014 at 09:07:48AM -0500, Kuldip Madnani wrote:
  My Linux Distribution is :
 
  Red Hat Enterprise Linux Server release 6.3 (Santiago)

 HAProxy is not included in RHEL 6.3. You will need RHEL 6.4 with Load
 Balancer AddOn or RHEL7.

 Ryan

  On Wed, Jul 16, 2014 at 9:03 AM, Mathew Levett mat...@loadbalancer.org
  wrote:
 
   Hi Kuldip,
  
   I think you may need to provide a little more information, it may be
 that
   your Linux distribution may already have haproxy in their repository.
   However the information supplied does not really show what your
 running.
   Do you know the distribution name?
  
   If its Debian then something like 'apt-get install haproxy' may be all
 you
   need, RedHat based distros may use yum so 'yum install haproxy'.
  however
   its also not that hard to compile the latest version from source and is
   well documented in the download file.
  
   Usually on a list like this you need to supply as much information as
   possible so the people here can help.
  
   Kind Regards,
  
   Mathew
  
  
   On 16 July 2014 14:50, Kuldip Madnani k.madnan...@gmail.com wrote:
  
   Hi,
  
   Where can i find the compiled binaries for haproxy.My system
   configuration is this :
  
   $ uname -a
   Linux  2.6.32-279.22.1.el6.x86_64 #1 SMP Sun Jan 13 09:21:40 EST 2013
   x86_64 x86_64 x86_64 GNU/Linux
  
   Thanks  Regards,
   Kuldip
  
  
  



RabbitMQ-HAProxy raising a exception.

2014-02-06 Thread Kuldip Madnani
Hi,

I am trying to connect my RabbitMQ cluster through HAProxy.When connected
directly to RabbitMQ nodes it works fine but when connected through HAProxy
it raises following exception :

com.rabbitmq.client.ShutdownSignalException: connection error; reason:
java.io.EOFException
at
com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:678)
at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:668)
at
com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:546)
Caused by: java.io.EOFException
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
at
com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:131)
at
com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:515)

What could be the reason.I see RabbitMQ guys said in many forums to check
it with HAProxy.

Thanks  Regards,
Kuldip Madnani


Re: RabbitMQ-HAProxy raising a exception.

2014-02-06 Thread Kuldip Madnani
I have the following setting for HAProxy and no settings in client for
connectionFactory:

defaults
log global
modetcp
option  tcplog
option  dontlognull
retries 3
option  redispatch
maxconn 4096
timeout connect 5s # default 5 second time out if a backend is not found
timeout client 300s
timeout server 300s


# Entries for rabbitmq_CLUSTER6 Listener
#--#
listen rabbitmq_CLUSTER6   *:5678
mode   tcp
maxconn8092
option allbackups
balanceroundrobin
server LISTENER_rabbitmq_CLUSTER6_zldv3697_vci_att_com_5672
zldv3697.XXX.XXX.com:5672 weight 10 check inter 5000 rise 2 fall 3
##

Do these values impact and throw java.io.EOFException.

Thanks  Regards,
Kuldip Madnani



On Thu, Feb 6, 2014 at 2:08 PM, Ryan O'Hara roh...@redhat.com wrote:

 On Thu, Feb 06, 2014 at 02:05:07PM -0600, Kuldip Madnani wrote:
  Hi,
 
  I am trying to connect my RabbitMQ cluster through HAProxy.When connected
  directly to RabbitMQ nodes it works fine but when connected through
 HAProxy
  it raises following exception :

 What are your client/server timeouts?

 Ryan

  com.rabbitmq.client.ShutdownSignalException: connection error; reason:
  java.io.EOFException
  at
 
 com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:678)
  at
 com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:668)
  at
 
 com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:546)
  Caused by: java.io.EOFException
  at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
  at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
  at
 
 com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:131)
  at
 
 com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:515)
 
  What could be the reason.I see RabbitMQ guys said in many forums to check
  it with HAProxy.
 
  Thanks  Regards,
  Kuldip Madnani



Re: Question about logging in HAProxy

2014-02-06 Thread Kuldip Madnani
I configured my rsyslog with below settings and was able to generate
haproxy.log in my directory /opt/app/haproxy but it gets generated with
owner root and file permission rw--.Does anybody know or implemented as
to how to change the ownership and file permissions for the log directory.I
know its a more of rsyslog question than HAProxy but if any body having any
idea?

Step 1 : Edit the config file of rsyslog(rsyslog.conf)
uncomment the below lines in rsyslog.conf :
#$ModLoad imudp
#$UDPServerRun 514

Add following line:
$UDPServerAddress 127.0.0.1

2. Create a file /etc/rsyslog.d/haproxy.conf and insert the following



if ($programname == 'haproxy' and $syslogseverity-text == 'info') then
-/opt/app/haproxy/log/haproxy-info.log
 ~

3.Now restart the rsyslog service
service rsyslog restart


Thanks  Regards,

Kuldip Madnani



On Tue, Feb 4, 2014 at 4:44 PM, Willy Tarreau w...@1wt.eu wrote:

 Hi Ryan,

 On Tue, Feb 04, 2014 at 04:00:14PM -0600, Ryan O'Hara wrote:
  On Tue, Feb 04, 2014 at 02:05:24PM -0600, Kuldip Madnani wrote:
   Hi,
  
   I want to redirect the logs generated by HAProxy into some specific
 file .I
   read that in the global section in log option i can put a file location
   instead of IP address.I tried using that setting but it dint work for
 me,
   also i enabled tcp logging in my listener but no luck.Could any body
 tell
   if i am missing something.Here is my configuration:
   global
   
   log /opt/app/workload/haproxy/log/haproxy.log syslog info
   
 
  On my systems (which use rsyslog) I do this:
 
  log /dev/log local0
 
  Then I create /etc/rsyslog.d/haproxy.conf, which contains:
 
  local0.* /var/log/haproxy
 
  And everything gets logged there.

 Just a minor point here, when you're dealing with a proxy which is used
 in contexts of high load (thousands to tens of thousands of requests per
 second), the unix socket's log buffers are too small on many systems, and
 many log messages are dropped. Thus on these systems, logging over UDP is
 preferred (which requires to setup the syslog server to listen to UDP,
 and preferrably only on localhost).

 Best regards,
 Willy




Question about logging in HAProxy

2014-02-04 Thread Kuldip Madnani
Hi,

I want to redirect the logs generated by HAProxy into some specific file .I
read that in the global section in log option i can put a file location
instead of IP address.I tried using that setting but it dint work for me,
also i enabled tcp logging in my listener but no luck.Could any body tell
if i am missing something.Here is my configuration:
global

log /opt/app/workload/haproxy/log/haproxy.log syslog info



listen rabbitmq_perfCluster   *:5693
mode   tcp
maxconn32000
option allbackups
option tcplog
option logasap
log global
balanceroundrobin


Thanks  Regards,
Kuldip madnani


Using Load balancer(HA Proxy) while Federating of clusters.

2013-05-06 Thread Kuldip Madnani
Hi,

I am having a configuration where in i have two different clusters(say C1 
C2) and each with 3 nodes.
C1-N1,N2,N3
C2-N4,N5,N6.

If I want to federate cluster C1 to cluster C2 do i need to federate the
cluster C1 to each of the above node N4,N5,N6 ?

If suppose i want to implement load balancing along with federation what
changes do i need to make in the config file of my HAProxy?

Thanks  Regards,
Kuldip