dse advrep command line tool 

Options and command arguments for the DSE Advanced Replication command line tool.

The command line tool provides commands and options for configuring and using DSE Advanced Replication.

Prerequisites 

The dse advrep command line tool requires:
  • Cassandra Python driver
  • click package
On Ubuntu:
$ sudo apt-get install g++ python-dev -y
$ sudo pip install cassandra-driver
On Red Hat and CentOS:
$ sudo yum install gcc-c++ -y
$ sudo yum install python-devel    # might not be needed
$ sudo pip install cassandra-driver

DSE Advanced Replication commands 

These DSE Advanced Replication commands are available:

DSE Advanced Replication command options 

Synopsis
$ dse  [connection_options] edge [command_arguments]
To show the command line help for dse advrep:
$ dse advrep --help
To print only essential output for dse advrep:
$ dse advrep -q
You can provide authentication credentials in several ways, see Credentials for authentication.

Client to Cassandra connection commands 

The default port for DSE Advanced Replication is 9042. Connection options for the edge:
$ dse advrep [connection_options]
Connection options Description
--use-server-config Read connection configuration from server YAML files (dse.yaml and cassandra.yaml) instead of reading them from Hadoop configuration files. Use only when the DSE installation against which the command run is a running node.
--host address The Cassandra host RPC broadcast address. The default value is localhost.
--port port The Cassandra native protocol RPC connection port.
--ssl-enabled true|false Specify whether SSL is enabled for connection to Cassandra.
--ssl-protocol ssl_protocol SSL protocol for connection to Cassandra when SSL is enabled.
--cipher-suites ssl_cipher_suites A comma-separated list of SSL cipher suites for connection to Cassandra when SSL is enabled. For example, --cipher-suites=c1,c2,c3.
--kerberos-enabled true|false true|false - If true, enable Kerberos for connection to Cassandra. For example, --kerberos-enabled true.
--keystore-password ssl_keystore_password Keystore password for connection to Cassandra when SSL client authentication is enabled.
--keystore-path ssl_keystore_path Set path to the keystore for connection to Cassandra when SSL client authentication is enabled.
--keystore-type ssl_keystore_type Set keystore type for connection to Cassandra when SSL client authentication is enabled.
--truststore-password ssl_truststore_password Set the truststore password for connection to Cassandra when SSL is enabled.
--truststore-path ssl_truststore_path Set path to truststore for connection to Cassandra when SSL is enabled.
--truststore-type ssl_truststore_type Set truststore type for connection to Cassandra when SSL is enabled.
--sasl-protocol-name dse_service_principal The SASL protocol name must match the username of the Kerberos service principal used by the DSE server.
Connection options examples:
$ dse advrep --host ip-10-200-300-138.example.lan --kerberos-enabled=true edge list-conf
and
$ dse advrep --use-server-config edge list-conf

Edge-to-hub replication channel commands  

Synopsis
$ dse advrep edge channel command [command_arguments] 
To show the command line help for dse advrep edge channel:
$ dse advrep edge channel --help
Command and command arguments for:
$ dse advrep edge channel command [command_arguments] 
Command Command arguments
create Create a replication channel for a keyspace:

--keyspace edge_keyspace_name

--table edge_table_name

--hub-keyspace hub_keyspace_name

--hub-table hub_table_name

--enabled or --disabled Enable for replication when table is created.

--priority channel_priority

--edge-id edge_unique_id

--edge-id-col-name edge_col_name

conf Update a replication channel for a keyspace:

--keyspace keyspace_name

--table table_name

--hub-keyspace remote_hub_keyspace_name

--hub-table remote_hub_table

--priority repl_ch_priority

--edge-id edge_uniqueID

--edge-id-col-name col_name

--enabled

pause Pause replication channel for a keyspace:

--keyspace keyspace_name

resume Resume replication channel for a keyspace.

--keyspace keyspace_name

status Verify status of replication channel.
delete Delete replication channel.

Edge configuration and replication commands 

Synopsis
$ dse advrep edge conf [command_arguments]
To show the command line help for dse advrep edge conf:
$ dse advrep edge conf --help
Commands and command arguments for edge configuration and replication:
$ dse advrep edge command [command_arguments]
Command Command arguments
conf Configure the edge to point to its hub. The edge conf command requires a restart of the edge node. For details, see dse advrep edge conf configuration key descriptions.

--hub-ip-addresses hub_IPaddress

--hub-port non_default_port

--debug-output true|false

--driver-ssl-enabled true|false

--driver-ssl-keystore-path ssl_keystore_path

--driver_ssl_keystore_password ssl_keystore_password

--driver_ssl_keystore_type ssl_keystore_type

--driver_ssl_truststore_path ssl_truststore_path

--driver-ssl-truststore-password ssl_truststore_password

--driver-ssl-truststore-type ssl_keystore_type

--driver-ssl-protocol ssl_protocol

--driver-ssl-cipher-suites ssl_cipher_suites

--driver-allow-remote-dcs-for-local-cl true|false

--driver-compression lz4_or_snappy_algorithm

