Re: How to write multiple config file in haproxy

2014-02-04 Thread Steven Le Roux
Hi,

Here is how I manage this :

I write a different frontend/backend file for each frontend :

https://github.com/StevenLeRoux/webhub/blob/master/src/genconf.py

then when I start  :

https://github.com/StevenLeRoux/webhub/blob/master/src/haproxyctl

is doing : $CPP -P -C -I$HAPROXY_CONFDIR/$HAPHOST
-I$HAPROXY_CONFDIR/backend -I$HAPROXY_CONFDIR/frontend -o
$HAPROXY_CONF $HAPROXY_CPP

which basically rebuild one config file. Very fast and you still have
the flexibility to manually remove a frontend quickly.

Note that the genconf.py is old now and need to be fixed (header
manipulations...)

Regards,

On Tue, Feb 4, 2014 at 8:51 AM, Willy Tarreau  wrote:
> On Tue, Feb 04, 2014 at 10:20:28AM +0530, Sukanta Saha wrote:
>> Guys can you please help me
>
> Didn't you get Jonathan's response ?
>
>http://marc.info/?l=haproxy&m=139125884712930&w=2
>
> Willy
>
>



-- 
Steven Le Roux
Jabber-ID : ste...@jabber.fr
0x39494CCB 
2FF7 226B 552E 4709 03F0  6281 72D7 A010 3949 4CCB



Re: How to write multiple config file in haproxy

2014-02-03 Thread Willy Tarreau
On Tue, Feb 04, 2014 at 10:20:28AM +0530, Sukanta Saha wrote:
> Guys can you please help me

Didn't you get Jonathan's response ?

   http://marc.info/?l=haproxy&m=139125884712930&w=2

Willy




Re: How to write multiple config file in haproxy

2014-02-03 Thread Sukanta Saha
Guys can you please help me

Thanks


On Sat, Feb 1, 2014 at 6:02 PM, Sukanta Saha  wrote:

> Thanks for all your help, I will try,
>
> I have one more question that is about the haproxy.conf file , in this
> file we have written so many backends which are getting called from the
> frontends.
> Is there a way that I can seperate out the backends in multiple config
> files and from my main haproxy.conf file I will call those files.
> So that the main files looks clean and nice and I will have multiple
> config files for my each service or  backends . If I need to change
> anything for a service I will change the corresponding config file not the
> main file.
>
> Please help me out here.
>
>
> Thanks And Regards
>
> Sukanta
>


Re: How to write multiple config file in haproxy

2014-02-01 Thread Jonathan Matthews
On 1 February 2014 12:32, Sukanta Saha  wrote:
> Thanks for all your help, I will try,
>
> I have one more question that is about the haproxy.conf file , in this file
> we have written so many backends which are getting called from the
> frontends.
> Is there a way that I can seperate out the backends in multiple config files
> and from my main haproxy.conf file I will call those files.
> So that the main files looks clean and nice and I will have multiple config
> files for my each service or  backends . If I need to change anything for a
> service I will change the corresponding config file not the main file.

HAProxy can accept multiple "-f " parameters when it's
started, but I /believe/ there are some constraints on the files'
contents, such as each section must be fully defined in a single file.
I forget the exact details and don't have them to hand. You'll
probably need to change your init script to support this as well.

Also, there isn't an "include" directive you can use inline, in the
config file. There is some talk about it on this list, but I don't
believe it's available yet - if ever.

You may also find people have written init wrappers that simulate this
or other multiple-config-file behaviours. I don't have a link to them
myself, but you may find them mentioned somewhere in the list
archives: http://marc.info/?l=haproxy

Cheers,
Jonathan



How to write multiple config file in haproxy

2014-02-01 Thread Sukanta Saha
Thanks for all your help, I will try,

I have one more question that is about the haproxy.conf file , in this file
we have written so many backends which are getting called from the
frontends.
Is there a way that I can seperate out the backends in multiple config
files and from my main haproxy.conf file I will call those files.
So that the main files looks clean and nice and I will have multiple config
files for my each service or  backends . If I need to change anything for a
service I will change the corresponding config file not the main file.

Please help me out here.


Thanks And Regards

Sukanta