Code Monkey home page Code Monkey logo

z.2020-10-22.postgres-xl-docker's Introduction

Postgres-XL Docker

Postgres-XL Docker is a container image for Postgres-XL, the scalable open-source PostgreSQL-based database cluster.

The images allow for arbitrary database cluster topologies, allowing GTM, GTM Proxy, Coordinator, and Datanode nodes to be created and added as desired. Each service runs in its own container, communicating over a backend network. Coordinator nodes also connect to a frontend network.

Previously, Postgres-XL Docker used pgxc_ctl for initialisation and control, running SSH servers as well as database services. This has now been completely redesigned to run database services directly without SSH, initialising using included helper scripts, and allowing full flexibility with regard to cluster topologies. The pgxc_ctl binary is no longer included in the image, since the recommended Postgres-XL Docker workflow is to not use it.

Usage

Instructions are for running on Docker using Docker Compose. It should be possible to boot an entire Postgres-XL cluster using these instructions. For running on Docker Swarm, you'll likely have to make minor tweaks. Please wave if something isn't clear or you have questions when doing this.

It seems some people think that the way to use Postgres-XL Docker is to build it themselves from the Compose file. This is not the case; the images are published to Docker Hub, and those should normally be used instead. There's no need to compile this locally, unless you actually want to develop Postgres-XL Docker (or possibly Postgres-XL) itself. The supplied docker-compose.image.yml provides an example of how to do this; however, note that the latest tag is for testing and caching only; if you install a production database using latest or no tag at all, then you are doing it wrong, and your production will break at some point in the future. You have been warned. :)

Note that the pg_hba.conf written is wide-open for any user on the backend network; if you use this method, be sure that you trust all users on that network, and isolate client connections using a frontend network. Alternatively, you might like to configure ident or md5, edit pg_hba.conf yourself, or not use the provided init.sh helper scripts.

These instructions, along with the provided docker-compose.yml file, create:

  • 1 GTM (master) (gtm_1)
  • 2 Coordinators (master) (coord_1, coord_2)
  • 2 Datanodes (master) (data_1, data_2)
                                 --------------
                                 |   gtm_1    |
                                 --------------
                                / |          | \
                              /   |          |   \
                            /     |          |     \
                          /       |          |       \
                        /         |          |         \
                      /           |          |           \
                    /             |          |             \
                  /               |          |               \
                /       ------------        ------------      \
               |        | coord_1  |        | coord_2  |       |
               |        ------------        ------------       |
               |       /             \    /             \      |
               |     /                 \/                 \    |
         ------------      ------------/\------------      ------------
         |  data_1  |     /                          \     |  data_2  |
         ------------ ----                            ---- ------------

Other topologies are possible; you likely only need to edit docker-compose.yml, potentially setting additional environment variables.

Build

Clone repository. Pull source with git submodule update --init --recursive. Edit docker-compose.yml to reflect the desired topology.

Build services by bringing them up.

docker-compose up

This will create backend (db_a) and frontend (db_b) networks.

Clustering (Automatically)

Prepare an example cluster locally, using the provided example init script. This is not designed for production. Instead, configure by hand using whichever orchestrator you use, or write your own scripts.

bin/init-eg

Clustering (Swarm; Automatically)

If you're running on Docker Swarm, you can use the provided example docker-compose.stack.yml as a starting point, deploying with docker stack deploy, along with the init script. Note that the example makes various assumptions, such as that the Swarm node is a manager, that it is tagged with grp=dbxl, and that db_a has a lower subnet than db_b (which might or might not happen automatically; create the networks manually, if you're having trouble).

bin/init-eg-swarm STACK_NAME

Note there are various caveats to using this, which you can read about in detail here:

Clustering (Kubernetes; Automatically)

Please keep in mind:

  1. So as docker stack doesn't support depends_on option, it may cause errors until GTM node will be loaded.
  2. Scripts below are using kubectl to execute commands on the K8s cluster.
# TO UP
docker stack deploy --orchestrator=kubernetes --namespace=default -c docker-compose.stack.yml pxl_stack
# After you deployed pxl_stack, you need to initialize it (if it didn't do early or you purged PVC)
./bin/init-eg-stack

