You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Jeff Zhang <zj...@gmail.com> on 2016/01/07 13:15:31 UTC

Anyway to sync stack configuration file from server to agent ?

Sometimes, I'd like change some configuarion file and want to verify it
manully. But some configuration is for server and while some are for agent,
is there any way that I can change it in server and sync it to agent ?

-- 
Best Regards

Jeff Zhang

Re: Anyway to sync stack configuration file from server to agent ?

Posted by Mithun Mathew <mi...@gmail.com>.
Jeff

You can rsync your files (including configuration) to all the agents cache.
I use a script like the one attached below to rsync the whole service's
file to all the hosts.

I did not have to restart the server in this case. However, I had to
restart the service (the init command of the service was dealing with the
configuration files of the service).

Regards
Matt



$SERVICE=my-service
> $VERSION=x.x.x.x.x
> # Place hostnames in hostfile with Ambari-server hostname on first line
> function synctohosts() {
>         server="$(head -1 ~/Desktop/hostfile)"
>         rsync -r
> ~/Documents/Projects/ambari/ambari-server/src/main/resources/common-services/$SERVICE/$VERSION/
>  $server:/var/lib/ambari-server/resources/common-services/$SERVICE/$VERSION
>         echo "Rsync-ed to Ambari server on "$server
> for host in $(cat ~/Desktop/hostfile)
>         do
>             rsync -r
> ~/Documents/Projects/ambari/ambari-server/src/main/resources/common-services/$SERVICE/$VERSION/
>  $host:/var/lib/ambari-agent/cache/common-services/$SERVICE/$VERSION
>    echo "Rsync-ed to Ambari agent on "$host
> done
> }




On Thu, Jan 7, 2016 at 6:50 AM, Sumit Mohanty <sm...@hortonworks.com>
wrote:

> No there is no REST API for this one.
> ________________________________________
> From: Jeff Zhang <zj...@gmail.com>
> Sent: Thursday, January 07, 2016 6:46 AM
> To: dev@ambari.apache.org
> Subject: Re: Anyway to sync stack configuration file from server to agent ?
>
> oh, restart will trigger the sync, thanks. BTW is there any rest api for
> this to avoid restart ?
>
>
> On Thu, Jan 7, 2016 at 10:37 PM, Sumit Mohanty <sm...@hortonworks.com>
> wrote:
>
> > Can you give some specific examples?
> >
> > In general, if you change anything under "packages" and restart
> > ambri-server then it should sync the files to the agent before next
> command
> > is executed for the service.
> > ________________________________________
> > From: Jeff Zhang <zj...@gmail.com>
> > Sent: Thursday, January 07, 2016 4:15 AM
> > To: dev@ambari.apache.org
> > Subject: Anyway to sync stack configuration file from server to agent ?
> >
> > Sometimes, I'd like change some configuarion file and want to verify it
> > manully. But some configuration is for server and while some are for
> agent,
> > is there any way that I can change it in server and sync it to agent ?
> >
> > --
> > Best Regards
> >
> > Jeff Zhang
> >
>
>
>
> --
> Best Regards
>
> Jeff Zhang
>



-- 
*Mithun Mathew* (Matt)

   - www.linkedin.com/in/mithunmatt/

Re: Anyway to sync stack configuration file from server to agent ?

Posted by Sumit Mohanty <sm...@hortonworks.com>.
No there is no REST API for this one.
________________________________________
From: Jeff Zhang <zj...@gmail.com>
Sent: Thursday, January 07, 2016 6:46 AM
To: dev@ambari.apache.org
Subject: Re: Anyway to sync stack configuration file from server to agent ?

oh, restart will trigger the sync, thanks. BTW is there any rest api for
this to avoid restart ?


On Thu, Jan 7, 2016 at 10:37 PM, Sumit Mohanty <sm...@hortonworks.com>
wrote:

> Can you give some specific examples?
>
> In general, if you change anything under "packages" and restart
> ambri-server then it should sync the files to the agent before next command
> is executed for the service.
> ________________________________________
> From: Jeff Zhang <zj...@gmail.com>
> Sent: Thursday, January 07, 2016 4:15 AM
> To: dev@ambari.apache.org
> Subject: Anyway to sync stack configuration file from server to agent ?
>
> Sometimes, I'd like change some configuarion file and want to verify it
> manully. But some configuration is for server and while some are for agent,
> is there any way that I can change it in server and sync it to agent ?
>
> --
> Best Regards
>
> Jeff Zhang
>



--
Best Regards

Jeff Zhang

Re: Anyway to sync stack configuration file from server to agent ?

Posted by Jeff Zhang <zj...@gmail.com>.
oh, restart will trigger the sync, thanks. BTW is there any rest api for
this to avoid restart ?


On Thu, Jan 7, 2016 at 10:37 PM, Sumit Mohanty <sm...@hortonworks.com>
wrote:

> Can you give some specific examples?
>
> In general, if you change anything under "packages" and restart
> ambri-server then it should sync the files to the agent before next command
> is executed for the service.
> ________________________________________
> From: Jeff Zhang <zj...@gmail.com>
> Sent: Thursday, January 07, 2016 4:15 AM
> To: dev@ambari.apache.org
> Subject: Anyway to sync stack configuration file from server to agent ?
>
> Sometimes, I'd like change some configuarion file and want to verify it
> manully. But some configuration is for server and while some are for agent,
> is there any way that I can change it in server and sync it to agent ?
>
> --
> Best Regards
>
> Jeff Zhang
>



-- 
Best Regards

Jeff Zhang

Re: Anyway to sync stack configuration file from server to agent ?

Posted by Sumit Mohanty <sm...@hortonworks.com>.
Can you give some specific examples?

In general, if you change anything under "packages" and restart ambri-server then it should sync the files to the agent before next command is executed for the service.
________________________________________
From: Jeff Zhang <zj...@gmail.com>
Sent: Thursday, January 07, 2016 4:15 AM
To: dev@ambari.apache.org
Subject: Anyway to sync stack configuration file from server to agent ?

Sometimes, I'd like change some configuarion file and want to verify it
manully. But some configuration is for server and while some are for agent,
is there any way that I can change it in server and sync it to agent ?

--
Best Regards

Jeff Zhang