-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCONFIG.readme
193 lines (174 loc) · 6.73 KB
/
CONFIG.readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
CONFIGURATION:
PART ONE: SIMPLE CONFIG:
The simplest configuration setup for Datanet's Central component is found in ~/node_modules/zync/conf/both_DC1-1.cfg
The file both_DC1-1.cfg is a single configuration file for the entire Central component
The file is a JSON object with the following syntax:
{
"role" : "BOTH", // ROLE: BOTH STORAGE & ROUTER
"uuid" : 1901, // UNIQUE CENTRAL SERVER UUID
"datacenter" : {
"name" : "D1" // UNIQUE DATACENTER NAME
},
"wss" : {
"server" : {
"hostname" : "127.0.0.1", // WSS SERVER HOSTNAME (INCOMING)
"ip" : "0.0.0.0", // WSS SERVER LISTEN-IP (INCOMING)
"port" : 10101 // WSS SERVER PORT (INCOMING)
}
},
"backend" : {
"server" : {
"hostname" : "localhost", // BACKEND HOSTNAME (INTERNAL)
"ip" : "0.0.0.0", // BACKEND LISTEN-IP (INTERNAL)
"port" : 20101 // BACKEND SERVER PORT (INTERNAL)
}
},
"database" : {
"name" : "REDIS", // CENTRAL DATABASE NAME [REDIS,MONGO,MEMORY]
"ip" : "127.0.0.1", // CENTRAL DATABASE IP
"port" : 6000 // CENTRAL DATABASE PORT
}
}
Each Central server requires a unique UUID and NAME
This Central server is serving incoming (from Datanet Agents) on wss://127.0.0.1:10101
This Central server communicates to other Central servers in its cluster via ip:port localhost:20101
This Central server persists data in a REDIS database at ip:port 127.0.0.1:6000
PART TWO: ROUTER & STORAGE CONFIG
To scale better, each Central node can be broken up into two pieces [ROUTER & STORAGE] and connected by a configurable QUEUE. ROUTER takes care of routing Deltas & DeltaCommits to Subscriber. STORAGE handles applying Deltas and resyncing offline Agents.
ROUTER CONFIG:
NOTES: 1.) QUEUE & DATABASE have the same (ip,port) -> this is OK
2.) Following fields must be unique:
uuid, wss.server.[ip,port], backend.server.[ip,port]
The file is a JSON object with the following syntax:
{
"role" : "ROUTER" // ROLE
"uuid" : 101, // UNIQUE CENTRAL SERVER UUID
"datacenter" : {
"name" : "D1" // UNIQUE DATACENTER NAME
},
"wss" : {
"server" : {
"hostname" : "127.0.0.1", // WSS SERVER HOSTNAME (INCOMING)
"ip" : "0.0.0.0", // WSS SERVER LISTEN-IP (INCOMING)
"port" : 10101 // WSS SERVER PORT (INCOMING)
}
},
"backend" : {
"server" : {
"hostname" : "localhost", // BACKEND HOSTNAME (INTERNAL)
"ip" : "0.0.0.0", // BACKEND LISTEN-IP (INTERNAL)
"port" : 20101 // BACKEND SERVER PORT (INTERNAL)
}
},
"database" : {
"name" : "REDIS", // CENTRAL DATABASE NAME [REDIS,MONGO,MEMORY]
"ip" : "127.0.0.1", // CENTRAL DATABASE IP
"port" : 6000 // CENTRAL DATABASE PORT
},
"dataqueue" : {
"name" : "REDIS", // CENTRAL QUEUE NAME [REDIS]
"ip" : "127.0.0.1", // CENTRAL QUEUE IP
"port" : 6000 // CENTRAL QUEUE PORT
}
}
STORAGE CONFIG:
NOTES: 1.) ROUTER & STORAGE 'database' must be different
2.) ROUTER & STORAGE 'queue' must be the same
3.) Following fields must be unique: uuid, backend.server.[ip,port]
The file is a JSON object with the following syntax:
{
"role" : "STORAGE", // ROLE
"uuid" : 1101, // UNIQUE CENTRAL SERVER UUID
"datacenter" : {
"name" : "D1" // UNIQUE DATACENTER NAME
},
"backend" : {
"server" : {
"hostname" : "localhost", // BACKEND HOSTNAME (INTERNAL)
"ip" : "0.0.0.0", // BACKEND LISTEN-IP (INTERNAL)
"port" : 21101 // BACKEND SERVER PORT (INTERNAL)
}
},
"database" : {
"name" : "REDIS", // CENTRAL DATABASE NAME [REDIS,MONGO,MEMORY]
"ip" : "127.0.0.1", // CENTRAL DATABASE IP
"port" : 7000 // CENTRAL DATABASE PORT
},
"dataqueue" : {
"name" : "REDIS", // CENTRAL QUEUE NAME [REDIS]
"ip" : "127.0.0.1", // CENTRAL QUEUE IP
"port" : 6000 // CENTRAL QUEUE PORT
}
}
PART THREE: ADDING NEW CLUSTER NODES
NOTES: 1.) Both ROUTER & STORAGE nodes are automatically added via
'database' settings
EXAMPLE: add ROUTER node w/ UUID: 102
The file is a JSON object with the following syntax:
{
"role" : "ROUTER" // ROLE
"uuid" : 102, // UNIQUE CENTRAL SERVER UUID
"datacenter" : {
"name" : "D1" // UNIQUE DATACENTER NAME
},
"wss" : {
"server" : {
"hostname" : "127.0.0.1", // WSS SERVER HOSTNAME (INCOMING)
"ip" : "0.0.0.0", // WSS SERVER LISTEN-IP (INCOMING)
"port" : 10102 // WSS SERVER PORT (INCOMING)
}
},
"backend" : {
"server" : {
"hostname" : "localhost", // BACKEND HOSTNAME (INTERNAL)
"ip" : "0.0.0.0", // BACKEND LISTEN-IP (INTERNAL)
"port" : 20102 // BACKEND SERVER PORT (INTERNAL)
}
},
"database" : {
"name" : "REDIS", // CENTRAL DATABASE NAME [REDIS,MONGO,MEMORY]
"ip" : "127.0.0.1", // CENTRAL DATABASE IP
"port" : 6000 // CENTRAL DATABASE PORT
},
"dataqueue" : {
"name" : "REDIS", // CENTRAL QUEUE NAME [REDIS]
"ip" : "127.0.0.1", // CENTRAL QUEUE IP
"port" : 6000 // CENTRAL QUEUE PORT
}
}
POART FOUR: Adding new GEO-CLUSTERs
NOTES: 1.) New GeoClusters are added via a DISCOVERY.[ip,port]
2.) DISCOVERY must be up, otherwise the GEO-CLUSTER ADD will FAIL
in this case it points to UUID: 101 in DC1's [ip,port]
EXAMPLE: Add Geo-Cluster w/ Datacenter.name: D2, ROLE: BOTH, UUID: 2901
{
"role" : "BOTH",
"uuid" : 2901,
"datacenter" : {
"name" : "D2"
},
"wss" : {
"server" : {
"hostname" : "127.0.0.1",
"ip" : "0.0.0.0",
"port" : 10201
}
},
"backend" : {
"server" : {
"hostname" : "localhost",
"ip" : "0.0.0.0",
"port" : 20201
}
},
"database" : {
"name" : "REDIS",
"ip" : "127.0.0.1",
"port" : 6001
},
"discovery" : {
"hostname" : "127.0.0.1",
"port" : 10101
}
}
NOTE: to add new nodes to DC2, follow STEP THREE