Simple and manual sharding on PostgreSQL.
Foreign Data Wrappers inheritance.
By 3manuek in Postgres
March 6, 2017
Before starting the container
This article is not an introductory explanation of docker,however it’s scope if for docker’s beginners. You can consider it as an extension of the well documented Percona docker hub doc. For the source code of the image, the repository is at github.
Here is the all what you need to do for start:
|
|
For checking the container status log, you can execute docker logs percona57
.
Additional MySQL logs
To start the container is pretty easy, but if you are not very used to Docker, you will find a bit lost if you want to enable logging or other features.
For example, a full logging container will be started with this:
|
|
Note that the log_slow_verbosity
is only applicable for the Percona release, and adds extra output that turns very useful when doing complex query reviews. As you can appreciate, all the options are passed after the image name (percona:5.7).
Now, the question is: where are the logs? Generally, you can access the container using docker exec -it percona57 bash
and view the logs inside it, although this is not the most comfortable way to do this.
In the example bellow, we’ll use jq
(a very handy json parser).
|
|
The logs (general and slow) are using the container id
in the file name, which can be appreciated when executing docker ps
.
Access through network
Obviously, when using docker in production, you don’t want to access it locally. For getting the host of our container (and all the running containers), we can do the following commands:
|
|
We can see that our container percona57
is running over 172.17.0.2
IP address. To access it, you only need to do as usual:
|
|
- Posted on:
- March 6, 2017
- Length:
- 3 minute read, 496 words
- Categories:
- Postgres
- Series:
- Getting Started
- Tags:
- hugo-site