Install

Installation guide, best practices and constraints

DC/OS Percona XtraDB Cluster is available in the DC/OS Catalog and can be installed by using either the GUI or the DC/OS CLI.

The default DC/OS Percona XtraDB Cluster Service installation provides reasonable defaults for trying out the service, but that may not be sufficient for production use. You may require different configurations depending on the context of the deployment.

Deployment Best Practice for Production

  • Increase the number of TCP socket ports available. This is particularly important if the flow will be setting up and tearing down a large number of sockets in small period of time.
    sudo sysctl -w net.ipv4.ip_local_port_range="10000 65000"
    
  • Tell Linux you never want Percona XtraDB Cluster to swap. Swapping is fantastic for some applications. It isn’t good for something like Percona XtraDB Cluster that always wants to be running. To tell Linux you’d like swapping off you can edit ‘/etc/sysctl.conf’ to add the following line:
    vm.swappiness = 0
    

For the partitions handling the various Percona XtraDB Cluster repos, turn off things like atime. Doing so can cause a surprising bump in throughput. Edit the /etc/fstab file and for the partition(s) of interest add the ‘noatime’ option.

Prerequisites

  • You must have DC/OS installed on your cluster.
  • Your cluster must have at least 3 private nodes.
  • If you are using Enterprise DC/OS, you may need to provision a service account before installing DC/OS Percona XtraDB Cluster Service. Only someone with superuser permission can create the service account.
    • strict security mode requires a service account.
    • In permissive security mode a service account is optional.
    • disabled security mode does not require a service account.

Install a basic cluster

From the CLI

To start a basic test cluster , run the following command on the DC/OS CLI.

dcos package install percona-pxc-mysql

This command creates a new instance with the default name percona-pxc-mysql. Two instances cannot share the same name, so installing additional instances beyond the default instance requires customizing the name at install time for each additional instance.

All dcos percona-pxc-mysql CLI commands have a --name argument allowing you to specify which instance to query. If you do not specify a service name, the CLI assumes a default value matching the package name, percona-pxc-mysql. The default value for --name can be customized via the DC/OS CLI configuration:

dcos percona-pxc-mysql --name=percona-pxc-mysql <cmd>

From the web interface

Alternatively, you can install from the DC/OS web interface. If you install Percona XtraDB Cluster from the DC/OS web interface, the dcos percona-pxc-mysql CLI commands are not automatically installed to your workstation. They may be manually installed using the DC/OS CLI:

dcos package install percona-pxc-mysql --cli

After running the package install command, the service will begin installing.

Enterprise DC/OS installation

Depending on the security mode of the Enterprise DC/OS cluster, Enterprise DC/OS users may need to create a custom .json file and use it to install Percona XtraDB Cluster.

Create a Configuration File

Create a custom configuration file that will be used to install Percona XtraDB Cluster, and save it as config.json. Specify the service account (<service_account_id>) and a secret path (percona-pxc-mysql/<secret-name>) .

{
  "service": {
    "service_account": "<service_account_id>",
    "service_account_secret": "percona-pxc-mysql/<secret-name>"
  }
}

Installing with a custom config file

Use the custom configuration file you just created to install Percona XtraDB Cluster with this command:

dcos package install --options=config.json percona-pxc-mysql

Installing with external volumes enabled

Create a custom configuration file that will be used to install Percona XtraDB Cluster, and save it as config.json.

{
  "service": {
    "user": "root"
  },
  "node": {
    "external_volume": {
      "enabled": true,
      "driver_name": "pxd",

    }
  }
}

Use the custom configuration file you just created to install Percona XtraDB Cluster with this command:

dcos package install --options=config.json percona-pxc-mysql

Service Deployment

To monitor the deployment of your test instance, install the package cli (see command above) and run the command:

dcos percona-pxc-mysql plan status deploy

Once the deploy plan has a status of Complete, the service is fully deployed.

Service Discovery

To connect a client, query the service for its endpoints.

dcos percona-pxc-mysql endpoints

Select an endpoint from the list to see the available connections.

dcos percona-pxc-mysql endpoints <endpoint>

Working with the Service

Using the endpoint information, you can connect a client to the service from within the DC/OS cluster (for example, a Marathon app running a client application). See the other sections of the documentation for more details on configuration, operation, and service capabilities.