POSTGRES_XL Brief Installation configuration instructions

Source: Internet
Author: User

1. System Requirements

CentOS 7.2 X64

Postgres-xl-9.5r1.4.tar.gz

# yum Install-y gcc-c++

# yum Install-y readline-devel

# yum Install-y zlib-devel

# Yum Install-y Perl

# Yum Install-y Flex

# yum Install-y flex-devel


2. Installing POSTGRES-XL

/home/soft/

Tar zxvf postgres-xl-9.5r1.4.tar.gz

./configure

Make

Make install


3. Add Users

AddUser Postgres

Su-postgres

VI. bash_profile

Export Ld_library_path=/usr/local/pgsql/lib

Export Path=/usr/local/pgsql/bin: $PATH

Export Manpath=/usr/local/pgsql/share/man: $MANPATH


4. Create the Data directory

--Set up the data directory of Coord, Datanode, GTM

Mkdir-p/opt/pgxl/data/data_coord1

Mkdir-p/opt/pgxl/data/data_datanode_1

Mkdir-p/opt/pgxl/data/data_datanode_2

Mkdir-p/opt/pgxl/data/data_gtm

Chown Postgres/opt/pgxl/data/data_coord1

Chown Postgres/opt/pgxl/data/data_datanode_1

Chown postgres/opt/pgxl/data/data_datanode_2

Chown Postgres/opt/pgxl/data/data_gtm


5. Initialize Coordinator, Datanode

Su-postgres

/usr/local/pgsql/bin/initdb-d/opt/pgxl/data/data_coord1 \

--nodename Coord1

/usr/local/pgsql/bin/initdb-d/opt/pgxl/data/data_datanode_1 \

--nodename Datanode_1

/usr/local/pgsql/bin/initdb-d/opt/pgxl/data/data_datanode_2 \

--nodename datanode_2


/usr/local/pgsql/bin/initgtm-d/opt/pgxl/data/data_gtm-z GTM


6. Start the GTM, Datanode, Coordinator

--GTM

/usr/local/pgsql/bin/gtm-d/opt/pgxl/data/data_gtm >/opt/pgxl/data/data_gtm/gtm_logfile.log 2>&1 &

--Datanode

/usr/local/pgsql/bin/postgres--datanode-p 15432-c pooler_port=40101 \

-d/opt/pgxl/data/data_datanode_1 >/opt/pgxl/data/data_datanode_1/datanode1_logfile.log 2>&1 &

/usr/local/pgsql/bin/postgres--datanode-p 15433-c pooler_port=40102 \

-d/opt/pgxl/data/data_datanode_2 >/opt/pgxl/data/data_datanode_1/datanode2_logfile.log 2>&1 &

--Coordinator

/usr/local/pgsql/bin/postgres--coordinator-c pooler_port=40100 \

-d/opt/pgxl/data/data_coord1 >/opt/pgxl/data/data_coord1/data_coord1_logfile.log 2>&1 &


7. Configure the node type, port

/usr/local/pgsql/bin/psql-c "ALTER NODE coord1 \

With (TYPE = ' coordinator ', PORT = 5432) "Postgres

/usr/local/pgsql/bin/psql-c "CREATE NODE datanode_1 \

With (TYPE = ' Datanode ', PORT = 15432) "Postgres

/usr/local/pgsql/bin/psql-c "CREATE NODE datanode_2 \

With (TYPE = ' Datanode ', PORT = 15433) "Postgres


8. Configure Execution guidance

/usr/local/pgsql/bin/psql-c "EXECUTE DIRECT on (datanode_1) \

' ALTER NODE datanode_1 with (TYPE = ' Datanode ', PORT = 15432) ' "Postgres

/usr/local/pgsql/bin/psql-c "EXECUTE DIRECT on (datanode_1) \

' CREATE NODE datanode_2 with (TYPE = ' Datanode ', PORT = 15433) ' "Postgres

/usr/local/pgsql/bin/psql-c "EXECUTE DIRECT on (datanode_1) \

' CREATE NODE coord1 with (TYPE = ' coordinator ', PORT = 5432) ' "Postgres


/usr/local/pgsql/bin/psql-c "EXECUTE DIRECT on (datanode_2) \

' ALTER NODE datanode_2 with (TYPE = ' Datanode ', PORT = 15433) ' "Postgres

/usr/local/pgsql/bin/psql-c "EXECUTE DIRECT on (datanode_2) \

' CREATE NODE datanode_1 with (TYPE = ' Datanode ', PORT = 15432) ' "Postgres

/usr/local/pgsql/bin/psql-c "EXECUTE DIRECT on (datanode_2) \

' CREATE NODE coord1 with (TYPE = ' coordinator ', PORT = 5432) ' "Postgres

9. Overloaded Configuration

/usr/local/pgsql/bin/psql-c "Select Pgxc_pool_reload ()" Postgres

/usr/local/pgsql/bin/psql-c "EXECUTE DIRECT on (datanode_1) \

' Select Pgxc_pool_reload () ' "Postgres

/usr/local/pgsql/bin/psql-c "EXECUTE DIRECT on (datanode_2) \

' Select Pgxc_pool_reload () ' "Postgres


10. Insert Test

Create a test table

Login Coordinator

/usr/local/pgsql/bin/createdb Test

/usr/local/pgsql/bin/psql Test

test=# CREATE TABLE t1 (id int, name varchar (20))

test=# \dt

List of relations

Schema | Name |  Type | Owner

--------+------+-------+----------

Public | T1 | Table | Postgres

(1 row)

test=# INSERT INTO T1 SELECT generate_series (1,1000000) as key, ' Peter ' | | (Random () * (10^3)):: integer;

INSERT 0 1000000

test=# \timing

Timing is on.

test=# INSERT INTO T1 SELECT generate_series (1000001,5000000) as key, ' Peter ' | | (Random () * (10^3)):: integer;

INSERT 0 4000000

time:60653.631 ms

test=#


View Data distribution

Login Datanode_1

[Email protected] ~]$ psql-p 15432 test

Psql (PGXL 9.5r1.4, based on PG 9.5.5 (POSTGRES-XL 9.5r1.4))

Type ' help ' for help.

test=# Select COUNT (*) from T1;

Count

---------

2502488

(1 row)

test=# \q


Login datanode_2

[Email protected] ~]$ psql-p 15433 test

Psql (PGXL 9.5r1.4, based on PG 9.5.5 (POSTGRES-XL 9.5r1.4))

Type ' help ' for help.

test=# Select COUNT (*) from T1;

Count

---------

2497512

(1 row)

test=# \q


Login Coordinator

[Email protected] ~]$ psql-p test

Psql:invalid Port number: "Test"

[Email protected] ~]$ psql test

Psql (PGXL 9.5r1.4, based on PG 9.5.5 (POSTGRES-XL 9.5r1.4))

Type ' help ' for help.


test=# Select COUNT (*) from T1;

Count

---------

5000000

(1 row)

test=# \dt T1;

List of relations

Schema | Name |  Type | Owner

--------+------+-------+----------

Public | T1 | Table | Postgres

(1 row)

test=#


This article is from the "Yiyi" blog, make sure to keep this source http://heyiyi.blog.51cto.com/205455/1882373

POSTGRES_XL Brief Installation configuration instructions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.