MCPcopy
hub / github.com/dgraph-io/dgraph / init

Function init

dgraph/cmd/zero/run.go:57–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55var Zero x.SubCommand
56
57func init() {
58 Zero.Cmd = &cobra.Command{
59 Use: "zero",
60 Short: "Run Dgraph Zero management server ",
61 Long: `
62A Dgraph Zero instance manages the Dgraph cluster. Typically, a single Zero
63instance is sufficient for the cluster; however, one can run multiple Zero
64instances to achieve high-availability.
65`,
66 Run: func(cmd *cobra.Command, args []string) {
67 defer x.StartProfile(Zero.Conf).Stop()
68 run()
69 },
70 Annotations: map[string]string{"group": "core"},
71 }
72 Zero.EnvPrefix = "DGRAPH_ZERO"
73 Zero.Cmd.SetHelpTemplate(x.NonRootTemplate)
74
75 flag := Zero.Cmd.Flags()
76 x.FillCommonFlags(flag)
77 // --tls SuperFlag
78 x.RegisterServerTLSFlags(flag)
79
80 flag.IntP("port_offset", "o", 0,
81 "Value added to all listening port numbers. [Grpc=5080, HTTP=6080]")
82 flag.Int("replicas", 1, "How many Dgraph Alpha replicas to run per data shard group."+
83 " The count includes the original shard.")
84 flag.String("peer", "", "Address of another dgraphzero server.")
85 flag.StringP("wal", "w", "zw", "Directory storing WAL.")
86 flag.Duration("rebalance_interval", 8*time.Minute, "Interval for trying a predicate move.")
87 flag.String("enterprise_license", "", "(deprecated) Path to the enterprise license file.")
88 flag.String("cid", "", "Cluster ID")
89
90 flag.String("limit", worker.ZeroLimitsDefaults, z.NewSuperFlagHelp(worker.ZeroLimitsDefaults).
91 Head("Limit options").
92 Flag("uid-lease",
93 `The maximum number of UIDs that can be leased by namespace (except default namespace)
94 in an interval specified by refill-interval. Set it to 0 to remove limiting.`).
95 Flag("refill-interval",
96 "The interval after which the tokens for UID lease are replenished.").
97 Flag("disable-admin-http",
98 "Turn on/off the administrative endpoints exposed over Zero's HTTP port.").
99 String())
100
101 flag.String("raft", raftDefaults, z.NewSuperFlagHelp(raftDefaults).
102 Head("Raft options").
103 Flag("idx",
104 "Provides an optional Raft ID that this Alpha would use to join Raft groups.").
105 Flag("learner",
106 `Make this Zero a "learner" node. In learner mode, this Zero will not participate `+
107 "in Raft elections. This can be used to achieve a read-only replica.").
108 String())
109
110 flag.String("audit", worker.AuditDefaults, z.NewSuperFlagHelp(worker.AuditDefaults).
111 Head("Audit options").
112 Flag("output",
113 `[stdout, /path/to/dir] This specifies where audit logs should be output to.
114 "stdout" is for standard output. You can also specify the directory where audit logs

Callers

nothing calls this directly

Calls 6

StartProfileFunction · 0.92
FillCommonFlagsFunction · 0.92
RegisterServerTLSFlagsFunction · 0.92
runFunction · 0.70
StopMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected