-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples: working example with scylla db
- Loading branch information
1 parent
0de29cb
commit 554a5bb
Showing
5 changed files
with
2,152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# skyring-scylladown | ||
|
||
Example skyring cluster using [ScyllaDB] as a storage backend. | ||
|
||
```bash | ||
# start Syclla & nats | ||
$ docker-compose up -d | ||
|
||
# Start Seed Node 1 | ||
$ PORT=3000 DEBUG=* node . --storage:path=skyring-1 --storage:contactPoints=0.0.0.0:9042 --storage:contactPoints=0.0.0.0:9043 --channel:port=3455 | ||
|
||
# Start Seed Node 1 | ||
$ PORT=3001 DEBUG=* node . --storage:path=skyring-2 --storage:contactPoints=0.0.0.0:9042 --storage:contactPoints=0.0.0.0:9043 --channel:port=3456 | ||
``` | ||
|
||
[ScyllaDB]: https://scylladb.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: "2.1" | ||
services: | ||
scylla-1: | ||
image: scylladb/scylla | ||
hostname: scylla-1 | ||
command: --broadcast-address scylla-1 --listen-address scylla-1 --overprovisioned 1 --smp 1 | ||
ports: | ||
- 9042:9042 | ||
networks: | ||
- scylla | ||
|
||
scylla-2: | ||
image: scylladb/scylla | ||
hostname: scylla-2 | ||
command: --seeds scylla-1 --broadcast-address scylla-2 --listen-address scylla-2 --overprovisioned 1 --smp 1 | ||
networks: | ||
- scylla | ||
ports: | ||
- 9043:9042 | ||
depends_on: | ||
- scylla-1 | ||
|
||
scylla-3: | ||
image: scylladb/scylla | ||
hostname: scylla-3 | ||
command: --seeds scylla-1 --broadcast-address scylla-3 --listen-address scylla-3 --overprovisioned 1 --smp 1 | ||
networks: | ||
- scylla | ||
ports: | ||
- 9044:9042 | ||
depends_on: | ||
- scylla-1 | ||
|
||
nats: | ||
image: nats:latest | ||
ports: | ||
- 4222:4222 | ||
networks: | ||
- scylla | ||
|
||
networks: | ||
scylla: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict' | ||
|
||
const Skyring = require('skyring') | ||
|
||
const server = new Skyring({ | ||
storage: { | ||
backend: '@skyring/scylladown' | ||
} | ||
}) | ||
|
||
server.listen(process.env.PORT || 3000, (err) => { | ||
if(err) { | ||
process.exitCode = 1; | ||
console.error(err); | ||
throw err; | ||
} | ||
console.log('server listening'); | ||
}); | ||
|
||
function onSignal() { | ||
server.close(()=>{ | ||
console.log('shutting down'); | ||
}); | ||
} | ||
process.once('SIGINT', onSignal); | ||
process.once('SIGTERM', onSignal); |
Oops, something went wrong.