XL集群部署与管理指南

Postgres-XL是一个基于PostgreSQL数据库的横向扩展开源SQL数据库集群,具有足够的灵活性来处理不同的数据库工作负载,架构如下图所示:

[postgres@pg01 ~]$ pgxc_ctl -c /u01/pgxl/pgxc_ctl/pgxc_ctl.conf init all /bin/bash Installing pgxc_ctl_bash script as /u01/pgxl/pgxc_ctl_bash. Installing pgxc_ctl_bash script as /u01/pgxl/pgxc_ctl_bash. Reading configuration using /u01/pgxl/pgxc_ctl_bash --home /u01/pgxl --configuration /u01/pgxl/pgxc_ctl/pgxc_ctl.conf Finished reading configuration. ******** PGXC_CTL START *************** Current directory: /u01/pgxl Initialize GTM master The files belonging to this GTM system will be owned by user "postgres". This user must also own the server process. fixing permissions on existing directory /u01/pgxl/nodes/gtm ... ok creating configuration files ... ok creating control file ... ok Success. Done. Start GTM master server starting Initialize GTM slave The files belonging to this GTM system will be owned by user "postgres". This user must also own the server process. fixing permissions on existing directory /u01/pgxl/nodes/gtm_slave ... ok creating configuration files ... ok creating control file ... ok Success. Done. Start GTM slavepgxc_ctl(13032):1811220924_48 server starting Done. Initialize all the gtm proxies. Initializing gtm proxy gtm_pxy1. Initializing gtm proxy gtm_pxy2. The files belonging to this GTM system will be owned by user "postgres". This user must also own the server process. fixing permissions on existing directory /u01/pgxl/nodes/gtm_pxy ... ok creating configuration files ... ok Success. The files belonging to this GTM system will be owned by user "postgres". This user must also own the server process. fixing permissions on existing directory /u01/pgxl/nodes/gtm_pxy ... ok creating configuration files ... ok Success. Done. Starting all the gtm proxies. Starting gtm proxy gtm_pxy1. Starting gtm proxy gtm_pxy2. server starting server starting Done. Initialize all the coordinator masters. Initialize coordinator master coord1. Initialize coordinator master coord2. The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /u01/pgxl/nodes/coord ... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting dynamic shared memory implementation ... posix creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... creating cluster information ... ok syncing data to disk ... ok freezing database template0 ... ok freezing database template1 ... ok freezing database postgres ... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /u01/pgxl/nodes/coord ... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting dynamic shared memory implementation ... posix creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... creating cluster information ... ok syncing data to disk ... ok freezing database template0 ... ok freezing database template1 ... ok freezing database postgres ... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. Done. Starting coordinator master. Starting coordinator master coord1 Starting coordinator master coord2 2018-11-22 09:24:59.252 CST [13950] LOG: listening on IPv4 address "0.0.0.0", port 5433 2018-11-22 09:24:59.252 CST [13950] LOG: listening on IPv6 address "::", port 5433 2018-11-22 09:24:59.254 CST [13950] LOG: listening on Unix socket "/tmp/.s.PGSQL.5433" 2018-11-22 09:24:59.302 CST [13950] LOG: redirecting log output to logging collector process 2018-11-22 09:24:59.302 CST [13950] HINT: Future log output will appear in directory "pg_log". 2018-11-22 09:24:59.060 CST [13633] LOG: listening on IPv4 address "0.0.0.0", port 5433 2018-11-22 09:24:59.061 CST [13633] LOG: listening on IPv6 address "::", port 5433 2018-11-22 09:24:59.062 CST [13633] LOG: listening on Unix socket "/tmp/.s.PGSQL.5433" 2018-11-22 09:24:59.109 CST [13633] LOG: redirecting log output to logging collector process 2018-11-22 09:24:59.109 CST [13633] HINT: Future log output will appear in directory "pg_log". Done. Initialize all the coordinator slaves. Initialize the coordinator slave coord1. Initialize the coordinator slave coord2. Done. Starting all the coordinator slaves. Starting coordinator slave coord1. Starting coordinator slave coord2. 2018-11-22 09:25:05.987 CST [13330] LOG: listening on IPv4 address "0.0.0.0", port 5433 2018-11-22 09:25:05.987 CST [13330] LOG: listening on IPv6 address "::", port 5433 2018-11-22 09:25:05.989 CST [13330] LOG: listening on Unix socket "/tmp/.s.PGSQL.5433" 2018-11-22 09:25:06.039 CST [13330] LOG: redirecting log output to logging collector process 2018-11-22 09:25:06.039 CST [13330] HINT: Future log output will appear in directory "pg_log". 2018-11-22 09:25:05.517 CST [13266] LOG: listening on IPv4 address "0.0.0.0", port 5433 2018-11-22 09:25:05.517 CST [13266] LOG: listening on IPv6 address "::", port 5433 2018-11-22 09:25:05.518 CST [13266] LOG: listening on Unix socket "/tmp/.s.PGSQL.5433" 2018-11-22 09:25:05.567 CST [13266] LOG: redirecting log output to logging collector process 2018-11-22 09:25:05.567 CST [13266] HINT: Future log output will appear in directory "pg_log". Done Initialize all the datanode masters. Initialize the datanode master datanode1. Initialize the datanode master datanode2. The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /u01/pgxl/nodes/dnmaster ... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting dynamic shared memory implementation ... posix creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... creating cluster information ... ok syncing data to disk ... ok freezing database template0 ... ok freezing database template1 ... ok freezing database postgres ... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /u01/pgxl/nodes/dnmaster ... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting dynamic shared memory implementation ... posix creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... creating cluster information ... ok syncing data to disk ... ok freezing database template0 ... ok freezing database template1 ... ok freezing database postgres ... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. Done. Starting all the datanode masters. Starting datanode master datanode1. Starting datanode master datanode2. 2018-11-22 09:25:15.129 CST [13604] LOG: listening on IPv4 address "0.0.0.0", port 5436 2018-11-22 09:25:15.130 CST [13604] LOG: listening on IPv6 address "::", port 5436 2018-11-22 09:25:15.131 CST [13604] LOG: listening on Unix socket "/tmp/.s.PGSQL.5436" 2018-11-22 09:25:15.148 CST [13604] LOG: redirecting log output to logging collector process 2018-11-22 09:25:15.148 CST [13604] HINT: Future log output will appear in directory "pg_log". 2018-11-22 09:25:14.657 CST [13539] LOG: listening on IPv4 address "0.0.0.0", port 5436 2018-11-22 09:25:14.657 CST [13539] LOG: listening on IPv6 address "::", port 5436 2018-11-22 09:25:14.659 CST [13539] LOG: listening on Unix socket "/tmp/.s.PGSQL.5436" 2018-11-22 09:25:14.676 CST [13539] LOG: redirecting log output to logging collector process 2018-11-22 09:25:14.676 CST [13539] HINT: Future log output will appear in directory "pg_log". Done. ALTER NODE coord1 WITH (HOST='pg01', PORT=5433); ALTER NODE CREATE NODE coord2 WITH (TYPE='coordinator', HOST='pg02', PORT=5433); CREATE NODE CREATE NODE datanode1 WITH (TYPE='datanode', HOST='pg03', PORT=5436); CREATE NODE CREATE NODE datanode2 WITH (TYPE='datanode', HOST='pg04', PORT=5436); CREATE NODE SELECT pgxc_pool_reload(); pgxc_pool_reload ------------------ t (1 row) CREATE NODE coord1 WITH (TYPE='coordinator', HOST='pg01', PORT=5433); CREATE NODE ALTER NODE coord2 WITH (HOST='pg02', PORT=5433); ALTER NODE CREATE NODE datanode1 WITH (TYPE='datanode', HOST='pg03', PORT=5436); CREATE NODE CREATE NODE datanode2 WITH (TYPE='datanode', HOST='pg04', PORT=5436); CREATE NODE SELECT pgxc_pool_reload(); pgxc_pool_reload ------------------ t (1 row) Done. EXECUTE DIRECT ON (datanode1) 'CREATE NODE coord1 WITH (TYPE=''coordinator'', HOST=''pg01'', PORT=5433)'; EXECUTE DIRECT EXECUTE DIRECT ON (datanode1) 'CREATE NODE coord2 WITH (TYPE=''coordinator'', HOST=''pg02'', PORT=5433)'; EXECUTE DIRECT EXECUTE DIRECT ON (datanode1) 'ALTER NODE datanode1 WITH (TYPE=''datanode'', HOST=''pg03'', PORT=5436)'; EXECUTE DIRECT EXECUTE DIRECT ON (datanode1) 'CREATE NODE datanode2 WITH (TYPE=''datanode'', HOST=''pg04'', PORT=5436)'; EXECUTE DIRECT EXECUTE DIRECT ON (datanode1) 'SELECT pgxc_pool_reload()'; pgxc_pool_reload ------------------ t (1 row) EXECUTE DIRECT ON (datanode2) 'CREATE NODE coord1 WITH (TYPE=''coordinator'', HOST=''pg01'', PORT=5433)'; EXECUTE DIRECT EXECUTE DIRECT ON (datanode2) 'CREATE NODE coord2 WITH (TYPE=''coordinator'', HOST=''pg02'', PORT=5433)'; EXECUTE DIRECT EXECUTE DIRECT ON (datanode2) 'CREATE NODE datanode1 WITH (TYPE=''datanode'', HOST=''pg03'', PORT=5436)'; EXECUTE DIRECT EXECUTE DIRECT ON (datanode2) 'ALTER NODE datanode2 WITH (TYPE=''datanode'', HOST=''pg04'', PORT=5436)'; EXECUTE DIRECT EXECUTE DIRECT ON (datanode2) 'SELECT pgxc_pool_reload()'; pgxc_pool_reload ------------------ t (1 row) Done.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/5b8e6c88c0961a63ead8d75009a95bb8.html