Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Add replication lag script #4620

Merged
merged 7 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/content/latest/deploy/multi-dc/2dc-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,31 @@ Connect to “yugabyte-consumer” universe using the YSQL shell (`ysqlsh`) or t
**For bidirectional replication**

Repeat the steps above, but pump data into “yugabyte-consumer”. To avoid primary key conflict errors, keep the key space for the two universes separate.


{{< note title="How to check replication lag" >}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{< note title="How to check replication lag" >}}
{{< note title="Note" >}}

The Note title is only intended for Note, Important, Warning, and other admonitions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevebang On the same page above it's a "tip" with a custom title Recommended Reading.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, letting it slide for now — this use and others should be handled differently. But, I will have to propose an alternative.

Replication lag is computed at the tablet level by subtracting the `last_read_hybrid_time` from the `hybrid_clock_time`.
ddorian marked this conversation as resolved.
Show resolved Hide resolved
[Here](/files/determine_replication_lag.sh) is an example script that does it for you.
ddorian marked this conversation as resolved.
Show resolved Hide resolved
The script requires [`jq`](https://stedolan.github.io/jq/) package.
ddorian marked this conversation as resolved.
Show resolved Hide resolved

The example below would give you a summary of all tables on a given cluster. You can also request an individual table:
ddorian marked this conversation as resolved.
Show resolved Hide resolved
```bash
$ ./determine_repl_latency.sh -h
determine_repl_latency.sh -m MASTER_IP1:PORT,MASTER_IP2:PORT,MASTER_IP3:PORT [ -c PATH_TO_SSL_CERTIFICATE ] (-k KEYSPACE -t TABLENAME | -a) [ -p PORT ] [ -r report ] [ -o output ] [ -u units ]
Options:
-m | --master_addresses Comma separated list of master_server ip addresses with optional port numbers [default 7100]
-c | --certs_dir_name Path to directory containing SSL certificates if TLS node-to-node encryption is enabled
-k | --keyspace Name of keyspace that contains the table that is being queried. YSQL keyspaces must be prefixed with ysql
-t | --table_name Name of table
-a | --all_tables Specify this flag instead of -k and -t if you want all tables in the universe included
-p | --port Port number of tablet server metrics page [default 9000]
-r | --report_type Possible values: all,detail,summary [default all]
-o | --output_type Possible values: report,csv [default report]
-u | --units Possible values: us (microseconds), ms (milliseconds) [default ms]
-h | --help This message


./determine_repl_latency.sh -m 10.150.255.114,10.150.255.115,10.150.255.113
```

{{< /note >}}
Loading