安装Postgre-R spread 受挫折

9812 2003-04-21 06:37:19
谁能帮我装上
HA + PostgreSQL
现有2000分.全送..

安装Postgre-R spread 受挫折 五, 18 四月 2003 20:34

这么费劲么?

a pure, powerful, straight, strong beam of light

[向版主推荐这条信息]



netkiller
Member



发贴数: 77
地区: 深圳特区
注册时间:
三月 2003
回复:安装Postgre-R spread 受挫折 五, 18 四月 2003 23:00

超动时要加-r
postmaster -r -i -D /usr/local/pgsql/data
它说-r不存在。

环境:
两天PC
PC1 192.168.1.5 安装PGSQL与spread Master 主数据库服务器
PC2 192.168.1.10 安装PGSQL Slave


我的安装过程是
tar zxvf spread
tar zxvf postgresql
cd spread
./configure --prefix=/usr/local/spread
make
make install

adduser postgres
cd postgresql
./configure --prefix=/usr/local/pgsql --with-repl-spread=spread_dir
make
make install

su postgres
initdb /usr/local/pgsql
postmaster -i -D /usr/local/pgsql/data
测试
createdb (成功)
psql -l (成功并可以建表)

killall postmaster
安装过程中没有出错。

配置
vi spread.conf
Spread_Segment 127.0.0.255:4803 {

linux1 192.168.1.10

}

上面配置我不解的是。这样写linux1 192.168.1.10 对不对。
linux1 加一台服务器,是我要同步的数据。上面安装好了。并测试可以使用

另一疑问:要不要把自己写加到spread.conf中。如:

Spread_Segment 127.0.0.255:4803 {
localhost 127.0.0.1
linux1 192.168.1.10
}

or

Spread_Segment 127.0.0.255:4803 {
linux0 192.168.1.5
linux1 192.168.1.10
}

启动spread
./spread &

启动


repl_max_remote_processes = 4 # number of remote backends

repl_mgr_port = 5430 # Replication manager port

repl_spread_port = 4803 # Port used for the spread daemon (see spread.conf file)

repl_spread_host = 'localhost' # Host of the spread daemon

repl_spread_group = 'replicationGroup' # The name of the spread group

repl_database = 'testing' # Name of the database being replicated

repl_user = 'postgres' # Name of the user used to replicate data (from step 5)

以上的设置。我不明白。是加在postgres.conf后面还是系统环境变量。
我加在postgres.conf中说没有那些定义。。我在控制台下运行设为环境变量。是OK的。。
然后就是启动PGSQL
postmaster -i -D /usr/local/pgsql/data
启动。。OK

问?????如何测试。
我如何建库,建表,
我应该在PC1上。建库,建表,添加数据的操作会自动同步到PC2上吗???
还是我要在PC1,PC2,上建库,建表。
然后在PC1上添加数据 后会同步到PC2上。。

我看它的说明上说,它是Peer to Peer 这样就可以。。
在PC1,PC2上添加数据。都会同步到对方????

哎。很多很多问号呀?????
E文太差。看的我模模糊糊。。。云山雾照???:(

...全文
71 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
9812 2003-05-14
  • 打赏
  • 举报
回复
这也是接那个装的没装上。。
9812 2003-04-21
  • 打赏
  • 举报
回复
我是安这个文档装的.
How To Install and configure Postgres-R with Spread

Note: These instructions are based on RH7, so your install experience may vary. Please note any changes or comments, and share with the list.

Download Spread (spread-3.17.0 @ www.spread.org/).

Compiling Spread. After un-tarring the source, cd to the spread_src-3.17.0 directory, create a symbolic link for Makefile using the existing platform specific make files (ln -s LINUX_makefile Makefile), and then make. This will create the spread deamon (spread) and libtsp.a (/spread_src-3.17.0/libtsp.a). Note: This Spread set up is for the source compile and more detailed information is in the user guide .

Configuring Spread. Create a Spread configuration file from the sample.spread.conf file in the spread_src-3.17.0 directory. A list of systems needs to be defined in the Spread_Segemnt section. Here is an example, for more information see the user guide .

Spread_Segment 192.168.1.255:4803 {

sync1 192.168.1.81

sync2 192.168.1.82

sync3 192.168.1.83

sync4 192.168.1.84

}

Starting Spread. For postgres-r a spread daemon must be running on each system participating in replication. To start the Spread daemon (spread -c spread.conf -l y &)

Create the postgres user, and create the installation destination directory (default is /usr/local/pgsql). Make sure the directory is read/writeable by postgres and/or the user ID of installer.

Down load the latest postgres-r code using the Download instructions. To compile and configure the postgres-r code, cd to the pgsql-r-v7.2/ directory, and run the configure script. Use the following parameters in the configure scrpt.

configure --with-repl-spread=path to spread directory

Next type "make", and if all goes well type "make install" using the UID from step 5.

Set up the postgresql.conf file, and put it in the postgresql data directory (default is /usr/local/pgsql/data). Below is an example of the replcation settings of this file. These entries take the place of the environment variables used in the working model.

repl_max_remote_processes = 4 # number of remote backends

repl_mgr_port = 5430 # Replication manager port

repl_spread_port = 4803 # Port used for the spread daemon (see spread.conf file)

repl_spread_host = 'localhost' # Host of the spread daemon

repl_spread_group = 'replicationGroup' # The name of the spread group

repl_database = 'testing' # Name of the database being replicated

repl_user = 'postgres' # Name of the user used to replicate data (from step 5)

Database setup. As the postgres user, initialize the database by "/usr/local/pgsql/bin/initdb". The postmaster can now be started (in regular mode) by "/usr/local/pgsql/bin/postmaster -i &" . Once postmaster is running correctly, the replication database has to be created using "/usr/local/pgsql/bin/createdb (repl_database from postgresql.config file). Next the tables and users would be created, currently these statements are not replicated, so we are still in stand alone mode here. Make sure all tables have a primary key, or replication will not work. Steps 1 - 9 need to be executed on each machine before proceding to step 10.

Stop any/all postmasters/postgres daemons. Make sure the postgres shared memory segments are removed, using "ipcs" and "ipcrm". Start one of the posstgres-r servers in master replication mode with "postmaster -r -X &". This step will only be executed on the master system. All other systems (slaves) in the replica will be started in slave replication mode with "postmaster -r &".

Replicating SQL commands. Create a text file with a SQL transaction (example below). Then use /usr/local/pgsql/bin/psql -r < "text file w/ SQL transaction" on the master server. Verify by selecting test table information on each server in the replica.

begin;

insert into status_table values (0, 'zero');

insert into status_table values (1, 'one');

insert into status_table values (2, 'two');

end;

954

社区成员

发帖
与我相关
我的任务
社区描述
PostgreSQL相关内容讨论
sql数据库数据库架构 技术论坛(原bbs)
社区管理员
  • PostgreSQL社区
  • yang_z_1
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