-
Notifications
You must be signed in to change notification settings - Fork 834
change: separate distributor into api and service module #3112
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
Changes from 3 commits
056c79f
0a0c05f
739fdeb
2b01b3e
9b1d554
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,8 @@ const ( | |
Overrides string = "overrides" | ||
Server string = "server" | ||
Distributor string = "distributor" | ||
DistributorService string = "distributor-service" | ||
DistributorAPI string = "distributor-api" | ||
Ingester string = "ingester" | ||
Flusher string = "flusher" | ||
Querier string = "querier" | ||
|
@@ -150,7 +152,7 @@ func (t *Cortex) initOverrides() (serv services.Service, err error) { | |
return nil, err | ||
} | ||
|
||
func (t *Cortex) initDistributor() (serv services.Service, err error) { | ||
func (t *Cortex) initDistributorService() (serv services.Service, err error) { | ||
t.Cfg.Distributor.DistributorRing.ListenPort = t.Cfg.Server.GRPCListenPort | ||
|
||
// Check whether the distributor can join the distributors ring, which is | ||
|
@@ -163,9 +165,13 @@ func (t *Cortex) initDistributor() (serv services.Service, err error) { | |
return | ||
} | ||
|
||
return t.Distributor, nil | ||
} | ||
|
||
func (t *Cortex) initDistributorAPI() (serv services.Service, err error) { | ||
t.API.RegisterDistributor(t.Distributor, t.Cfg.Distributor) | ||
|
||
return t.Distributor, nil | ||
return nil, nil | ||
} | ||
|
||
func (t *Cortex) initQuerier() (serv services.Service, err error) { | ||
|
@@ -630,7 +636,9 @@ func (t *Cortex) setupModuleManager() error { | |
mm.RegisterModule(MemberlistKV, t.initMemberlistKV, modules.UserInvisibleModule) | ||
mm.RegisterModule(Ring, t.initRing, modules.UserInvisibleModule) | ||
mm.RegisterModule(Overrides, t.initOverrides, modules.UserInvisibleModule) | ||
mm.RegisterModule(Distributor, t.initDistributor) | ||
mm.RegisterModule(Distributor, nil) | ||
mm.RegisterModule(DistributorAPI, t.initDistributorAPI) | ||
mm.RegisterModule(DistributorService, t.initDistributorService) | ||
|
||
mm.RegisterModule(Store, t.initChunkStore, modules.UserInvisibleModule) | ||
mm.RegisterModule(DeleteRequestsStore, t.initDeleteRequestsStore, modules.UserInvisibleModule) | ||
mm.RegisterModule(Ingester, t.initIngester) | ||
|
@@ -650,24 +658,26 @@ func (t *Cortex) setupModuleManager() error { | |
|
||
// Add dependencies | ||
deps := map[string][]string{ | ||
API: {Server}, | ||
Ring: {API, RuntimeConfig, MemberlistKV}, | ||
Overrides: {RuntimeConfig}, | ||
Distributor: {Ring, API, Overrides}, | ||
Store: {Overrides, DeleteRequestsStore}, | ||
Ingester: {Overrides, Store, API, RuntimeConfig, MemberlistKV}, | ||
Flusher: {Store, API}, | ||
Querier: {Overrides, Distributor, Store, Ring, API, StoreQueryable, MemberlistKV}, | ||
StoreQueryable: {Overrides, Store}, | ||
QueryFrontend: {API, Overrides, DeleteRequestsStore}, | ||
TableManager: {API}, | ||
Ruler: {Overrides, Distributor, Store, StoreQueryable, RulerStorage}, | ||
Configs: {API}, | ||
AlertManager: {API}, | ||
Compactor: {API, MemberlistKV}, | ||
StoreGateway: {API, Overrides, MemberlistKV}, | ||
Purger: {Store, DeleteRequestsStore, API}, | ||
All: {QueryFrontend, Querier, Ingester, Distributor, TableManager, Purger, StoreGateway, Ruler}, | ||
API: {Server}, | ||
Ring: {API, RuntimeConfig, MemberlistKV}, | ||
Overrides: {RuntimeConfig}, | ||
Distributor: {DistributorService, DistributorAPI}, | ||
|
||
DistributorAPI: {DistributorService, API}, | ||
DistributorService: {Ring, Overrides}, | ||
Store: {Overrides, DeleteRequestsStore}, | ||
Ingester: {Overrides, Store, API, RuntimeConfig, MemberlistKV}, | ||
Flusher: {Store, API}, | ||
Querier: {Overrides, DistributorService, Store, Ring, API, StoreQueryable, MemberlistKV}, | ||
StoreQueryable: {Overrides, Store}, | ||
QueryFrontend: {API, Overrides, DeleteRequestsStore}, | ||
TableManager: {API}, | ||
Ruler: {Overrides, DistributorService, Store, StoreQueryable, RulerStorage}, | ||
Configs: {API}, | ||
AlertManager: {API}, | ||
Compactor: {API, MemberlistKV}, | ||
StoreGateway: {API, Overrides, MemberlistKV}, | ||
Purger: {Store, DeleteRequestsStore, API}, | ||
All: {QueryFrontend, Querier, Ingester, Distributor, TableManager, Purger, StoreGateway, Ruler}, | ||
} | ||
for mod, targets := range deps { | ||
if err := mm.AddDependency(mod, targets...); err != nil { | ||
|
Uh oh!
There was an error while loading. Please reload this page.