You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by salil GK <gk...@gmail.com> on 2017/02/06 14:05:05 UTC

Re: Trying to run two instances of traffic servers in same machine

Thanks James for the reply.

Over riding the config variable through environment is a good and nice
option.
But another problem is how do I over ride the location of server.lock file
 - there is no way I can specify this. What happens is - second instance
also try to use the same server.lock file and it fails .

Regards
~S

On 28 December 2016 at 04:51, James Peach <jp...@apache.org> wrote:

>
> > On Dec 20, 2016, at 7:19 PM, salil GK <gk...@gmail.com> wrote:
> >
> > Hello
> >
> >    I am trying to run two instances of the traffic servers in the same
> server. I found it a bit tricky as the configuration and management ( locks
> etc ) files locations are like hard coded ( not sure though ). Could some
> one please give some tips on how this can be achieved.
>
> This should work fine, though the details are a little subtle.
>
> First, you can use the TS_ROOT environment variable to specify the
> installation prefix (what you passed to configure —prefix) at runtime,
> Next, you can override al the paths to various configuration files and
> directories at runtime by setting the record value in the environment,
>
> https://docs.trafficserver.apache.org/en/latest/admin-
> guide/files/records.config.en.html#environment-overrides
>
> https://docs.trafficserver.apache.org/en/latest/admin-
> guide/files/records.config.en.html#proxy-config-config-dir
>
> Finally, traffic_manager listens on local ports, so you need to make sure
> they don’t collide for each instance. See proxy.config.admin.synthetic_port
> and proxy.config.process_manager.mgmt_port.
>
> >
> >    My requirement can be summarised as below.
> >
> > 1. I two servers in DMZ zone ( May machine B and machine C )
> > 2. I have one machine ( client ) inside enterprise (machine A ) and one
> server in the internet ( Machine D )
> > 3. I want to send a message ( or rather forward ) from Machine A ( enter
> prise ) to MAchine D ( internet ) through Machine B and Machine C.
> > 4 there is already ATS running in Machine B and Machine C as reverse
> proxy.
> > 5. I want to do Mutual TLS verification between Machine B and Machine A
> >
> >
> > in a nutshell
> >
> > A  ->  B  ->  C  ->  D
> >
> > A is in enterprise
> > B and  C are ATS  ( one instance of ATS is already there as reverse
> proxy )
> > D is in internet
> >
> > A and B mutual TLS
> >
> >
> > Could you please help me out here on how to set this up. Or is there any
> pressing reason why I cannot make this setup work ?
> >
> > Thanks a ton in advance
>
>

Re: Trying to run two instances of traffic servers in same machine

Posted by "Lerner, Steve" <sl...@ebay.com>.
You may want two consider running two containers on the same machine and handling your need of two ATS instances via orchestration…it’s a far more elegant and scalable solution



Steve Lerner | Principal Architect, Network Operations | m 212.495.9212 | slerner@ebay.com<ma...@ebay.com>
[cid:image001.png@01D281F5.61D89440]

From: salil GK <gk...@gmail.com>
Reply-To: "users@trafficserver.apache.org" <us...@trafficserver.apache.org>
Date: Wednesday, February 8, 2017 at 9:31 AM
To: "users@trafficserver.apache.org" <us...@trafficserver.apache.org>
Subject: Re: Trying to run two instances of traffic servers in same machine

