<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Moki Systems Blog &#187; Slony</title>
	<atom:link href="http://www.mokisystems.com/blog/category/slony/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mokisystems.com/blog</link>
	<description>Addressing such topics as: web programming, design, ruby on rails, cake php, postgresql, linux, seo</description>
	<lastBuildDate>Fri, 20 May 2011 15:22:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting up Slony on Windows</title>
		<link>http://www.mokisystems.com/blog/setting-up-slony-on-windows/</link>
		<comments>http://www.mokisystems.com/blog/setting-up-slony-on-windows/#comments</comments>
		<pubDate>Tue, 13 May 2008 17:54:05 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Slony]]></category>
		<category><![CDATA[pgadmin]]></category>
		<category><![CDATA[pgadminIII]]></category>
		<category><![CDATA[postgresql replication]]></category>
		<category><![CDATA[postgresql windows]]></category>
		<category><![CDATA[Slony replication]]></category>
		<category><![CDATA[slony windows.]]></category>
		<category><![CDATA[slony1]]></category>
		<category><![CDATA[slonyI]]></category>

		<guid isPermaLink="false">http://www.mokisystems.com/blog/setting-up-slony-on-windows/</guid>
		<description><![CDATA[This isn&#8217;t intended to be a complete tutorial, but for those of us who have previously only run Slony on Linux, this might be a helpful post.

Install Slony
Configure pgAdmin file/options and set the slony path
G:\Program Files (x86)\PostgreSQL\8.2\share
Create the master db
create the slave db
Initialize the master database.  From the command line
pgbench.exe -U postgres -i pb
copy [...]]]></description>
			<content:encoded><![CDATA[<p>This isn&#8217;t intended to be a complete tutorial, but for those of us who have previously only run Slony on Linux, this might be a helpful post.<br />
<span id="more-12"></span></p>
<p>Install Slony</p>
<p>Configure pgAdmin file/options and set the slony path</p>
<p><code>G:\Program Files (x86)\PostgreSQL\8.2\share</code></p>
<p>Create the master db</p>
<p>create the slave db</p>
<p>Initialize the master database.  From the command line<br />
<code>pgbench.exe -U postgres -i pb</code></p>
<p>copy the master to the slave: from command line</p>
<p><code>pg_dump.exe  -U postgres -h localhost pb |psql =U postgres -h localhost pbslave</code></p>
<p>Add a new cluster on the master<img src="file:///C:/DOCUME%7E1/james/LOCALS%7E1/Temp/moz-screenshot-10.jpg" /></p>
<p><a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_node_on_slave.bmp" title="add_cluster_on_master"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_node_on_slave.bmp" alt="add_cluster_on_master" /></a></p>
<p>Add a node on the slave db</p>
<p><a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_node_on_slave1.bmp" title="Add_node_on_slave"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_node_on_slave1.bmp" alt="Add_node_on_slave" /></a></p>
<p style="margin-bottom: 0in">Add a path on both the master to the slave</p>
<p style="margin-bottom: 0in">host=localhost port=5432 dbname=pbslave user=postgres password=a</p>
<p style="margin-bottom: 0in">  <a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_path_on_master.bmp" title="Add_path_on_master"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_path_on_master.bmp" alt="Add_path_on_master" /></a></p>
<p style="margin-bottom: 0in">Add a path on the slave to the master</p>
<p style="margin-bottom: 0in">host=localhost port=5432 dbname=pb user=postgres password=a</p>
<p style="margin-bottom: 0in"><a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_path_to_master.bmp" title="add_path_on_slave"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_path_to_master.bmp" alt="add_path_on_slave" /></a></p>
<p style="margin-bottom: 0in">Add a replication set on the master</p>
<p style="margin-bottom: 0in"><a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_replication_set.bmp" title="add_replication_set"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_replication_set.bmp" alt="add_replication_set" /></a></p>
<p style="margin-bottom: 0in">&nbsp;</p>
<p style="margin-bottom: 0in">Add accounts, branches, tellers</p>
<p style="margin-bottom: 0in"><a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_accounts.bmp" title="add_accounts"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_accounts.bmp" alt="add_accounts" /></a></p>
<p style="margin-bottom: 0in">From the master Subscribe the slave</p>
<p style="margin-bottom: 0in">from the all tables set, right click subscribe set</p>
<p style="margin-bottom: 0in">&nbsp;</p>
<p style="margin-bottom: 0in">&nbsp;</p>
<p style="margin-bottom: 0in">Slony is configured, now we have to make windows start the engines correctly.</p>
<p style="margin-bottom: 0in">&nbsp;</p>
<p style="margin-bottom: 0in">Create two text files in <a href="file:///C:/slony">c:\slony</a></p>
<p style="margin-bottom: 0in">master.conf and slave.conf which look like this:</p>
<p><code>cluster_name='pgbench'<br />
conn_info='dbname=pgbench user=postgres password=a'<br />
</code></p>
<p style="margin-bottom: 0in">From the command line register the engines</p>
<p><code>slon -addengine slony g:\slony\slave.conf<br />
lon -addengine slony g:\slony\master.conf</code></p>
<p style="margin-bottom: 0in">if this hasn&#8217;t been done register slony as a service</p>
<p><code>slon -regservice slony</code></p>
<p>go to services and start slony</p>
<p>check event log for errors</p>
<p>if there are none then run a test from the master:</p>
<p><code>insert into accounts values (100001, 1, 0, 'test');</code></p>
<p style="margin-bottom: 0in">from the slave</p>
<p><code>select count(*) from accounts;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mokisystems.com/blog/setting-up-slony-on-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

