视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
HowtosetupDockerforPerconaClusterControlandaddexist_MySQL
2020-11-09 19:28:41 责编:小采
文档
Docker

In myprevious postI showed you how to setup Percona XtraDB Cluster 5.6 on Docker. This time I will show you how to setup Percona ClusterControl and add the existing Percona XtraDB Cluster 5.6 that we’ve managed to setup from the previous post.

Let us note the following details about our existing containers:

  • 172.17.0.2 dockerpxc1
  • 172.17.0.3 dockerpxc2
  • 172.17.0.4 dockerpxc3
  • 172.17.0.5 dockerccui-test
  • A quick tip for everyone who has followed my previous blog on setting up Percona XtraDB Cluster 5.6 on Docker: I did not install OpenSSH on the Docker instances on purpose and relied on ‘docker attach’ command to be able to get into each container. For this case however, we will need to install openssh-server in each container and make sure SSH is running as well as setup SSH key access for the Percona ClusterControl container to SSH into each Percona XtraDB Cluster node.

    Create the Percona ClusterControl UI Docker container

    We will need to create a docker container manually instead of building a container from a Dockerfile since we can’t run the ClusterControl installation non-interactively.

    root@Perconallc-Support / # docker run --name dockerccui-test -p 80 -i -t ubuntu:12.04 bash

    root @ Perconallc - Support / # docker run --name dockerccui-test -p 80 -i -t ubuntu:12.04 bash

    Notice that I had to add ‘-p 80′ to expose port 80 to the host network so we can access the Percona ClusterControl UI from a web browser, we will use Ubuntu 12.04 docker image. I will show you how to check the port that was dynamically allocated on the host network.

    I would recommend to run ‘apt-get upgrade’ and ‘apt-get dist-upgrade’ just to make sure we have the latest software packages installed. Install wget and lsb-release packages since these are needed in the next steps.

    Download and run the Percona ClusterControl installer and follow instructions on the prompt.

    root@Perconallc-Support / # chmod +x install-cc.shroot@Perconallc-Support / # ./install-cc.sh

    root @ Perconallc - Support / # chmod +x install-cc.sh

    root @ Perconallc - Support / # ./install-cc.sh

    The installer will give you several options, one of which is to install Percona Server as Percona ClusterControl’s backend database, I’d highly recommend to choose ‘Yes’. If everything goes well you will need to continue setup of the Percona ClusterControl on the web browser. If you missed installing lsb-release earlier then you will get an error midway through the installation, but you can always install lsb-release package and re-run the installation.

    To identify the exposed port on the host’s side we will need to verify it:

    root@Perconallc-Support / # docker inspect dockerccui-test | grep HostPort"HostPort": "49154""HostPort": "49154"

    root @ Perconallc - Support / # docker inspect dockerccui-test | grep HostPort

    "HostPort" : "49154"

    "HostPort" : "49154"

    As we can see, port 49154 was dynamically allocated to the host network and mapped to port 80 on the docker instance. You may explicitly set the port mapping on the host network ‘-p {hostPort}:{containerPort}’, please consult official Docker documentation for further reading.

    Setup Percona ClusterControl on the web browser

    We can now access the Percona ClusterControl user interface through http://{Host}:49154/clustercontrol. Use the username (in email form) that you indicated during the installation and the default password ‘admin’ to log in.

    We should see the following page after successfully logging in:

    Percona ClusterControl Wizard

    Select ‘Add an existing cluster’ and click Next then follow further instructions to get to the next page:

    Add existing cluster

    If all goes well you will be seeing the Database Clusters and can view your cluster nodes.

    Percona ClusterControl UI on Docker container with Percona XtraDB Clusters 5.6 with each node on docker containers


    Summary

    In this blog I showed you how to setup Percona ClusterControl on Docker and adding an existing cluster to ClusterControl.

    * Create a Docker container for Percona ClusterControl

    * Download Percona ClusterControl and installed it

    * Added existing Percona XtraDB Cluster on the Percona ClusterControl UI

    * Profit!

    You may also read the following blogs related to Percona ClusterControl:

  • How to create a new Percona XtraDB Cluster with ClusterControl
  • How to add an existing Percona XtraDB Cluster to Percona ClusterControl
  • For those who are new to Docker and containerization you may read through Patrick Galbraith’s blog series about Docker.

    下载本文
    显示全文
    专题