# TO DOWN
docker stack rm --orchestrator=kubernetes pxl_stack
# Keep in mind that Persistent volumes (PVC) are NOT Docker volumes
# If you want to purge that, you can to remove !!! ALL !!! PVC 👇
kubectl delete pvc --all
# To show all volumes use 👇
kubectl get pv

# TO PORT FORWARD
kubectl port-forward <NAME-OF-POD> 5432:5432
# Also Kubernetes will make port-forwarding. You can find localhost port below 👇
kubectl get service

# TO GET INFO
kubectl get all
# or
docker stack ps --orchestrator=kubernetes pxl_stack

# TO GET LOGS
kubectl describe pod db-data-2-0
kubectl logs db-data-2-0

# TO DEBUG
kubectl exec db-gtm-1-0 -i -t -- bash -il
# Where instead ☝️ db-gtm-1-0 may be used db-coord-1-0, db-coord-2-0, db-data-1-0, db-data-2-0
# If you wanna run psql inside container, I suggest to add /usr/local/lib/postgresql/bin to $PATH var
PATH=/usr/local/lib/postgresql/bin/:${PATH}

Pgpool

Also you can add pgpool load balacer to the solution. It needs to make base enter point to database cluster and load balansing between coordinators. It sees cordinators nodes. For that:

  1. Download pgpool.conf from gist.

  2. Add these strings below to a docker-compose file

      pgpool:
        image: smirart/pgpool:latest
        ports:
          - "5432:5432"
        volumes:
          - ./pgpool.conf:/etc/pgpool/pgpool.conf
        restart: always
        networks:
          - db-b
    

You can build your own pgpool image, otherwise use the prebuild image smirart/pgpool:latest.

As pgpool alternativity you can use HAProxy.

Clustering (Manually)

Prepare a clustering query, able to be executed on each node. Simplest is to use the same query for each node, open psql for each, and paste it into each. If you do this rather than crafting each line separately, expect some lines to error.

On coordinators and datanodes:

ALTER NODE data_1 WITH (TYPE = 'datanode');
ALTER NODE data_2 WITH (TYPE = 'datanode');
CREATE NODE coord_1 WITH (TYPE = 'coordinator', HOST = 'db_coord_1', PORT = 5432);
CREATE NODE coord_2 WITH (TYPE = 'coordinator', HOST = 'db_coord_2', PORT = 5432);
CREATE NODE data_1  WITH (TYPE = 'datanode',    HOST = 'db_data_1',  PORT = 5432);
CREATE NODE data_2  WITH (TYPE = 'datanode',    HOST = 'db_data_2',  PORT = 5432);
SELECT pgxc_pool_reload();

The ALTER lines fix the datanodes to have the correct types within the cluster. The CREATE lines specify the cluster topology, but the line for the localhost will fail. The pgxc_pool_reload() reloads the configuration.

Optionally, set preferred nodes. This could be a good idea if you've constrained nodes to run on specific hosts. For example, if you run coord_1 and data_1 on the same physical host, you might like to run this to ensure cross-network traffic is minimised.

On coord_1:

ALTER NODE data_1 WITH (PRIMARY, PREFERRED);
SELECT pgxc_pool_reload();

On coord_2:

ALTER NODE data_2 WITH (PRIMARY, PREFERRED);
SELECT pgxc_pool_reload();

View the topologies on each node:

SELECT * FROM pgxc_node;

Testing

Test the cluster using the instructions provided in https://www.postgres-xl.org/documentation/tutorial-createcluster.html.

For example, based on those instructions:

On a coordinator:

CREATE TABLE disttab (col1 int, col2 int, col3 text) DISTRIBUTE BY HASH(col1);
\d+ disttab
CREATE TABLE repltab (col1 int, col2 int) DISTRIBUTE BY REPLICATION;
\d+ repltab
INSERT INTO disttab SELECT generate_series(1, 100), generate_series(101, 200), 'foo';
INSERT INTO repltab SELECT generate_series(1, 100), generate_series(101, 200);
SELECT count(*) FROM disttab;
SELECT xc_node_id, count(*) FROM disttab GROUP BY xc_node_id;
SELECT count(*) FROM repltab;
SELECT xc_node_id, count(*) FROM repltab GROUP BY xc_node_id;

Blessing

May you find peace, and help others to do likewise.

Contact

tiredpixel.com · [email protected]

