Mammoth PostgreSQL + Replication IS the Open Source version of PostgreSQL. It just has Replication integrated within the backend.Replicator Reserved Words
The following two words are added reserved words for Mammoth Replicator:mcp_server mysteriously diespromote mcp_refresh This means that any use of the two above words within PostgreSQL outside of their intended purpose must be quoted. For example:
CREATE TABLE foo (id bigserial primary key, "promote" text);
The maximum size of the mcp_server.log is 2 Gigabytes. If your log reaches the 2 Gigabyte limit, the mcp_server will die.
The solution is to insure that you have proper log file rotation in place. When using log file rotation do not move and rotate, use a copy truncate method.
If you are using the bash shell you can truncate your log file like so:>/path/to/mcp_server.log
If you are using a Redhat derivative of Linux you can use logrotate with the copytruncate option.
If you are unsure of which tables will need primary keys here is some SQL to help you.How many tables can Replicator replicate?
SELECT nspname, relname FROM pg_class LEFT JOIN pg_constraint ON (pg_constraint.contype = 'p' AND conrelid = pg_class.oid) JOIN pg_namespace ON (pg_namespace.oid = pg_class.relnamespace) WHERE relkind = 'r' AND contype IS NULL;
The official answer is 10,000 tables. However there are a couple of caveats:I added a table and it won't replicate!
- The replicated_table_names list is scanned at the start of each connection thus if you have 10,000 tables listed there is a good chance that the connection will timeout before the backend recognizes that it is available.
- The replicated_table_names list uses shared memory.
In practice one should never try to replicate more than 1000 tables.
Make sure you have checked the following:mcp_server as a Win32 service?
- The table has a primary key.
- The table is listed in replication_table_names in the postgresql.conf
- You don't have "mcp_auto_full_sync=off" in the mcp_server.conf
It is possible to run the mcp_server as a service on Win32. To install the mcp_server as a service please use the following command:
./mcp_server.exe -r -l log_file -c config_file -d txlog_path -u user -p password
To uninstall the mcp_server.exe as a service use the following:./mcp_server.exe -u
You have restored the Slave from a backup from the Master. There have been zero updates to the Master since the restoration of the Slave and you want to only replicate from the point in which you restored the backup.How do I make changes to the schema once replication is running?
This is currently not possible with Replicator. Replicator requires full knowledge of the database thus it will truncate your slave and replicate from the master.
There is a now a section in the documentation that covers this.I am querying slaves, how do I know which slave I am on?
If you are using replicator in an environment where you need to query from the slaves but you also need to know if you are on a slave or which slave you are on you can do the following:Promote Features
Show if you are a slave:show replication_slave; replication_slave ------------------- offShow which slave you are:show replication_slave_no; replication_slave_no ---------------------- 0
There is now a section in the docs on this tip.