Skip to content

Instantly share code, notes, and snippets.

@guy9
guy9 / migration-labs-4.json
Created January 14, 2024 14:09
migration-labs-4.cql
{
"migtest": [
     {
         "PutRequest": {
             "Item": {
                 "City": { "S": "New York" },
                 "Date": { "S": "2022-03-15" }
             }
         }
     },
INSERT INTO data.tbl (id, data) VALUES (1, 'a');
INSERT INTO data.tbl (id, data) VALUES (2, 'b');
INSERT INTO data.tbl (id, data) VALUES (3, 'c');
INSERT INTO data.tbl (id, data) VALUES (4, 'd');
INSERT INTO data.tbl (id, data) VALUES (5, 'e');
CREATE KEYSPACE data WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': 1};
CREATE TABLE data.tbl ( id INT, data TEXT, PRIMARY KEY(id));
@guy9
guy9 / migration-labs-1.yaml
Last active January 14, 2024 14:05
migration-labs-1.yaml
version: "3"
services:
  scylla-migration-node1:
image: scylladb/scylla-enterprise:2021.1.8
restart: always
command: --seeds=scylla-migration-node1 --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0 --alternator-port 8000 --alternator-write-isolation a --listen-address 172.98.0.2
volumes:
   - "./data/shared/:/shared/"        
networks:
   migration:
@guy9
guy9 / sl-demo-dash-v3.json
Created December 18, 2023 17:10
Workload Prioritization Example Demo
{
"annotations": {
"class": "default_annotations",
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
[guy@fedora test]$ git clone git@github.com:scylladb/scylla-code-samples.git
cd scylla-code-samples/presto
Cloning into 'scylla-code-samples'...
remote: Enumerating objects: 4781, done.
remote: Counting objects: 100% (693/693), done.
remote: Compressing objects: 100% (458/458), done.
remote: Total 4781 (delta 210), reused 595 (delta 158), pack-reused 4088
Receiving objects: 100% (4781/4781), 5.83 MiB | 3.25 MiB/s, done.
Resolving deltas: 100% (1510/1510), done.
[guy@fedora presto]$ ls
[guy@fedora presto]$ docker compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
presto-metabase-1 metabase/metabase:v0.43.7.3 "/app/run_metabase.sh" metabase 54 seconds ago Up 52 seconds 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp
presto-presto-1 ahanaio/prestodb:0.282 "/opt/entrypoint.sh" presto 54 seconds ago Up 53 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp
presto-scylladb-1 presto-scylladb "/docker-entrypoint.…" scylladb 54 seconds ago Up 53 seconds (healthy) 22/tcp, 7000-7001/tcp, 9160/tcp, 9180/tcp, 10000/tcp, 0.0.0.0:9042->9042/tcp, :::9042->9042/tcp
[guy@fedora presto]$
@guy9
guy9 / aio-max-nr-change.bash
Last active August 15, 2023 12:55
aio-max-nr-change.bash
ubuntu $ cat /proc/sys/fs/aio-max-nr
65536
ubuntu $ echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
ubuntu $ sysctl -p /etc/sysctl.conf
fs.inotify.max_user_watches = 524288
fs.aio-max-nr = 1048576
ubuntu $
# List Scylla end points
# An example with a single cluster and two DC
- targets:
- 172.17.0.2:9180
- 172.17.0.3:9180
- 172.17.0.4:9180
labels:
cluster: cluster
dc: datacenter
keyspace: iot
keyspace_definition: |
  CREATE KEYSPACE IF NOT EXISTS iot WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
table: devices
table_definition: |
  CREATE TABLE devices (
device_id uuid,
ts timestamp,
temperature float,
pressure float,