LinkedIn: in/nic-williams · Twitter: tiredpixel · GitHub: tiredpixel

Licence

Copyright © 2016-2020 Nic Williams, and other contributors. It is free software, released under the MIT licence, and may be redistributed under the terms specified in LICENSE.

z.2020-10-22.postgres-xl-docker's People

Contributors

sstubbs avatar tiredpixel avatar urpylka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

z.2020-10-22.postgres-xl-docker's Issues

Adding contrib

Hi,

Would it be possible to add contrib packages to this image or perhaps on another tag?

The standard postgres image comes with most of them all compiled. I only need ltree and cube currently but it might be better to compile them all.

If not I can create a new image based off of this one but I would rather use this if possible.

Thanks

Error with long host names

What

When calling create node command, the HOST property has a maximum number of characters. This causes the hostname to be truncated, which leads to connection issues between the pods.

The long hostname is required by the StatefulSet in kubernetes, since its defined as
[STS name].[POD-Name] which can be very long.

The error

Connection issues between the pods.

Proposal

Change permissions of the /etc/hosts file to allow host aliases to be added by the postgres user. In this case, we can add local aliases when connecting to the other containers and bypass the issue.

improve GTM healthcheck

Although the GTM healthcheck works, attempting to connect using Curl yields

db_gtm_1_1            | 1:2717890304:2017-05-14 14:12:56.185 UTC -FATAL:  Expecting a startup message, but received G
db_gtm_1_1            | LOCATION:  GTM_ThreadMain, main.c:1098

Improve healthcheck to check only for port being open.

Make the init.sh scripts idempotent?

The installation could possibly be simplified if the init.sh scripts were made idempotent. For example they could add a file to the data directory indicating that they have been run.

cmd script => unclean shutdown

The cmd scripts do not forward signals, or pass execution to the postgres programs. The prevents the db from shutting down cleanly in response to signals.

./Configure No such file or directory

HI tiredpixel
problem to build docker-compose.
---> e5573d5c35c6
Step 14/23 : RUN ./configure --prefix ${PG_LIB} && make && cd contrib/pgxc_ctl && make
---> Running in b472b4fe9ab5
/bin/sh: ./configure: No such file or directory
ERROR: Service 'db_gtm_1' failed to build: The command '/bin/sh -c ./configure --prefix ${PG_LIB} && make && cd contrib/pgxc_ctl && make' returned a non-zero code: 127

jammy healthcheck createdb

