mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-19 03:06:26 +00:00
docs
This commit is contained in:
parent
1b0908fab2
commit
61d89bd118
@ -19,6 +19,12 @@ To initialize a database run:
|
||||
|
||||
Then type '.quit' to exit the SQLite3 command shell.
|
||||
|
||||
Since SQLite3 supports multiple concurrent processes attached to the same database, it's easy to have another process administrate network details while the ZeroTier One service serves them. The schema is simple. Folks with some sysadmin expertise should be able to figure out how to populate a database and get something running. We'll probably publish some code for this at some point in the future, but for now it's all tied up with our zerotier.com web backend.
|
||||
|
||||
One important detail you'll need to know:
|
||||
|
||||
Whenever a network (including associated tables) is changed in any way, its revision number must be incremented. For private networks this is part of the certificate. Certificates are permitted to differ by up to 16 revisions. Therefore, to explicitly and rapidly de-authorize someone you should do a *two-step increment*. This is done with a time delay. First de-authorize the user and increment the revision by one. Then wait 30-60 seconds and increment it by 15. This gives all running clients a chance to get updated certificates before the now-excluded node falls off the revision number horizon. All other changes need only increment once, since a few nodes briefly having a slightly out of date config won't cause any harm.
|
||||
|
||||
### Reliability
|
||||
|
||||
Network configuration masters can go offline without affecting already-configured members of running networks. You just won't be able to add new members, de-authorize members, or otherwise change any network configuration while the master is offline.
|
||||
|
@ -42,6 +42,11 @@
|
||||
#include "../node/CertificateOfMembership.hpp"
|
||||
#include "../node/NetworkConfig.hpp"
|
||||
|
||||
// Stored in database as schemaVersion key in Config.
|
||||
// If not present, database is assumed to be empty and at the current schema version
|
||||
// and this key/value is added automatically.
|
||||
#define ZT_NETCONF_SQLITE_SCHEMA_VERSION 1
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
SqliteNetworkConfigMaster::SqliteNetworkConfigMaster(const Identity &signingId,const char *dbPath) :
|
||||
|
@ -10,11 +10,11 @@ CREATE TABLE IpAssignment (
|
||||
ipNetmaskBits integer(4) NOT NULL DEFAULT(0)
|
||||
);
|
||||
|
||||
CREATE INDEX IpAssignment_networkId ON IpAssignment (networkId);
|
||||
CREATE UNIQUE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);
|
||||
|
||||
CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);
|
||||
|
||||
CREATE UNIQUE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);
|
||||
CREATE INDEX IpAssignment_networkId ON IpAssignment (networkId);
|
||||
|
||||
CREATE TABLE IpAssignmentPool (
|
||||
networkId char(16) NOT NULL,
|
||||
@ -36,9 +36,20 @@ CREATE TABLE Member (
|
||||
activeBridge integer(1) NOT NULL DEFAULT(0)
|
||||
);
|
||||
|
||||
CREATE INDEX Member_networkId ON Member (networkId);
|
||||
|
||||
CREATE UNIQUE INDEX Member_networkId_nodeId ON Member (networkId, nodeId);
|
||||
|
||||
CREATE INDEX Member_networkId ON Member (networkId ASC);
|
||||
CREATE TABLE MulticastRate (
|
||||
networkId char(16) NOT NULL,
|
||||
mgMac char(12) NOT NULL,
|
||||
mgAdi integer(8) NOT NULL DEFAULT(0),
|
||||
preload integer(16) NOT NULL,
|
||||
maxBalance integer(16) NOT NULL,
|
||||
accrual integer(16) NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX MulticastRate_networkId ON MulticastRate (networkId);
|
||||
|
||||
CREATE TABLE Network (
|
||||
id char(16) PRIMARY KEY NOT NULL,
|
||||
|
Loading…
Reference in New Issue
Block a user