Thanks for the suggestion 'Rebirthing'. Yes this may work - but looks a bit untidy :-( ..  two installations of same program in a machine looks bad !

On 8 February 2017 at 08:02, Rebirthing <ne...@gmail.com>> wrote:
I didn't check this.

Anyway.. In my guess, this could work!

1. Build the source with A directory base(ex. '/opt/ts1/')
2. Install it
3. Build the source with B directory base(ex. '/opt/ts2/')
4. Install it
5. Config ts1&ts2 properly to prevent conflict(ex. ports).
6. Run them!

the locks of instances will be made in each directory base.

Thus it may work well.

Maybe... not :(

Thank you



2017-02-07 12:35 GMT+09:00 James Peach <ja...@me.com>>:

> On Feb 6, 2017, at 6:05 AM, salil GK <gk...@gmail.com>> wrote:
>
> Thanks James for the reply.
>
> Over riding the config variable through environment is a good and nice option.
> But another problem is how do I over ride the location of server.lock file  - there is no way I can specify this. What happens is - second instance also try to use the same server.lock file and it fails .

This is controlled by proxy.config.local_state_dir and/or TS_ROOT. Fot example:

$ /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
RUNTIMEDIR: /opt/ats/var/trafficserver
$ TS_ROOT=/instance /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
RUNTIMEDIR: /instance/var/trafficserver
$ PROXY_CONFIG_LOCAL_STATE_DIR=/var/instance/foo /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
RUNTIMEDIR: /var/instance/foo


> Regards
> ~S
>
> On 28 December 2016 at 04:51, James Peach <jp...@apache.org>> wrote:
>
> > On Dec 20, 2016, at 7:19 PM, salil GK <gk...@gmail.com>> wrote:
> >
> > Hello
> >
> >    I am trying to run two instances of the traffic servers in the same server. I found it a bit tricky as the configuration and management ( locks etc ) files locations are like hard coded ( not sure though ). Could some one please give some tips on how this can be achieved.
>
> This should work fine, though the details are a little subtle.
>
> First, you can use the TS_ROOT environment variable to specify the installation prefix (what you passed to configure —prefix) at runtime, Next, you can override al the paths to various configuration files and directories at runtime by setting the record value in the environment,
>
> https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#environment-overrides
>
> https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-config-dir
>
> Finally, traffic_manager listens on local ports, so you need to make sure they don’t collide for each instance. See proxy.config.admin.synthetic_port and proxy.config.process_manager.mgmt_port.
>
> >
> >    My requirement can be summarised as below.
> >
> > 1. I two servers in DMZ zone ( May machine B and machine C )
> > 2. I have one machine ( client ) inside enterprise (machine A ) and one server in the internet ( Machine D )
> > 3. I want to send a message ( or rather forward ) from Machine A ( enter prise ) to MAchine D ( internet ) through Machine B and Machine C.
> > 4 there is already ATS running in Machine B and Machine C as reverse proxy.
> > 5. I want to do Mutual TLS verification between Machine B and Machine A
> >
> >
> > in a nutshell
> >
> > A  ->  B  ->  C  ->  D
> >
> > A is in enterprise
> > B and  C are ATS  ( one instance of ATS is already there as reverse proxy )
> > D is in internet
> >
> > A and B mutual TLS
> >
> >
> > Could you please help me out here on how to set this up. Or is there any pressing reason why I cannot make this setup work ?
> >
> > Thanks a ton in advance
>
>



Re: Trying to run two instances of traffic servers in same machine

Posted by salil GK <gk...@gmail.com>.
Thanks for the suggestion 'Rebirthing'. Yes this may work - but looks a bit
untidy :-( ..  two installations of same program in a machine looks bad !

On 8 February 2017 at 08:02, Rebirthing <ne...@gmail.com> wrote:

> I didn't check this.
>
> Anyway.. In my guess, this could work!
>
> 1. Build the source with A directory base(ex. '/opt/ts1/')
> 2. Install it
> 3. Build the source with B directory base(ex. '/opt/ts2/')
> 4. Install it
> 5. Config ts1&ts2 properly to prevent conflict(ex. ports).
> 6. Run them!
>
> the locks of instances will be made in each directory base.
>
> Thus it may work well.
>
> Maybe... not :(
>
> Thank you
>
>
>
> 2017-02-07 12:35 GMT+09:00 James Peach <ja...@me.com>:
>
>>
>> > On Feb 6, 2017, at 6:05 AM, salil GK <gk...@gmail.com> wrote:
>> >
>> > Thanks James for the reply.
>> >
>> > Over riding the config variable through environment is a good and nice
>> option.
>> > But another problem is how do I over ride the location of server.lock
>> file  - there is no way I can specify this. What happens is - second
>> instance also try to use the same server.lock file and it fails .
>>
>> This is controlled by proxy.config.local_state_dir and/or TS_ROOT. Fot
>> example:
>>
>> $ /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
>> RUNTIMEDIR: /opt/ats/var/trafficserver
>> $ TS_ROOT=/instance /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
>> RUNTIMEDIR: /instance/var/trafficserver
>> $ PROXY_CONFIG_LOCAL_STATE_DIR=/var/instance/foo
>> /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
>> RUNTIMEDIR: /var/instance/foo
>>
>>
>> > Regards
>> > ~S
>> >
>> > On 28 December 2016 at 04:51, James Peach <jp...@apache.org> wrote:
>> >
>> > > On Dec 20, 2016, at 7:19 PM, salil GK <gk...@gmail.com> wrote:
>> > >
>> > > Hello
>> > >
>> > >    I am trying to run two instances of the traffic servers in the
>> same server. I found it a bit tricky as the configuration and management (
>> locks etc ) files locations are like hard coded ( not sure though ). Could
>> some one please give some tips on how this can be achieved.
>> >
>> > This should work fine, though the details are a little subtle.
>> >
>> > First, you can use the TS_ROOT environment variable to specify the
>> installation prefix (what you passed to configure —prefix) at runtime,
>> Next, you can override al the paths to various configuration files and
>> directories at runtime by setting the record value in the environment,
>> >
>> > https://docs.trafficserver.apache.org/en/latest/admin-guide/
>> files/records.config.en.html#environment-overrides
>> >
>> > https://docs.trafficserver.apache.org/en/latest/admin-guide/
>> files/records.config.en.html#proxy-config-config-dir
>> >
>> > Finally, traffic_manager listens on local ports, so you need to make
>> sure they don’t collide for each instance. See
>> proxy.config.admin.synthetic_port and proxy.config.process_manager.m
>> gmt_port.
>> >
>> > >
>> > >    My requirement can be summarised as below.
>> > >
>> > > 1. I two servers in DMZ zone ( May machine B and machine C )
>> > > 2. I have one machine ( client ) inside enterprise (machine A ) and
>> one server in the internet ( Machine D )
>> > > 3. I want to send a message ( or rather forward ) from Machine A (
>> enter prise ) to MAchine D ( internet ) through Machine B and Machine C.
>> > > 4 there is already ATS running in Machine B and Machine C as reverse
>> proxy.
>> > > 5. I want to do Mutual TLS verification between Machine B and Machine
>> A
>> > >
>> > >
>> > > in a nutshell
>> > >
>> > > A  ->  B  ->  C  ->  D
>> > >
>> > > A is in enterprise
>> > > B and  C are ATS  ( one instance of ATS is already there as reverse
>> proxy )
>> > > D is in internet
>> > >
>> > > A and B mutual TLS
>> > >
>> > >
>> > > Could you please help me out here on how to set this up. Or is there
>> any pressing reason why I cannot make this setup work ?
>> > >
>> > > Thanks a ton in advance
>> >
>> >
>>
>>
>

Re: Trying to run two instances of traffic servers in same machine

Posted by Rebirthing <ne...@gmail.com>.
I didn't check this.

Anyway.. In my guess, this could work!

1. Build the source with A directory base(ex. '/opt/ts1/')
2. Install it
3. Build the source with B directory base(ex. '/opt/ts2/')
4. Install it
5. Config ts1&ts2 properly to prevent conflict(ex. ports).
6. Run them!

the locks of instances will be made in each directory base.

Thus it may work well.

Maybe... not :(

Thank you



2017-02-07 12:35 GMT+09:00 James Peach <ja...@me.com>:

>
> > On Feb 6, 2017, at 6:05 AM, salil GK <gk...@gmail.com> wrote:
> >
> > Thanks James for the reply.
> >
> > Over riding the config variable through environment is a good and nice
> option.
> > But another problem is how do I over ride the location of server.lock
> file  - there is no way I can specify this. What happens is - second
> instance also try to use the same server.lock file and it fails .
>
> This is controlled by proxy.config.local_state_dir and/or TS_ROOT. Fot
> example:
>
> $ /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
> RUNTIMEDIR: /opt/ats/var/trafficserver
> $ TS_ROOT=/instance /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
> RUNTIMEDIR: /instance/var/trafficserver
> $ PROXY_CONFIG_LOCAL_STATE_DIR=/var/instance/foo
> /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
> RUNTIMEDIR: /var/instance/foo
>
>
> > Regards
> > ~S
> >
> > On 28 December 2016 at 04:51, James Peach <jp...@apache.org> wrote:
> >
> > > On Dec 20, 2016, at 7:19 PM, salil GK <gk...@gmail.com> wrote:
> > >
> > > Hello
> > >
> > >    I am trying to run two instances of the traffic servers in the same
> server. I found it a bit tricky as the configuration and management ( locks
> etc ) files locations are like hard coded ( not sure though ). Could some
> one please give some tips on how this can be achieved.
> >
> > This should work fine, though the details are a little subtle.
> >
> > First, you can use the TS_ROOT environment variable to specify the
> installation prefix (what you passed to configure —prefix) at runtime,
> Next, you can override al the paths to various configuration files and
> directories at runtime by setting the record value in the environment,
> >
> > https://docs.trafficserver.apache.org/en/latest/admin-
> guide/files/records.config.en.html#environment-overrides
> >
> > https://docs.trafficserver.apache.org/en/latest/admin-
> guide/files/records.config.en.html#proxy-config-config-dir
> >
> > Finally, traffic_manager listens on local ports, so you need to make
> sure they don’t collide for each instance. See proxy.config.admin.synthetic_port
> and proxy.config.process_manager.mgmt_port.
> >
> > >
> > >    My requirement can be summarised as below.
> > >
> > > 1. I two servers in DMZ zone ( May machine B and machine C )
> > > 2. I have one machine ( client ) inside enterprise (machine A ) and
> one server in the internet ( Machine D )
> > > 3. I want to send a message ( or rather forward ) from Machine A (
> enter prise ) to MAchine D ( internet ) through Machine B and Machine C.
> > > 4 there is already ATS running in Machine B and Machine C as reverse
> proxy.
> > > 5. I want to do Mutual TLS verification between Machine B and Machine A
> > >
> > >
> > > in a nutshell
> > >
> > > A  ->  B  ->  C  ->  D
> > >
> > > A is in enterprise
> > > B and  C are ATS  ( one instance of ATS is already there as reverse
> proxy )
> > > D is in internet
> > >
> > > A and B mutual TLS
> > >
> > >
> > > Could you please help me out here on how to set this up. Or is there
> any pressing reason why I cannot make this setup work ?
> > >
> > > Thanks a ton in advance
> >
> >
>
>

Re: Trying to run two instances of traffic servers in same machine

Posted by James Peach <ja...@me.com>.
> On Feb 6, 2017, at 6:05 AM, salil GK <gk...@gmail.com> wrote:
> 
> Thanks James for the reply. 
> 
> Over riding the config variable through environment is a good and nice option.
> But another problem is how do I over ride the location of server.lock file  - there is no way I can specify this. What happens is - second instance also try to use the same server.lock file and it fails .

This is controlled by proxy.config.local_state_dir and/or TS_ROOT. Fot example:

$ /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
RUNTIMEDIR: /opt/ats/var/trafficserver
$ TS_ROOT=/instance /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
RUNTIMEDIR: /instance/var/trafficserver
$ PROXY_CONFIG_LOCAL_STATE_DIR=/var/instance/foo /opt/ats/bin/traffic_layout | grep RUNTIMEDIR
RUNTIMEDIR: /var/instance/foo


> Regards
> ~S
> 
> On 28 December 2016 at 04:51, James Peach <jp...@apache.org> wrote:
> 
> > On Dec 20, 2016, at 7:19 PM, salil GK <gk...@gmail.com> wrote:
> >
> > Hello
> >
> >    I am trying to run two instances of the traffic servers in the same server. I found it a bit tricky as the configuration and management ( locks etc ) files locations are like hard coded ( not sure though ). Could some one please give some tips on how this can be achieved.
> 
> This should work fine, though the details are a little subtle.
> 
> First, you can use the TS_ROOT environment variable to specify the installation prefix (what you passed to configure —prefix) at runtime, Next, you can override al the paths to various configuration files and directories at runtime by setting the record value in the environment,
> 
> https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#environment-overrides
> 
> https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-config-dir
> 
> Finally, traffic_manager listens on local ports, so you need to make sure they don’t collide for each instance. See proxy.config.admin.synthetic_port and proxy.config.process_manager.mgmt_port.
> 
> >
> >    My requirement can be summarised as below.
> >
> > 1. I two servers in DMZ zone ( May machine B and machine C )
> > 2. I have one machine ( client ) inside enterprise (machine A ) and one server in the internet ( Machine D )
> > 3. I want to send a message ( or rather forward ) from Machine A ( enter prise ) to MAchine D ( internet ) through Machine B and Machine C.
> > 4 there is already ATS running in Machine B and Machine C as reverse proxy.
> > 5. I want to do Mutual TLS verification between Machine B and Machine A
> >
> >
> > in a nutshell
> >
> > A  ->  B  ->  C  ->  D
> >
> > A is in enterprise
> > B and  C are ATS  ( one instance of ATS is already there as reverse proxy )
> > D is in internet
> >
> > A and B mutual TLS
> >
> >
> > Could you please help me out here on how to set this up. Or is there any pressing reason why I cannot make this setup work ?
> >
> > Thanks a ton in advance
> 
>