--driver-connect-timeout ms_driver_waits_to_connect_server

--driver-connections num_connections_to_create

--driver-connections-max max_num_connections_to_create

--driver-consistency-level consistency

--driver-local-dc dc_name

--driver-pwd username

--driver-read-timeout ms_driver_waits_to_read_server_responses

--driver-used-hosts-per-remote-dc number_of_hosts

--driver-user password

--edge-id edge_unique_id

--edge-id-col-name edge_col_name

--edge-replication

--invalid-message-log logging_strategy

--invalid-message-max-retries max_retry_num

--replication-log-audit-log-enabled true|false

--replication-log-audit-log-file-gzipped true|false

--replication-log-audit-log-file prefix_template_name

--replication-log-audit-log-file-rotate-time-max-lifespan-mins mins

--replication-log-audit-log-file-rotate-time-mins mins

--replication-log-buckets num_random_buckets:num_time_buckets:time_unit:num_time_unit

--replication-max-permits max_permits_avail

--replication-min-permits min_permits_avail

--replication-permit-timeout-ms timeout_ms

--replication-permits-tuning-delta-percentage interval_ms

--replication-permits-tuning-window-ms interval_ms

--replication-timeouts-lower-bound-ratio percentage

--replication-timeouts-upper-bound-ratio percentage

--replog-consumer-buffer num_msgs_node_reads_from_repl_log

--slow-track-min-bandwidth-percentage percentage

--help

list-conf List all configuration values for this edge.
start Start edge replication to hub.
stop Stop edge replication to hub.
rl-count Verify how many records are held in the replication log.
status Verify status of edge replication to hub.

Metrics 

Display metrics from the command line for the edge or hub node. JMX access is required.
$ dse advrep edge metrics
To show the command line help for dse advrep edge metrics:
$ dse advrep edge metrics --help
Command options for:
$ dse advrep edge metrics
Command Command options
metrics [--no-pretty-print] Output data as a comma-separated list. Default: tabular output.
  [--separator field_separator] Text. Specify only with the --no-pretty-print option to specify a separator other than the default comma (,) separator.
  [--metric-type filter_by_type]
  [--metric-group filter_by_group]
  [--timeout seconds] Timeout in seconds to wait for a connection. Default: 5
  [--jmx-user JMX_username]
  [--jmx-pwd JMX_password]
  [--help]

Replication command examples 

The dse advrep edge replication channel command line tool examples and results:
Creating an edge replication channel 
$ dse advrep edge channel create --keyspace foo --table bar --hub-keyspace foo --hub-table bar --priority 1 --edge-id edge1 --edge-id-col-name edge_id --enabled
Created Replication Channel foo:bar

$ dse advrep edge channel status
keyspace_name | table_name | edge_id | edge_id_col_name | enabled | hub_keyspace_name | hub_table_name | ...
---------------------------------------------------------------------------------------------------------...
foo           | bar        | edge1   | edge_id          | True    | foo               | bar            | ...
Configuring an edge replication channel  
$ dse advrep edge conf --edge-id "edge1" --edge-id-col-name "edge_id" --hub-ip-addresses "10.200.177.184"
Set replication config edge_id_col_name from None to edge_id
Set replication config hub_ip_addresses from None to 10.200.177.184
Set replication config edge_id from None to edge1
Viewing an edge replication channel configuration 
$ dse advrep edge list-conf
field            | value
--------------------------------
edge_id          | edge1
hub_ip_addresses | 10.200.181.55
edge_id_col_name | edge_id
Removing an edge replication channel configuration 
$ dse advrep edge remove-conf config_to_remove
Specify one or more channel configuration properties to remove.
For example, to remove the driver configuration:
$ dse advrep edge remove-conf --driver_user
Removed replication config driver_user value was my_hub_user
Starting replication from edge to hub and verifying status 
$ dse advrep edge start
edge replication started
$ dse advrep edge status
edge replication is running
Stopping replication from edge to hub 
The replication is stopped for the entire edge cluster. Specify the IP address of any node on the edge.
$ dse advrep -q --host 192.168.3.10 edge stop
edge replication stopped
Verifying the record count held in the replication log 
$ dse advrep edge rl-count

Metrics command examples 

The dse advrep edge metrics command line tool examples and results.
Show all metrics
$ dse advrep --host localhost --port 7199 -q edge metrics
Group                  | Type             | Count
-------------------------------------------------
ReplicationLogConsumer | Errors           | 0
ReplicationChannel     | ReloadErrors     | 1
ReplicationChannel     | DeliveryErrors   | 0
ReplicationLog         | MessageAddErrors | 0
Group | Type | Count | RateUnit | MeanRate | FifteenMinuteRate | Count | OneMinuteRate | ...
Filter by group
$ dse advrep --host localhost --port 7199 -q edge metrics --metric-group ReplicationChannel
Filter by group and type
$ dse advrep --host localhost --port 7199 -q edge metrics --metric-group ReplicationChannel --metric-type ReloadErrors
Group              | Type         | Count
-----------------------------------------
ReplicationChannel | ReloadErrors | 1