postgres at dac.e4ward.com postgres at dac.e4ward.com
Fri Nov 23 06:33:54 PST 2007
On Nov 22, 2007 8:16 PM,  <slony1-general at lists.slony.info> wrote:
> <postgres at dac.e4ward.com> writes:
> > On Nov 22, 2007 5:14 PM,  <slony1-general at lists.slony.info> wrote:
> >> On 22/11/2007 19:08, postgres at dac.e4ward.com wrote:
> >> > documentation, but it seems slonik is always suposed to be installed
> >> > and run from the same server where postgres is installed.
> >>
> >> That's not my understanding....in particular, since connection strings
> >> passed to slon always include host and port fields, I don't see why they
> >> need to be on the same machine as the DB.
> >
> >
> > I understand that and in fact, as I said, I'm successfully running the
> > slave slon daemon from the master server, remotely. BUT I happen to
> > have postgres installed on that server too.
> >
> > My problem is not where to run slon, because I'm running it always
> > from servers where postgres is running too. My problem is to execute
> > slonik remotely from a server where I don't have neither postgres or
> > slon suning.
> >
> > Do I explain myself?
>
> Yes, you're explaining yourself...

Thank you :)

>
> You will have a difficult time running slonik on a host that doesn't
> have *any* of PostgreSQL running, because it will typically be
> dynamically linked to the PostgreSQL client library, libpq, and you
> will therefore need to have at least that part (libpq) of PostgreSQL
> installed.
>
> If your distribution has separate packages for:
> a) Server components (e.g. - postmaster)
> b) Libraries (e.g. - libpq)
> c) Client components (e.g. - psql, pg_dump, ...)
>
> then you could presumably avoid installing the server components and
> still be able to get Slony-I components to work.  I'd certainly want
> to have PostgreSQL "client components" like psql and pg_dump handy,
> though...

Yes. I though so...
I'm using a self-compiled postgres 8.1.10 on the db servers and the
app server from where I was looking to execute slonik has RPM
installed postgresql-libs 7.4.17. Ouch! :P

Anyway, I finally setted up automatic authentication from the app
server to the db servers via ssh public keys and made a script to
execute like this:

ssh -2 $USERNAME@$HOST <<-CMD
  /usr/local/pgsql/bin/slonik_execute_script -c "$SQL_COMMAND"
$REPLICATION_SET | /usr/local/pgsql/bin/slonik
CMD

And it works. Maybe a bit slower, but works and I have no need to
install postgres libs on the app server.
-- 
Diego Algorta Casamayou
http://www.oboxodo.com - http://diego.algorta.net


More information about the Slony1-general mailing list