I appear to have introduced a regression in the latest healthchecks. :( I haven't been able to reproduce it every time, but now rather a lot of times, with both the Docker Hub images and the development source version. In brief, it's thus: sometimes, the healthcheck database never gets created. The createdb call hangs indefinitely, and bootstrapping never completes. However, killing the process appears to allow the call to succeed on the next try, and bootstrapping completes.

healthchecks order vs health

If one or more data nodes are reported as unhealthy before coord nodes healthchecks have fired, there is no _healthcheck database. Subsequent attempts by coord nodes to create the database will lead to a failure for one or more data nodes, since unhealthy traffic is not routed (I think). This leads to a broken cluster on init.

PG_NET_CLUSTER_A remove

PG_NET_CLUSTER_A, PG_NET_CLUSTER_B is fiddly to use correctly. Replace with a better solution.

Question - Image Size

Hi,

I'm busy adding in slave functionality into a pull request. I'm not sure why but when I build the image based on the included dockerfile its 498mb compared to yours on dockerhub which is 128mb. Any idea why there is such a massive difference in image size?

ctl missing USER

On ctl node, USER environment variable does not appear to be set for postgres user, making pgxc_ctl commands fail for default configuration.

i.e. Setting export USER=postgres before running pgxc_ctl works.

Official Blessing

I respectfully request of the Postgres-XL maintainers that this Postgres-XL Docker project be 'officially blessed'. The project is approximately 2 years old, has 68 stars on GitHub, has 24 forks on GitHub, has 11 watchers on GitHub, has over 100K downloads on Docker Hub (more in previous versions), and is licensed under MIT. In addition, googling for Postgres-XL Docker leads me to a blog post for 2015 (https://www.postgres-xl.org/2015/01/docker-for-postgres-xl/), which lists a link for which DNS is not resolvable.

Although I created the project, I have officially transferred ownership to Pavouk OÜ, a company in Estonia which I am a director of, and which makes Isoxya, a Web Crawler & Data Processing System (https://www.pavouk.tech/). Pavouk donates resources and CI time to build the images, publishes the images to Docker Hub (https://hub.docker.com/u/pavouk0), maintains the code in GitHub (https://github.com/pavouk-0), and publishes announcements on its blog, as part of its commitment to open-source software, to contribute something back to the community.

I would make this request myself personally on the Postgres-XL mailing lists, but despite being reported more than once, those mailing lists (since their migration to the new host, a year or two ago), remain broken for me, since I use the excellent email host Posteo (https://posteo.de/en), who offers a setting to guarantee secure delivery of emails over encryption-through-transit. Since Postgres-XL's mailing list provider doesn't support such, my emails to the list are rejected, and I have ended up unsubscribing. In the early days, I subscribed and manually disabled the security each time when posting, but hopefully it's understandable that this isn't really sustainable (it takes me minutes for each post, signing in via 2FA, etc.). If Postgres-XL's mailing list provider fixed their hosting to be secure, I would happily resubscribe and contribute as before.

I would be grateful if either @sstubbs or @LamaAni would be willing to carry this request to Postgres-XL maintainers on my behalf, they having contributed various accepted patches to this project, over the past year, and to reference this GitHub issue in their request.

Peace, tiredpixel. :)

/bin/sh: 1: ./configure: not found

The following error occurs when running docker-compose up -d:

---> Running in f098e3277884
Removing intermediate container f098e3277884
---> 6f700c4eb21f
Step 11/19 : RUN ./configure --prefix ${PG_LIB} && make && cd contrib/pgxc_monitor && make
---> Running in 1e0ef355e81a
/bin/sh: 1: ./configure: not found
Service 'db_gtm_1' failed to build: The command '/bin/sh -c ./configure --prefix ${PG_LIB} && make && cd contrib/pgxc_monitor && make' returned a non-zero code: 127

Setting Up In Swarm

Hi,

Firstly I would like to say what an awesome project. I have been trying alternatives and looking at this architecture for some time but haven't been successful in creating a reusable deployment of them in such a clean way as you have done here.

I am trying to test this in a swarm. I am happy to help wherever I can with this project as I think this is something that has been sorely missed in the postgres community.

I am trying to set it up in swarm mode just on one machine for the time being. However only the GTM starts if I start it like docker stack deploy --compose-file docker-compose.image.yml postgresxl

My first thought was that the network local might not work in swarm mode so I changed it to overlay in the docker-compose file like this

networks:
  db_a:
    overlay: true
  db_b:
    overlay: true

however it's still not working. I'm happy to dig into it a bit more and perhaps create a separate yml file for swarm if necessary but perhap is there something simple I'm not doing?

Thanks

Asking postgres user password

Hi,

When I adding
add gtm master gtm_m_1 postgresql-1-gtm-m-1 5432 /var/lib/postgres/data/gtm
Docker container asking me postgres user password.
PGXC add gtm master gtm_m_1 postgresql-1-gtm-m-1 5432 /var/lib/postgres/data/gtm Initialize GTM master The authenticity of host 'postgresql-1-gtm-m-1 (10.0.0.4)' can't be established. ECDSA key fingerprint is da:a7:5c:53:dd:39:a6:57:6a:50:09:06:6c:83:95:f3. Are you sure you want to continue connecting (yes/no)? yes postgres@postgresql-1-gtm-m-1's password:

TLS connection between coordinator and datanode.

Hello,

We would like to use TLS connection between coordinator and datanode, but sslmode is set to disable.(Please find the details in SOURCE CODE)
Does it mean TLS connection can not be set up between coordinator and datanode?
If not how to enable it?

SOURCE CODE:
num = snprintf(connstr, sizeof(connstr),
"host=%s port=%d dbname=%s user=%s application_name='pgxc:%s' sslmode=disable options='-c remotetype=%s -c parentnode=%s %s'",
host, port, dbname, user, parent_node, remote_type, parent_node,
pgoptions);

Thanks in advance.

Postgres-XL Docker: rework

Rework Postgres-XL Docker to use manual installation rather than pgxc_ctl.

  • remove pgxc_ctl
  • remove SSH
  • build multiple types of images, rather than one (GTM, Coordinator, Datanode, … ?)
  • rework installation to set up manually
  • update documentation
  • publish

from base docker image

Dockerfiles share many lines, to utilise layer caching effectively. Consider inheriting FROM a base image, containing only the dependencies.

Note: I'm currently undecided about this.

Orchestration

Hi,

I know this is probably unrelated as this project is for people to get a basic cluster setup when needed and for that it's great. I am having a hard time getting what I need stable. I am in the process of moving over to kubernetes and trying to set it up that way rather.

Perhaps once done I can setup a helm chart which links to this image if that would be useful and is possible without too much modification. The main blockers on docker swarm for me are the healthchecks and ordering of container startup as well not being able to setup affinity without labels which won't allow a ha setup.

I'll be starting out based on these.
https://www.digitalocean.com/community/tutorials/how-to-migrate-a-docker-compose-workflow-to-kubernetes
https://severalnines.com/database-blog/running-galera-cluster-kubernetes

Been moving over a lot of my other apps without too much hassle as jenkins x is awesome.

Where should I access postgres XL?

I up the containers from the swarm example.

I exposed port 5432 from cordinator 1 to the host. Is this the port my application should connect to?

I tried to connect on port 5432 and it says that the postgres user is not in the list for the ip they are trying to access. Where do I configure so that any IP can connect to port 5432?

Where do I set up to create a user to be able to connect to, for example developer with password 123456?

Thanks.

Encoding

Hi,

I'm currently using a custom image internally as I need cube and ltree as we discussed before so this issue doesn't really apply to me as I setup encoding in that image. However I would like to still provide your image for our open source projects and one thing which has given not very nice surprises in the past are encoding issues.

Would it be possible to include the locales package.

Then at init and runtime people can set their encoding like the following if needed

sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen

Release tag names

Hi,

Would it be possible to change the format of the release tag names (for the docker image), to a more human readable format?

I would suggest,
[pgxl_version_number]-[docker-image-version],

for example,
postgres-xl-docker:10.1-0.5.1

That would increase the readability in the helm chart. See: https://github.com/LamaAni/PGXL-HELM
image value.

role "_healthcheck" does not exist

Using the composer file, I get this error in the output of both cordinators.

version: "3"
services:
  db_gtm_1:
    environment:
      - PG_HOST=0.0.0.0
      - PG_NODE=gtm_1
      - PG_PORT=6666
    build: .
    command: docker-cmd-gtm
    entrypoint: docker-entrypoint-gtm
    volumes:
      - db_gtm_1:/var/lib/postgresql
    networks:
      - db_a
    healthcheck:
      test: ["CMD", "docker-healthcheck-gtm"]
  db_coord_1:
    environment:
      - PG_GTM_HOST=db_gtm_1
      - PG_GTM_PORT=6666
      - PG_HOST=0.0.0.0
      - PG_NODE=coord_1
      - PG_PORT=5432
    build: .
    command: docker-cmd-coord
    entrypoint: docker-entrypoint-coord
    volumes:
      - db_coord_1:/var/lib/postgresql
    depends_on:
      - db_gtm_1
    networks:
      - db_a
      - db_b
    healthcheck:
      test: ["CMD", "docker-healthcheck-coord"]
  db_coord_2:
    environment:
      - PG_GTM_HOST=db_gtm_1
      - PG_GTM_PORT=6666
      - PG_HOST=0.0.0.0
      - PG_NODE=coord_2
      - PG_PORT=5432
    build: .
    command: docker-cmd-coord
    entrypoint: docker-entrypoint-coord
    volumes:
      - db_coord_2:/var/lib/postgresql
    depends_on:
      - db_gtm_1
    networks:
      - db_a
      - db_b
    healthcheck:
      test: ["CMD", "docker-healthcheck-coord"]
  db_data_1:
    environment:
      - PG_GTM_HOST=db_gtm_1
      - PG_GTM_PORT=6666
      - PG_HOST=0.0.0.0
      - PG_NODE=data_1
      - PG_PORT=5432
    build: .
    command: docker-cmd-data
    entrypoint: docker-entrypoint-data
    depends_on:
      - db_gtm_1
    volumes:
      - db_data_1:/var/lib/postgresql
    networks:
      - db_a
    healthcheck:
      test: ["CMD", "docker-healthcheck-data"]
  db_data_2:
    environment:
      - PG_GTM_HOST=db_gtm_1
      - PG_GTM_PORT=6666
      - PG_HOST=0.0.0.0
      - PG_NODE=data_2
      - PG_PORT=5432
    build: .
    command: docker-cmd-data
    entrypoint: docker-entrypoint-data
    depends_on:
      - db_gtm_1
    volumes:
      - db_data_2:/var/lib/postgresql
    networks:
      - db_a
    healthcheck:
      test: ["CMD", "docker-healthcheck-data"]
volumes:
  db_gtm_1: {}
  db_coord_1: {}
  db_coord_2: {}
  db_data_1: {}
  db_data_2: {}
networks:
  db_a:
  db_b:

Output:

2020-01-08 17:38:50.664 UTC [47] FATAL: role "_healthcheck" does not exist
2020-01-08 17:39:23.778 UTC [56] ERROR: No Datanode defined in cluster
2020-01-08 17:39:23.778 UTC [56] HINT: You need to define at least 1 Datanode with CREATE NODE.
2020-01-08 17:39:23.778 UTC [56] STATEMENT: CREATE ROLE _healthcheck NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;
2020-01-08 17:39:23.785 UTC [58] ERROR: role "_healthcheck" does not exist
2020-01-08 17:39:23.785 UTC [58] STATEMENT: CREATE DATABASE _healthcheck OWNER _healthcheck;
2020-01-08 17:39:23.789 UTC [60] FATAL: role "_healthcheck" does not exist
2020-01-08 17:39:23.792 UTC [63] FATAL: role "_healthcheck" does not exist
2020-01-08 17:39:59.939 UTC [72] ERROR: No Datanode defined in cluster
2020-01-08 17:39:59.939 UTC [72] HINT: You need to define at least 1 Datanode with CREATE NODE.
2020-01-08 17:39:59.939 UTC [72] STATEMENT: CREATE ROLE _healthcheck NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;
2020-01-08 17:39:59.947 UTC [74] ERROR: role "_healthcheck" does not exist
2020-01-08 17:39:59.947 UTC [74] STATEMENT: CREATE DATABASE _healthcheck OWNER _healthcheck;
2020-01-08 17:39:59.951 UTC [76] FATAL: role "_healthcheck" does not exist
2020-01-08 17:39:59.955 UTC [79] FATAL: role "_healthcheck" does not exist

Setup following docs

Hi,

Just setup clean docker installs on two machines and one 3 node docker swarm cluster to test following the docs and this is what I'm getting just for your info.

I'm cloning the master branch repo.

1. docker-compose up

Step 11/19 : RUN ./configure --prefix ${PG_LIB} &&     make &&     cd contrib/pgxc_monitor &&     make
 ---> Running in 3326fb3fc9a7
/bin/sh: 1: ./configure: not found
ERROR: Service 'db_gtm_1' failed to build: The command '/bin/sh -c ./configure --prefix ${PG_LIB} &&     make &&     cd contrib/pgxc_monitor &&     make' returned a non-zero code: 127

2. docker-compose -f docker-compose.image.yml up
Then running init-eg This works and I can read and write to cluster fine.

3. docker stack deploy -c docker-compose.swarm.yml postgresxl
Then running init-eg-swarm.
Getting 0/1 replicas and no logs. docker ps -a shows no containers. I've pulled the image manually to double check as I've had an issue like this in the past when docker wasn't pulling the image automatically on service creation. I'm not sure if this is an issue with the docker I'm running which is why I'm trying it on different machines. Using docker 18.09.2

Kubernetes docker config?

Are you working on a kubernetes config? Your postgres-xl setup removed ssh, which was a major obstacle in kubernetizing it. So now that that blocker is gone I can see an approach.

Hopefully I can find some time to work on it.

GTM healthcheck issue

I seem to be getting this error on the GTM.
Expecting a startup message, but received �

I wonder if it's related to this.
#15

both inserting and querying both coordinators is working though.

I will try and create another cluster and see if this issue is still there.

coord healthchecks miss connection failure

For the should-be-infamous Postgres-XL class of errors:

ERROR:  Failed to get pooled connections
HINT:  This may happen because one or more nodes are currently unreachable, either because of node or network failure.                                                                       
 Its also possible that the target node may have hit the connection limit or the pooler is configured with low connections.                                                                  
 Please check if all nodes are running fine and also review max_connections and max_pool_size configuration parameters

coord healthchecks pass. I don't see any other option apart from forcing data to be written. Certainly, creating a database would work, but this is rather drastic; instead, it's likely possible to insert data in the _healthcheck table, instead.

Waiting for new 10_R1 release with netcat

Hi, is the new 10_R1 release with netcat available on dockerhub?

Also, what is the difference between 10_STABLE and 10_R1? is the branch 10_STABLE available on dockerhub?

pgxc_ctl: remove

It's causing confusion. I won't support it anymore; it's not needed. Instead, issue clustering commands directly using the approach in the README or bootstrap scripts.

improve Coord/Data healthchecks

Although Coord/Data healthchecks work, each reports a failure because of roles and databases already existing:

db_coord_2_1          | ERROR:  role "_healthcheck" already exists
db_coord_2_1          | STATEMENT:  CREATE ROLE _healthcheck NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;
db_coord_2_1          | ERROR:  database "_healthcheck" already exists
db_coord_2_1          | STATEMENT:  CREATE DATABASE _healthcheck;

Improve to only attempt to create role and database if not exists, perhaps extracting healthcheck to script instead of being specified on a single line.

Deploy to Kubernetes cluster by docker stack

Hi! I want to use Postgres-XL on Kubernetes cluster. I am interesting to do it through docker stack, because it works with docker-compose.yml and can be running at docker-compose or Kubernetes.

I am interesting to know what do you think about that?

PS yesterday I'd already tried to run that, but I don't know how to make automatic initialization of the cluster. Or how to dynamic reconfigure cluster with ReplicaSet or another methods? Is it needed to change NODE records in each node after every change of the structure?

Helm Chart

Hi,

I have started building a helm chart for this image, which I intend to publish soon. Though, there was a change in the last images from ~10 days ago where "netcat" was removed from the 10 image.

Anyway you could return this package, or give an equivalent?
Also, what is the recommended stable PGXL-10 image? Is it on docker hub?

Package rsync is missing

Hi,

Would it be possible to add the rsync package to the image? I require it for WAL archiving.

Scenario (postgres wal archiving)

#!/usr/bin/env bash
cur_path="$(dirname ${BASH_SOURCE[0]})"
source "$cur_path/common.sh"

# loading env.
SOURCE_WAL_FILE="$1"
TARGET_WAL_ARCHIVE_NAME="$2"

: ${WAL_ARCHIVE_PATH:="$STORAGE_MOUNT_PATH/wal_archive"}

if [ ! -d "$WAL_ARCHIVE_PATH" ]; then
  mkdir -p "$WAL_ARCHIVE_PATH"
  assert $? "Failed to create archive directory" || exit $?

  log:archive "Created archive directory @ $WAL_ARCHIVE_PATH"
fi

archive_to_path="$WAL_ARCHIVE_PATH/$TARGET_WAL_ARCHIVE_NAME"

# invoke backup logging.
# TODO: replace with rsync
cp -f "$SOURCE_WAL_FILE" "$archive_to_path"
assert $? "Error while archiving WAL $SOURCE_WAL_FILE -> $archive_to_path"
log:archive "Archived WAL file $SOURCE_WAL_FILE -> $archive_to_path"

configure file in which directory?

When I build docker,a problem has arisen. configure file in which directory?
Step 14 : RUN ./configure --prefix ${PG_LIB} && make && cd contrib/pgxc_ctl && make
---> Running in 31ff5f483293
/bin/sh: ./configure: No such file or directory
The command '/bin/sh -c ./configure --prefix ${PG_LIB} && make && cd contrib/pgxc_ctl && make' returned a non-zero code: 127
wish your reply.

failure at step 14/23

Hi,
I'm getting the following error when running docker-compose up

Step 14/23 : RUN ./configure --prefix ${PG_LIB} && make && cd contrib/pgxc_ctl && make
---> Running in 16d70c6440a4
/bin/sh: ./configure: No such file or directory
ERROR: Service 'db_gtm_1' failed to build: The command '/bin/sh -c ./configure --prefix ${PG_LIB} && make && cd contrib/pgxc_ctl && make' returned a non-zero code: 127

is the configure directory missing in the git repository?

Thanks
Riz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.