Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

londiste(5) [debian man page]

LONDISTE(5)															       LONDISTE(5)

NAME
londiste - PostgreSQL replication engine written in python SYNOPSIS
[londiste] job_name = asd DESCRIPTION
The londiste configuration file follow the famous .INI syntax. It contains only one section named londiste. Most defaults values are reasonable ones. That means you can only edit provider_db, subscriber_db and pgq_queue_name and be done with londiste configuration. OPTIONS
You can configure the following options into the londiste section. job_name Each Skytools daemon process must have a unique job_name. Londiste uses it also as consumer name when subscribing to queue. provider_db Provider database connection string (DSN). subscriber_db Subscriber database connection string (DSN). pgq_queue_name Name of the queue to read from. Several subscribers can read from same queue. logfile Where to log londiste activity. pidfile Where to store the pid of the main londiste process, the replay one. lock_timeout Few operations take lock on provider (provider add/remove, compare, repair). This parameter specifies timeout in seconds (float) how long a lock can be held. New in version 2.1.8. Default: 10 loop_delay How often to poll events from provider. In seconds (float). Default: 1. pgq_lazy_fetch How many events to fetch at a time when processing a batch. Useful when you know a single transaction (maintenance UPDATE command, e.g.) will produce a lot of events in a single batch. When lazily fetching, a cursor is used so as to still process a single batch in a single transaction. Default: 0, always fetch all events of the batch, not using a cursor. log_count Number of log files to keep. Default: 3 log_size Max size for one log file. File is rotated if max size is reached. Default: 10485760 (10M) use_skylog If set, search for [./skylog.ini, ~/.skylog.ini, /etc/skylog.ini]. If found then the file is used as config file for Pythons logging module. It allows setting up fully customizable logging setup. Default: 0 EXAMPLE
[londiste] job_name = test_to_subcriber provider_db = dbname=provider port=6000 host=127.0.0.1 subscriber_db = dbname=subscriber port=6000 host=127.0.0.1 # it will be used as sql ident so no dots/spaces pgq_queue_name = londiste.replika logfile = /tmp/%(job_name)s.log pidfile = /tmp/%(job_name)s.pid SEE ALSO
londiste(1) 03/13/2012 LONDISTE(5)

Check Out this Related Man Page

BULK_LOADER(1)															    BULK_LOADER(1)

NAME
bulk_loader - PgQ consumer that loads urlencoded records to slow databases SYNOPSIS
bulk_loader.py [switches] config.ini DESCRIPTION
bulk_loader is PgQ consumer that reads url encoded records from source queue and writes them into tables according to configuration file. It is targeted to slow databases that cannot handle applying each row as separate statement. Originally written for BizgresMPP/greenplumDB which have very high per-statement overhead, but can also be used to load regular PostgreSQL database that cannot manage regular replication. Behaviour properties: - reads urlencoded "logutriga" records. - does not do partitioning, but allows optionally redirect table events. - does not keep event order. - always loads data with COPY, either directly to main table (INSERTs) or to temp tables (UPDATE/COPY) then applies from there. Events are usually procuded by pgq.logutriga(). Logutriga adds all the data of the record into the event (also in case of updates and deletes). QUICK-START Basic bulk_loader setup and usage can be summarized by the following steps: 1. pgq and logutriga must be installed in source databases. See pgqadm man page for details. target database must also have pgq_ext schema. 2. edit a bulk_loader configuration file, say bulk_loader_sample.ini 3. create source queue $ pgqadm.py ticker.ini create <queue> 4. Tune source queue to have big batches: $ pgqadm.py ticker.ini config <queue> ticker_max_count="10000" ticker_max_lag="10 minutes" ticker_idle_period="10 minutes" 5. create target database and tables in it. 6. launch bulk_loader in daemon mode $ bulk_loader.py -d bulk_loader_sample.ini 7. start producing events (create logutriga trggers on tables) CREATE OR REPLACE TRIGGER trig_bulk_replica AFTER INSERT OR UPDATE ON some_table FOR EACH ROW EXECUTE PROCEDURE pgq.logutriga(<queue>) CONFIG
Common configuration parameters job_name Name for particulat job the script does. Script will log under this name to logdb/logserver. The name is also used as default for PgQ consumer name. It should be unique. pidfile Location for pid file. If not given, script is disallowed to daemonize. logfile Location for log file. loop_delay If continuisly running process, how long to sleep after each work loop, in seconds. Default: 1. connection_lifetime Close and reconnect older database connections. log_count Number of log files to keep. Default: 3 log_size Max size for one log file. File is rotated if max size is reached. Default: 10485760 (10M) use_skylog If set, search for [./skylog.ini, ~/.skylog.ini, /etc/skylog.ini]. If found then the file is used as config file for Pythons logging module. It allows setting up fully customizable logging setup. Common PgQ consumer parameters pgq_queue_name Queue name to attach to. No default. pgq_consumer_id Consumers ID to use when registering. Default: %(job_name)s Config options specific to bulk_loader src_db Connect string for source database where the queue resides. dst_db Connect string for target database where the tables should be created. remap_tables Optional parameter for table redirection. Contains comma-separated list of <oldname>:<newname> pairs. Eg: oldtable1:newtable1, oldtable2:newtable2. load_method Optional parameter for load method selection. Available options: 0 UPDATE as UPDATE from temp table. This is default. 1 UPDATE as DELETE+COPY from temp table. 2 merge INSERTs with UPDATEs, then do DELETE+COPY from temp table. LOGUTRIGA EVENT FORMAT
PgQ trigger function pgq.logutriga() sends table change event into queue in following format: ev_type (op || ":" || pkey_fields). Where op is either "I", "U" or "D", corresponging to insert, update or delete. And pkey_fields is comma-separated list of primary key fields for table. Operation type is always present but pkey_fields list can be empty, if table has no primary keys. Example: I:col1,col2 ev_data Urlencoded record of data. It uses db-specific urlecoding where existence of = is meaningful - missing = means NULL, present = means literal value. Example: id=3&name=str&nullvalue&emptyvalue= ev_extra1 Fully qualified table name. COMMAND LINE SWITCHES
Following switches are common to all skytools.DBScript-based Python programs. -h, --help show help message and exit -q, --quiet make program silent -v, --verbose make program more verbose -d, --daemon make program go background Following switches are used to control already running process. The pidfile is read from config then signal is sent to process id specified there. -r, --reload reload config (send SIGHUP) -s, --stop stop program safely (send SIGINT) -k, --kill kill program immidiately (send SIGTERM) 03/13/2012 BULK_LOADER(1)
Man Page