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

update example and readme with kong and hcl #123

Merged
merged 1 commit into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
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
2 changes: 1 addition & 1 deletion cmd/pranadb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type cli struct {
func main() {
r := &runner{}
if err := r.run(os.Args[1:], true); err != nil {
log.Fatal(err.Error())
log.WithError(err).Fatal("startup failed")
}
select {} // prevent main exiting
}
Expand Down