Help regarding traffic_cts

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Help regarding traffic_cts

gksalil


Hi


  I have a doubt regarding the traffic_ctl command. In my setup I am running two instances of traffic server. This I am doing by specifying two different directories for configuration. Now when I run traffic_ctl  how do I control the configuration reload. I mean traffic_ctl need to read the correct configuration file and update the variables of respective instance. How do I do this ?


How does the trfficctl update the configuration variables of traffic_server – is it some IPC mechanism ?


Thanks

~S

Reply | Threaded
Open this post in threaded view
|

Re: Help regarding traffic_cts

Alan Carroll
traffic_ctl does IPC over a UNIX pipe to communicate with traffic_manager which will, if needed, communicate with traffic_server. The file name of the pipe is a compile time constant in traffic_ctl and traffic_manager. Therefore which Traffic Server instance is affected is based on which traffic_ctl binary you use.


On Monday, March 27, 2017, 8:12:56 PM CDT, salil GK <[hidden email]> wrote:


Hi


  I have a doubt regarding the traffic_ctl command. In my setup I am running two instances of traffic server. This I am doing by specifying two different directories for configuration. Now when I run traffic_ctl  how do I control the configuration reload. I mean traffic_ctl need to read the correct configuration file and update the variables of respective instance. How do I do this ?


How does the trfficctl update the configuration variables of traffic_server – is it some IPC mechanism ?


Thanks

~S

Reply | Threaded
Open this post in threaded view
|

Re: Help regarding traffic_cts

gksalil
Thanks Alan for the reply

I have done changes to traffic manager source to support two instances of traffic server to run in the system. 
Now I can see two different set of .../var/ files are created the moment I run traffic_manager. It includes three .sock files too. 
I was trying to find out where exactly the IPC call happens from traffic_control. Could you please help me understand the call sequence from traffoc_control on how this IPC works - like which library function is doing this work ? I assume that it is just delivering some message from traffic_ctl to traffic_manager ( ? )

Thanks
Salil

On 28 March 2017 at 20:34, Alan Carroll <[hidden email]> wrote:
traffic_ctl does IPC over a UNIX pipe to communicate with traffic_manager which will, if needed, communicate with traffic_server. The file name of the pipe is a compile time constant in traffic_ctl and traffic_manager. Therefore which Traffic Server instance is affected is based on which traffic_ctl binary you use.


On Monday, March 27, 2017, 8:12:56 PM CDT, salil GK <[hidden email]> wrote:


Hi


  I have a doubt regarding the traffic_ctl command. In my setup I am running two instances of traffic server. This I am doing by specifying two different directories for configuration. Now when I run traffic_ctl  how do I control the configuration reload. I mean traffic_ctl need to read the correct configuration file and update the variables of respective instance. How do I do this ?


How does the trfficctl update the configuration variables of traffic_server – is it some IPC mechanism ?


Thanks

~S


Reply | Threaded
Open this post in threaded view
|

Re: Help regarding traffic_cts

gksalil
so basically I need to tell traffic_ctl to write to socket file in 'my directory' rather than default  build time directory. Which routine does the notification to traffic_manager ?

Thanks
Salil

On 28 March 2017 at 21:13, salil GK <[hidden email]> wrote:
Thanks Alan for the reply

I have done changes to traffic manager source to support two instances of traffic server to run in the system. 
Now I can see two different set of .../var/ files are created the moment I run traffic_manager. It includes three .sock files too. 
I was trying to find out where exactly the IPC call happens from traffic_control. Could you please help me understand the call sequence from traffoc_control on how this IPC works - like which library function is doing this work ? I assume that it is just delivering some message from traffic_ctl to traffic_manager ( ? )

Thanks
Salil

On 28 March 2017 at 20:34, Alan Carroll <[hidden email]> wrote:
traffic_ctl does IPC over a UNIX pipe to communicate with traffic_manager which will, if needed, communicate with traffic_server. The file name of the pipe is a compile time constant in traffic_ctl and traffic_manager. Therefore which Traffic Server instance is affected is based on which traffic_ctl binary you use.


On Monday, March 27, 2017, 8:12:56 PM CDT, salil GK <[hidden email]> wrote:


Hi


  I have a doubt regarding the traffic_ctl command. In my setup I am running two instances of traffic server. This I am doing by specifying two different directories for configuration. Now when I run traffic_ctl  how do I control the configuration reload. I mean traffic_ctl need to read the correct configuration file and update the variables of respective instance. How do I do this ?


How does the trfficctl update the configuration variables of traffic_server – is it some IPC mechanism ?


Thanks

~S



Reply | Threaded
Open this post in threaded view
|

Re: Help regarding traffic_cts

Alan M. Carroll
I wouldn't think so - it should be baked in to the traffic_ctl binary. Do you mean you are using the same binaries to run both instances? In that case, yes, traffic_ctl would need some indication of which .sock to open.  Looks like the the call to TSInit is the magic place, with a first argument of the path to the socket. The current implementation passes nullptr which I presume means "use the built in string" but it should be easy to pass something else there.

Tuesday, March 28, 2017, 11:58:40 AM, you wrote:

> so basically I need to tell traffic_ctl to write to socket file in 'my directory' rather than default  build time directory. Which routine does the notification to traffic_manager ?

Reply | Threaded
Open this post in threaded view
|

Re: Help regarding traffic_cts

gksalil
Thanks Alan

I will take a look at that and see if I can do some thing 

from my first investigation I guess this would do

if not (socketpath = getenv(TS_RUNTIME_DIR) )
    socketpath = TS_BUILDTIME_DIR



On 28 March 2017 at 23:26, Alan M. Carroll <[hidden email]> wrote:
I wouldn't think so - it should be baked in to the traffic_ctl binary. Do you mean you are using the same binaries to run both instances? In that case, yes, traffic_ctl would need some indication of which .sock to open.  Looks like the the call to TSInit is the magic place, with a first argument of the path to the socket. The current implementation passes nullptr which I presume means "use the built in string" but it should be easy to pass something else there.

Tuesday, March 28, 2017, 11:58:40 AM, you wrote:

> so basically I need to tell traffic_ctl to write to socket file in 'my directory' rather than default  build time directory. Which routine does the notification to traffic_manager ?