ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mithun Mathew <mithm...@gmail.com>
Subject Re: Anyway to sync stack configuration file from server to agent ?
Date Thu, 07 Jan 2016 18:10:26 GMT
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 <smohanty@hortonworks.com>
wrote:

> No there is no REST API for this one.
> ________________________________________
> From: Jeff Zhang <zjffdu@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 <smohanty@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 <zjffdu@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/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message