The connector is the wrapper script that handles the execution of the connector service.
Table 9.20. connector Commands
Option | Description |
---|---|
client-list | Return a list of the current client connections through this connector. |
cluster-status | Return the cluster status, as the connector currently understands it. This is the command-line alternative to the inline cluster status command. |
condrestart | Restart only if already running |
console | Launch in the current console (instead of a daemon) |
drain [seconds] | An alias for graceful-stop. As of v7.0.0 |
dump | Request a Java thread dump (if connector is running) |
graceful-stop [seconds] | Stops the connector gracefully, allowing outstanding open connections to finish and close before the connector process is stopped. All new connection requests are denied. The Connector will shut down as soon as there are no active connections. [seconds] is an integer specifying the optional time to wait before terminating the connector. Specifying no value for seconds will cause the Connector to wait indefinitely for all connections to finish. Specifying zero (0) seconds will cause the Connector to shut down immediately without waiting for existing connections to complete gracefully. As of v7.0.0, connector drain is available as an alias for connector graceful-stop. |
install | Install the service to automatically start when the system boots |
mode | Displauys the mode the connector is running in, either "proxy" or "bridge" |
reconfigure | Reconfigure the connector by forcing the connector to reread the configuration, including the configuration files and user.map . |
remove | Remove the service from starting during boot |
restart | Stop connector if already running and then start |
start | Start in the background as a daemon process |
status | Query the current status |
stop | Stop if running (whether as a daemon or in another console) Optional timeout in seconds can be provided (From release 6.1.19 only) |
These commands and options are described below:
Lists all ongoing connections with origin, local and remote (mysql data source) IPs/ports
shell> connector client-list
Executing Tungsten Connector Service --client-list ...
+----------------------+---------------------+----------------------+------------------------+
| Client | Connector Inbound | Connector Outbound | Data Source |
+----------------------+---------------------+----------------------+------------------------+
| /192.168.20.11:53890 | /192.168.20.11:9999 | /192.168.20.11:51612 | c1/192.168.20.11:13306 |
| /192.168.20.1:56492 | /192.168.20.11:9999 | /192.168.20.11:58556 | c1/192.168.20.11:13306 |
+----------------------+---------------------+----------------------+------------------------+
Done Tungsten Connector Service --client-list
Returns the cluster status, in the same form as the inline
tungsten cluster
status command. In addition, the same information can
be generated encapsulated in JSON format by adding the
-json
option. See
Section 7.11.1.1, “Connector connector cluster status on the
Command-line”, for
more information.
shell> connector cluster-status
Executing Tungsten Connector Service --cluster-status ...
+--------------+--------------------+-------------+--------------+--------+--------+------------------------------------------+------------------+-----------------+------------------+--------------------+---------------------+
| Data service | Data service state | Data source | Is composite | Role | State | High water | Last shun reason | Applied latency | Relative latency | Active connections | Connections created |
+--------------+--------------------+-------------+--------------+--------+--------+------------------------------------------+------------------+-----------------+------------------+--------------------+---------------------+
| europe | ONLINE | c1 | false | master | ONLINE | 0(c1-bin.000002:0000000000001219;113912) | | 1.0 | 114.0 | 1 | 4 |
| europe | ONLINE | c2 | false | slave | ONLINE | 0(c1-bin.000002:0000000000001219;113912) | | 1.0 | 113.0 | 0 | 0 |
| europe | ONLINE | c3 | false | slave | ONLINE | 0(c1-bin.000002:0000000000001219;113912) | | 1.0 | 113.0 | 0 | 1 |
+--------------+--------------------+-------------+--------------+--------+--------+------------------------------------------+------------------+-----------------+------------------+--------------------+---------------------+
Done Tungsten Connector Service --cluster-status
Restart the connector, only if it is already running. This can be useful to use when changing configuration or performing database management within automated scripts, as the connector will be only be restart if it was previously running.
For example, if the connector is running, connector condrestart operates as connector restart:
shell> connector condrestart
Stopping Tungsten Connector Service...
Waiting for Tungsten Connector Service to exit...
Stopped Tungsten Connector Service.
Starting Tungsten Connector Service...
Waiting for Tungsten Connector Service......
running: PID:26646
However, if not already running, the operation does nothing:
shell> connector condrestart
Stopping Tungsten Connector Service...
Tungsten Connector Service was not running.
− console
Launch in the current console (instead of a daemon)
An alias for graceful-stop. As of v7.0.0
− dump
Request a Java thread dump (if connector is running)
Stops the connector gracefully, allowing outstanding open connections to finish and close before the connector process is stopped. All new connection requests are denied. The Connector will shut down as soon as there are no active connections. [seconds] is an integer specifying the optional time to wait before terminating the connector. Specifying no value for seconds will cause the Connector to wait indefinitely for all connections to finish. Specifying zero (0) seconds will cause the Connector to shut down immediately without waiting for existing connections to complete gracefully. As of v7.0.0, connector drain is available as an alias for connector graceful-stop.
− install
Installs the startup scripts for running the connector at boot. For an alternative method of deploying these start-up scripts, see deployall.
− mode
Reloads the configuration without touching existing connections. New configuration only applies to new connections. Note that this command won't work for the following settings: connection.keepAlive.interval, connection.keepAlive.timeout, server.listen.address, server.port, server.port.binding.timeout, server.port.binding.retry.delay (when reaching server.max_connections only)
− remove
Removes the startup scripts for running the connector at boot. For an alternative method of removing these start-up scripts, see undeployall.
− restart
Stops the connector, if it is already running, and then restarts it:
shell> connector restart
Stopping Tungsten Connector Service...
Stopped Tungsten Connector Service.
Starting Tungsten Connector Service...
Waiting for Tungsten Connector Service......
running: PID:26248
− start
To start the connector service if it is not already running:
shell> connector start
Starting Tungsten Connector Service...
− status
Checks the execution status of the connector:
shell> connector status
Tungsten Connector Service is running: PID:27015, Wrapper:STARTED, Java:STARTED
If the connector is not running:
shell> connector status
Tungsten Connector Service is not running.
This only provides the execution state of the connector, not the actual state of replication. To get detailed information on the status of replication use trepctl status.
− stop
Stops the connector if it is already running, terminating all connections immediately:
shell> connector stop
Stopping Tungsten Connector Service...
Waiting for Tungsten Connector Service to exit...
Stopped Tungsten Connector Service.
Optional timeout can be provided, for example:
shell> connector stop 30
Stopping Tungsten Connector Service...
Waiting for Tungsten Connector Service to exit...
Stopped Tungsten Connector Service.
This would cause the connector to wait 30 seconds to allow connections to terminate cleanly, after the timeout, any remaining connections will be terminated.