Skip to content

Commit

Permalink
update example and readme with kong and hcl
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyguava committed Aug 27, 2021
1 parent 28ebe97 commit 4c22224
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 59 deletions.
6 changes: 3 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ Open four terminals.
In terminal 1:

```
go run cmd/pranadb/main.go -conf cfg/example.conf -node 0
go run cmd/pranadb/main.go --config cfg/example.conf --node-id 0
```

In terminal 2:

```
go run cmd/pranadb/main.go -conf cfg/example.conf -node 1
go run cmd/pranadb/main.go --config cfg/example.conf --node-id 1
```

In terminal 3:

```
go run cmd/pranadb/main.go -conf cfg/example.conf -node 3
go run cmd/pranadb/main.go --config cfg/example.conf --node-id 2
```

In terminal 4, start the CLI
Expand Down
111 changes: 55 additions & 56 deletions cfg/example.conf
Original file line number Diff line number Diff line change
@@ -1,57 +1,56 @@
// Example Prana server configuration file
{
// NodeID is not specified in the config file, it is specified on the command line. This allows you to use
// the same config file for each node in the cluster

"ClusterID": 12345, // Each node in the same Prana cluster must have the same ClusterID, there can be multiple Prana clusters on your network

// RaftAddresses are the addresses used by Dragonboat to form Raft clusters. They can be local to your network
"RaftAddresses": [
"localhost:63201",
"localhost:63202",
"localhost:63203"
],

// Each node of the cluster listens for notifications from other nodes - these are the addresses they listen at
"NotifListenAddresses": [
"localhost:63301",
"localhost:63302",
"localhost:63303"
],

// These are the addresses the API server listens at on each node - these is used for connecting from clients
"APIServerListenAddresses": [
"localhost:6584",
"localhost:6585",
"localhost:6586"
],

"NumShards": 30, // Numshards is the total number of shards in the cluster
"ReplicationFactor": 3, // The number of replicas - each write will be replicated to his many replicas
"DataDir": "prana-data", // The base directory for storing data

// KafkaBrokers are the config for the Kafka brokers used by Prana
// - a map of broker name (a string) to the broker config
"KafkaBrokers": {
"testbroker": {
"ClientType": 2, // Client type determines which Kafka client library is used
"Properties": { // Properties get passed through to the client library
}
}
},

// Less likely you will want to change these settings

"TestServer": false, // For a real server always set to false
"DataSnapshotEntries": 10000, // The number of main data writes before a snapshot is triggered
"DataCompactionOverhead": 2500, // After a snapshot is taken how many writes to retain for main data
"SequenceSnapshotEntries": 1000, // The number of sequence writes before a snapshot is triggered
"SequenceCompactionOverhead": 250, // After a snapshot is taken how many writes to retain for sequences
"LocksSnapshotEntries": 1000, // The number of lock writes before a snapshot is triggered
"LocksCompactionOverhead": 250, // After a snapshot is taken how many writes to retain for locks
"Debug": false, // Set to true to start a profiling server
"NotifierHeartbeatInterval": 30000000000, // Amount of time in nanoseconds between notifier heartbeats
"EnableAPIServer": true, // Set to true to enable the API server - needed for CLI access
"APIServerSessionTimeout": 30000000000, // The amount of time in nanoseconds before an API server session times out
"APIServerSessionCheckInterval": 5000000000 // The amount of time in nanoseconds between checking for expired API server sessions
}
// NodeID is not specified in the config file, it is specified on the command line. This allows you to use
// the same config file for each node in the cluster

cluster-id = 12345 // Each node in the same Prana cluster must have the same ClusterID, there can be multiple Prana clusters on your network

// RaftAddresses are the addresses used by Dragonboat to form Raft clusters. They can be local to your network
raft-addresses = [
"localhost:63201",
"localhost:63202",
"localhost:63203"
]

// Each node of the cluster listens for notifications from other nodes - these are the addresses they listen at
notif-listen-addresses = [
"localhost:63301",
"localhost:63302",
"localhost:63303"
]

// These are the addresses the API server listens at on each node - these is used for connecting from clients
api-server-listen-addresses = [
"localhost:6584",
"localhost:6585",
"localhost:6586"
]

num-shards = 30 // Numshards is the total number of shards in the cluster
replication-factor = 3 // The number of replicas - each write will be replicated to his many replicas
data-dir = "prana-data" // The base directory for storing data

// KafkaBrokers are the config for the Kafka brokers used by Prana
// - a map of broker name (a string) to the broker config
kafka-brokers = {
testbroker = {
client-type = 2, // Client type determines which Kafka client library is used
properties = {
// Properties get passed through to the client library
}
}
}

// Less likely you will want to change these settings

test-server = false // For a real server always set to false
data-snapshot-entries = 10000 // The number of main data writes before a snapshot is triggered
data-compaction-overhead = 2500 // After a snapshot is taken how many writes to retain for main data
sequence-snapshot-entries = 1000 // The number of sequence writes before a snapshot is triggered
sequence-compaction-overhead = 250 // After a snapshot is taken how many writes to retain for sequences
locks-snapshot-entries = 1000 // The number of lock writes before a snapshot is triggered
locks-compaction-overhead = 250 // After a snapshot is taken how many writes to retain for locks
debug = false // Set to true to start a profiling server
notifier-heartbeat-interval = "30s" // Amount of time in nanoseconds between notifier heartbeats
enable-api-server = true // Set to true to enable the API server - needed for CLI access
api-server-session-timeout = "30s" // The amount of time in nanoseconds before an API server session times out
api-server-session-check-interval = "5s" // The amount of time in nanoseconds between checking for expired API server sessions

0 comments on commit 4c22224

Please sign in to comment.