Docker is incredibly popular tool for deploying software, so we decided to provide a Percona Docker image for both Percona Server MySQL and Percona Server for MongoDB.
We want to create an easy way to try our products.
There are actually some images available from https://hub.docker.com/_/percona/, but these images are provided by Docker itself, not from Percona.
In our images, we provide all the varieties of storage engines available in Percona Server (MySQL/MongoDB).
Our images are available from https://hub.docker.com/r/percona/.
The simplest way to get going is to run the following:
1 |
docker run --name ps -e MYSQL_ROOT_PASSWORD=secret -d percona/percona-server:latest |
for Percona Server/MySQL, and:
1 |
docker run --name psmdb -d percona/percona-server-mongodb:latest |
for Percona Server/MongoDB.
It is very easy to try the different storage engines that comes with Percona Server for MongoDB. For example, to use RocksDB, run:
1 2 |
docker run --name psmdbrocks -d percona/percona-server-mongodb:latest --storageEngine=RocksDB |
or PerconaFT:
1 2 |
docker run --name psmdbperconaft -d percona/percona-server-mongodb:latest --storageEngine=PerconaFT |
We are looking for any feedback you’d like to provide: if this is useful, and what improvements we could make.
What is the difference between your image and docker’s image ?
Most significant change is that you can choose to install TokuDB engine during docker run command.
Another change is that our image is centos7 based, not debian based.
Thanks for publishing these images.
I have a few questions:
1) Why is the percona-server image almost twice the size of mysql-server?
2) The description on docker hub says that TokuDB is already enabled, but it does not show up in “show engines.” What should users do to enable it?
3) Recently the MySQL team has introduced a change to allow passing a file containing a password rather than the password instead. Could you do the same?
4) Where is the source code of the image?
5) Is a 5.7 version of the image coming along?
Thanks
Giuseppe
Giuseppe,
Thanks for the interest.
1) I am not really sure about size, I think MySQL may strip debug symbols. I need to investigate more if this is a big problem
2) This is not properly documented yet. you need to run docker with -e INIT_TOKUDB=1 to initialize TokuDB
3) I will look into passing file with the password
4) sources are there Source code is https://github.com/percona/percona-docker/tree/master/percona-server
5) Sure, we will do Percona Server 5.7 images as soon as it gets GA. Should be fairly soon.
Thanks,
Vadim
Vadim,
Thanks for your quick answer.
The size is important as it determines the speed of download and deployment.
Where should I report a bug? Enabling TokuDB made the container fail.
Giuseppe,
As this is mostly playground yet, please leave your bug report here.
I suspect it is related to hugepages not being disabled…
Experimental bug report:
After running
time docker run –name mybox -e MYSQL_ROOT_PASSWORD=secret -d -e INIT_TOKUDB=1 percona/percona-server
the container fails. At the end of ‘docker logs mybox’, I get:
Version: ‘5.6.28-76.1’ socket: ‘/var/lib/mysql/mysql.sock’ port: 0 Percona Server (GPL), Release 76.1, Revision 5759e76
Warning: Unable to load ‘/usr/share/zoneinfo/iso3166.tab’ as time zone. Skipping it.
Warning: Unable to load ‘/usr/share/zoneinfo/zone.tab’ as time zone. Skipping it.
which: no sestatus in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
Checking if Percona Server is running with jemalloc enabled…
WARNING: The file /proc/64/environ is not readable so impossible to check LD_PRELOAD for jemalloc.
Possibly running inside container so assuming jemalloc is preloaded and continuing…
If there will be an error during plugin installation try to restart mysql service and run this script again.
Checking transparent huge pages status on the system…
INFO: Transparent huge pages are enabled (should be disabled).
Checking if thp-setting=never option is already set in config file…
INFO: Option thp-setting=never is not set in the config file.
(needed only if THP is not disabled permanently on the system)
Checking TokuDB engine plugin status…
INFO: TokuDB engine plugin is not installed.
Disabling transparent huge pages for the current session…
/usr/bin/ps_tokudb_admin: line 348: /sys/kernel/mm/transparent_hugepage/defrag: Read-only file system
/usr/bin/ps_tokudb_admin: line 351: /sys/kernel/mm/transparent_hugepage/enabled: Read-only file system
ERROR: Failed to disable transparent huge pages for this session.
Giuseppe,
That’s indeed what I suspected.
Please execute on the host system before starting container:
echo never >
/sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
Unfortunately I can’t do from inside container.
I only need to document this.
Vadim,
you can fix this issue at run time with the following commands, without touching the host environment:
echo never > never.txt
docker run \
–name mybox \
-e MYSQL_ROOT_PASSWORD=secret -d \
-e INIT_TOKUDB=1 \
-v $PWD/never.txt:/sys/kernel/mm/transparent_hugepage/defrag \
-v $PWD/never.txt:/sys/kernel/mm/transparent_hugepage/enabled \
percona/percona-server
This way, the container will see your local file instead of the corresponding one from the host.
Vadim, This is less of a percona specific thing, and more of a docker/docker hub thing, but I’d love to see you guys using automated docker hub builds so everytime you checkin to git, a new image is created. Additionally, it’d be kind of great if you could make the CentOS image a dependancy, so that when they update their image (generally with security enhancements) the percona image also gets updated automatically.
Jeff,
I’ve added that, but at this moment Docker hub builds fail, as hub is using Docker 1.8, while in my Docker file I use ARG, which seems supported only in Docker 1.9.
Hello Vadim,
I tried to start mongo with PerconaFT/RocksDB engines:
docker run –name psmdbperconaft -d percona/percona-server-mongodb:latest –storageEngine=PerconaFT
But container does not work. Without –storageEngine option it works well.
Why?
Oleg,
Is there any output? Log files?
TokuDB does not start with this command…
docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e INIT_TOKUDB=1 -d percona/percona-server
Log is available here…
https://gist.github.com/shantanuo/35832764d58f3b1dfa7b035c248c2bf6
Thanks for the report, I’ve fixed TokuDB in the latest image – please check again
Is there any additional benefit of using your docker image compared to standard docker version of Percona (from https://hub.docker.com/_/percona/) ? Because standard mysqld options support specification of storage engine
Srinivas,
We provide regular updates for our images with each release.
Obviously we can’t guarantee that for the images provided by third parties.
Hello Vadim,
we require Galera cluster setup using percona5.6 version , please let me know which image I will get
Jy
https://hub.docker.com/r/percona/percona-xtradb-cluster/tags/
you can use percona/percona-xtradb-cluster:5.6 images