Christopher Browne cbbrowne at ca.afilias.info
Fri Jan 14 13:05:22 PST 2011
Brad Littlejohn <blittlejohn at posportal.com> writes:
>> -----Original Message-----
>> From: Christopher Browne [mailto:cbbrowne at ca.afilias.info]
>> Sent: Friday, January 14, 2011 11:50 AM
>> To: Brad Littlejohn
>> Cc: 'slony1-general at lists.slony.info'
>> Subject: Re: [Slony1-general] Changing IP address of Slave database
>> 
>> Brad Littlejohn <blittlejohn at posportal.com> writes:
>> >             After doing a bit of googling on changing the IP address
>> > of the master and slave database servers being replicated by Slony,
>> > I’m still a bit confused on how to change the address. To give some
>> > background, I have 2 servers running PostgreSQL 8.4, and replication
>> > works fine between the database on each server. These are currently
>> > connected via crossover cable, just for the initial seed of the
>> > database (it’s roughly 300GB in size).
>> >
>> >
>> >
>> >             The slave database is going to be moved to a DR location,
>> > and kept up to date real time with Slony; however, the IP address of
>> > the master and slave servers are going to change. I currently have
>> the
>> > following set up to set up to do the initial seed:
>> 
>> My first question is why you're using IP addresses, when it's commonly
>> easier to indirect this via using hostnames.
>
> 	First, thanks for the response. I appreciate it!
>
> 	That was going to be my next step after getting this working. I
> was using IP addresses in this instance so I could initially seed the
> slave database out of bounds of the main network these are on. Seeing
> a near 300GB database would have impacted other users of our network
> here, plus would limit me to the speed of the switch of that
> particular network. This way, my bandwidth was limited only to the
> NICs in the servers.
>
> 	Additionally, I'm also doing a smaller test of this in a VM
> 	sandbox, so I don't do it on live data. CYA.

All sounds pretty apropos.

I'd be more a fan of having the sandbox be pretty similar, network-wise,
to the real environment.  That way the things you learn about how to
properly configure the network for the sandbox are also pretty good
lessons for production.

>> If you change the addresses of servers, you'll need to modify
>> configuration that Slony uses in three notable places:
>> 
>>  a) Whatever script you use to invoke slon processes need to be changed
>>     to point to the new addresses.
>> 
>>  b) Any slonik scripts that you use will need to have the "admin
>>     conninfo" changed to indicate the new addresses.
>> 
>>  c) You will need to run a slonik script (that takes b) into
>>     consideration!) which runs STORE PATH commands to indicate the new
>>     addresses.
>> 
>>     That slonik script does not need to take any action other than
>>     running STORE PATH commands; it should not run:
>>      - init cluster, because the cluster is already initialized
>>      - store node, because additional nodes are already present
>>      - create set, because sets are already initialized
>> 
>>     The shell script you tried to run tried to perform all sorts of
>>     extra actions in addition to running STORE PATH, and those other
>>     actions failed.
>
> 	Perfect! This just ran great in my testbed! What I needed was:
>
> 	1. the IP addresses/hostnames (obviously),
> 	2. cluster name/admin conninfo (Preamble),
> 	3. STORE PATH command, and
> 	4. STORE LISTEN command.
>
> 	I'm not sure if #4 is required, but it is working for me. Now
> I'm ready to move over to trying this on my production servers when
> the slave server gets installed in our DR facility. And I'll
> definitely take your advice with using hostnames in production, now
> that the seed is done. Thanks once again!

The STORE LISTEN part shouldn't be necessary on recent-ish versions of
Slony.  That configuration used to need to get computed by hand, back in
version 1.0, but it's automatically computed on the more recent
versions, certainly for 1.2.x and 2.0.x.

I didn't see what version you were on; I presume 2.0.x?
-- 
(reverse (concatenate 'string "ofni.sailifa" "@" "enworbbc"))
Christopher Browne
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"


More information about the Slony1-general mailing list