Skip to content

Instantly share code, notes, and snippets.

View PeterCorless's full-sized avatar

Peter Corless PeterCorless

View GitHub Profile
@PeterCorless
PeterCorless / scylla-manager-2-5.sh
Last active August 30, 2021 18:04
Scylla Manager 2.5
sctool status -c test-cluster
Datacenter: eu-west
╭────┬────────────┬────────────┬──────────┬────────────────┬──────────┬──────┬──────────┬────────┬──────────┬──────────────────────────────────────╮
│    │ Alternator │ CQL        │ REST     │ Address        │ Uptime   │ CPUs │ Memory   │ Scylla │ Agent    │ Host ID                              │
├────┼────────────┼────────────┼──────────┼────────────────┼──────────┼──────┼──────────┼────────┼──────────┼──────────────────────────────────────┤
│ UN │ UP (12ms)  │ DOWN (0ms) │ UP (3ms) │ 192.168.100.11 │ 1h32m35s │ 4    │ 31.11GiB │ 4.2.1  │ 2.5.0    │ 1edbfd5b-4b1c-4bb0-afab-d69fd25db6af │
│ UN │ UP (8ms)   │ UP (3ms)   │ UP (5ms) │ 192.168.100.12 │ 1h32m35s │ 4    │ 31.11GiB │ 4.2.1  │ 2.5.0    │ 0c0999a2-c879-4e69-9924-1641c8487bd5 │
│ UN │ UP (10ms)  │ UP (8ms)   │ UP (1ms) │ 192.168.100.13 │ 1h32m35s │ 4    │ 31.11GiB │ 4.2.1  │ 2.5.0    │ 73e9818e-ed8d-4ea8-89e4-cf485dfd4ebe │
╰────┴────────────┴────────────┴──────────┴────────────────┴──────────┴──────┴─
@PeterCorless
PeterCorless / 00-sctool-repair.txt
Last active June 7, 2022 18:05
ScyllaDB-Manager-3.0
sctool repair -K system* --name system_auth --dry-run --cron '1 2 3 4 5'
NOTICE: dry run mode, repair is not scheduled
Cron: 1 2 3 4 5 (At 02:01 AM, on day 3 of the month, and on Friday, only in April)
Tz: America/New_York
Data Centers:
- dc1
- dc2
@PeterCorless
PeterCorless / alternator-slow-query-logging.txt
Created August 4, 2022 05:28
ScyllaDB Alternator Slow Query Logging
cqlsh> select parameters, duration from system_traces.node_slow_log where start_time=b7a44589-8711-11eb-8053-14c6c5faf955;
parameters | duration
---------------------------------------------------------------------------------------------+----------
{'alternator_op': 'DeleteTable', 'query': '{"TableName": "alternator_Test_1615979572905"}'} | 75732
[{
'start_time': 'b7d42b37-a661-11eb-a391-3d2009e69e44',
'node_ip': '127.0.0.1',
'shard': '0',
'command': '{"TableName": "Pets", "Key": {"p": {"S": "dog"}}}',
@PeterCorless
PeterCorless / websocket_demo.cc
Created August 11, 2022 15:51
WebSocket in Seastar
ws.register_handler("echo", [] (input_stream<char>& in,
output_stream<char>& out) {
return repeat([&in, &out]() {
return in.read().then([&out](temporary_buffer<char> f) {
std::cerr << "f.size(): " << f.size() << "\n";
if (f.empty()) {
return make_ready_future<stop_iteration>(stop_iteration::yes);
} else {
return out.write(std::move(f)).then([&out]() {
return out.flush().then([] {