Chapter 6. Tungsten Connector

Table of Contents

6.1. Connector/Application Basics
6.1.1. Connector Control Flow
6.2. Clients and Deployment
6.2.1. Connection Pools
6.3. Routing Methods
6.3.1. Connector Routing Methods
6.3.2. Connector Quality of Service (QoS) Selection
6.3.3. Connector Load Balancers
6.3.4. Specifying Required Latency
6.3.5. Setting Host Affinity and Direct Reads
6.3.6. Smartscale Routing
6.3.7. Direct Routing
6.3.8. SQL Routing
6.3.9. Host-based Routing
6.3.10. Port-based Routing
6.3.11. Read-only Routing
6.4. Using Bridge Mode
6.4.1. Enabling Bridge Mode
6.5. User Authentication
6.5.1. user.map File Format
6.5.2. user.map Direct Routing
6.5.3. user.map Host Options
6.5.4. user.map Updates
6.5.5. Generating user.map Entries from a Script
6.5.6. Encrypting user.map Data
6.5.7. Synchronizing user.map Data
6.5.8. user.map Limitations
6.5.9. Host-based Authentication
6.6. Connector Operational States
6.6.1. Connections During Automatic Failure/Failover
6.6.2. Connections During Manual Switch
6.6.3. Connections During Connection Failures
6.6.4. Other Errors
6.6.5. Connector Keepalive
6.6.6. Connector Change User as Ping
6.7. Connector/Manager Interface
6.8. Connector Inline Command Interface
6.8.1. Connector tungsten cluster status Command
6.8.2. Connector tungsten connection count Command
6.8.3. Connector tungsten connection status Command
6.8.4. Connector tungsten flush privileges Command
6.8.5. Connector tungsten gc Command
6.8.6. Connector tungsten help Command
6.8.7. Connector tungsten mem info Command
6.8.8. Connector tungsten show [full] processlist Command
6.8.9. Connector show slave status Command
6.8.10. Connector tungsten show variables Command
6.9. Advanced Configuration
6.9.1. Using Multiple Dataservices
6.9.2. Connector Automatic Reconnect
6.9.3. Using with HA Proxy
6.9.4. Using Fall-Back Bridge Mode
6.9.5. Using the Max Connections Feature
6.9.6. Adjusting the Client Disconnect Delay During Manual Switch
6.9.7. Adjusting the Bridge Mode Forced Client Disconnect Timeout
6.9.8. Connector Logging Configuration
6.9.9. Connector SSL Advertisement Configuration
6.10. Connector General Limitations

Tungsten Connector acts as a proxy service, sitting between client applications and datasources in order to balance the load and provide high availability (HA) support. The service works by accepting raw packets from clients, and then forwarding them to the datasource. The process is reversed when packets are sent back from the datasource and then redirected back to the clients.

Figure 6.1. Tungsten Connector Basic Architecture

Tungsten Connector Basic Architecture

In addition to this basic structure, Tungsten Connector also works with the other components of Tungsten Clustering to handle some specific scenarios and situations:

  • The connector works in harmony with the Tungsten Manager as part of Tungsten Clustering and enables the connector to redirect queries between known datasources within a given dataservice. For example, when the manager identifies a failed datasource, queries to that datasource are redirected to an alternative datasource without the application being aware of the change.

  • The connector works with the Tungsten Clustering configuration and a number of implied or explicit directives that enable the connector to redirect requests within different datasources within the network. For example, the connector can be configured to automatically forward write requests to a database to the active master within the dataservice and reads to active slaves.

Throughout this process the connector is redirecting the network packets sent by application servers to the appropriate host. The contents and individual statements are not processed or accessed. At all times applications and clients using the connector do not need modification as to them it will appear as a MySQL server.

To start using the connector run the tpm connector command. This will open a connection with the MySQL CLI. See Section 6.2, “Clients and Deployment” for more detail on configuring your application to use the connector.

Important

After installation the connector will only work with the --application-user and --application-password that were provided during installation. See Section 6.5, “User Authentication” if you need more information on adding users to user.map.

shell > tpm connector
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 93422
Server version: 5.5.34-log-tungsten MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>