Installing MySQL for PCF
This topic explains how to install MySQL for Pivotal Cloud Foundry (PCF).
MySQL for PCF supports deployment to multiple availability zones (AZs) on vSphere only. On other infrastructures, specify only one AZ.
To optimize uptime, deploy a load balancer in front of the SQL Proxy nodes. Configure the load balancer to route client connections to all proxy IPs, and configure the MySQL service to give bound applications a hostname or IP address that resolves to the load balancer. This eliminates the first proxy instance as a single point of failure. See Configure a Load Balancer below for load balancer configuration recommendations.
If you deploy the MySQL service on a different network than Elastic Runtime, configure the firewall rules as follows to allow traffic between Elastic Runtime and the MySQL service.
|Type||Listening service||TCP Port|
|Inbound/TCP||Proxy health check||1936|
|Inbound/HTTP||Proxy health check||1936|
|Internal/HTTP||Galera health check||9200|
For high availability, Pivotal recommends using a load balancer in front of the proxies:
Configure your load balancer for failover-only mode. Failover-only mode sends all traffic to one proxy instance at a time, and redirects to the other proxy only if the first proxy fails. This behavior prevents deadlocks when different proxies send queries to update the same database row. This can happen during brief server node failures, when the active server node changes. Amazon ELB does not support this mode; see AWS Route 53 for the alternative configuration.
Make your idle time out long enough to not interrupt long-running queries. When queries take a long time, the load balancer can time out and interrupt the query. For example, AWS’s Elastic Load Balancer has a default idle timeout of 60 seconds, so if a query takes longer than this duration then the MySQL connection will be severed and an error will be returned.
Configure a healthcheck or monitor, using TCP against port 1936. This defaults to TCP port
1936, to maintain backwards compatibility with previous releases. This port is not configurable. Unauthenticated healthchecks against port 3306 may cause the service to become unavailable and require manual intervention to fix.
Configure the load balancer to route traffic for TCP port 3306 to the IPs of all proxy instances on TCP port 3306.
After you install MySQL for PCF, you assign IPs to the proxy instances in Ops Manager.
If you initially deploy MySQL for PCF v1.5.0 without a load balancer and without proxy IPs configured, you can set up a load balancer later to remove the proxy as a single point of failure. When adding a load balancer to an existing installation, you need to:
- Rebind your apps to receive the hostname or IP that resolves to the load balancer. To rebind: unbind your application from the service instance, bind it again, then restage your application. For more information see Managing Service Instances with the CLI. In order to avoid unnecessary rebinding, we recommend configuring a load balancer before deploying v1.5.0.
- Instead of configuring the proxy IPs in Ops Manager, configure DNS for your load balancer to point to the IPs that were dynamically assigned to your proxies. You can find these IPs in the Status tab. Configuration of proxy IPs after the product is deployed with dynamically assigned IPs is not well supported.
The ASG allows smoke tests to run when you install the MySQL for PCF service and allows apps to access the service after it is installed.
Note: The service is not installable or usable until an ASG is in place.
Download the product file from Pivotal Network.
Navigate to the Ops Manager Installation Dashboard.
Click Import a Product to upload the product file to your Ops Manager installation.
Click Add next to the uploaded product description in the Available Products view to add this product to your staging area.
Click the newly-added tile to configure the settings for your MySQL for PCF service, including its service plans. See Configuring MySQL for PCF for instructions.
Click Apply Changes to deploy the service.