We have around 26 services total running in different ports. Sometimes when we run the java -jar discovery-registration.jar read to make sure the discovery service has the correct capabilities and has the proper deployer/content services, we don't get the values we expect. We then run java -jar discovery-registration.jar forceSync and java -jar discovery-registration.jar update. This resolves the issue for this group of services, but then another group of services get 'bumped' and when I run java -jar discovery-registration.jar read their deployer and content service are now assigned to the previous group. We have 3 groups of services (legacy, normal, and express) with 3 subgroups each (live, stage, preview), and each subgroup has 1 Discovery, 1 Content, and 1 Deployer-combined service.

.
├── express
│   ├── live
│   │   ├── content
│   │   ├── deployer-combined
│   │   └── discovery
│   ├── preview
│   │   ├── content
│   │   ├── deployer-combined
│   │   └── discovery
│   └── stage
│       ├── content
│       ├── deployer-combined
│       └── discovery
├── legacy
│   ├── live
│   │   ├── content
│   │   ├── deployer-combined
│   │   └── discovery
│   ├── preview
│   │   ├── content
│   │   ├── deployer-combined
│   │   └── discovery
│   └── stage
│       ├── content
│       ├── deployer-combined
│       └── discovery
└── normal
    ├── live
    │   ├── content
    │   ├── deployer-combined
    │   └── discovery
    ├── preview
    │   ├── content
    │   ├── deployer-combined
    │   └── discovery
    └── stage
        ├── content
        ├── deployer-combined
        └── discovery

Each group/subgroup has a different port prefix, and all services have the same port suffix. For example: normal-live-discovery - 8082 normal-live-deployer - 8000 normal-live-content - 8081 express-live-discovery - 9082 express-live-deployer - 9000 express-live-content - 9081 And so on.

$ java -jar discovery-registration.jar read
2018-08-09 18:09:53,435 INFO  Main - Registration tool is run with following parameters:
2018-08-09 18:09:53,438 INFO  Main - Configuration file:     cd_storage_conf.xml
2018-08-09 18:09:53,440 INFO  Main - The Command is:         read
2018-08-09 18:09:53,441 INFO  RegistrationTool - Reading configuration from file: 'cd_storage_conf.xml'
2018-08-09 18:09:53,725 INFO  ODataClientProvider - Creating OData client
2018-08-09 18:09:54,932 INFO  ODataClientProvider - Successfully created OData client
2018-08-09 18:09:54,932 INFO  ODataClientProvider - Creating token provider for OAuth enabled OData client
2018-08-09 18:09:54,933 INFO  ODataClientProvider - Using TokenServiceUrl http://10.1.1.8:8082/token.svc from configuration file.
2018-08-09 18:09:55,071 INFO  ODataClientProvider - Created token provider using TokenServiceUrl from configuration file.
2018-08-09 18:09:55,071 INFO  ODataClientProvider - Successfully created token provider for OAuth enabled OData client
2018-08-09 18:09:55,071 INFO  ReadCommand - Reading all existing Capabilities from discovery-service...
2018-08-09 18:09:55,559 INFO  Main - Result of tool execution is:
[ {
  "Capability" : "com.sdl.web.discovery.datalayer.model.ContentServiceCapability",
  "id" : "DefaultContentService",
  "lastUpdateTime" : 1528313552903,
  "uri" : "http://10.1.1.8:7081/content.svc".        <--- should be 8081
}, {
  "Capability" : "com.sdl.web.discovery.datalayer.model.DeployerCapability",
  "id" : "DefaultDeployer",
  "lastUpdateTime" : 1528313553001,
  "strategy" : "DEFAULT",
  "uri" : "http://10.1.1.8:7000/httpupload",         <-- should be 8000
  "extensionProperties" : [ "java.util.ArrayList", [ {
    "key" : "encoding",
    "value" : "UTF-8"
  }, {
    "key" : "undo.enabled",
    "value" : "false"
  } ] ]
}, {
  "Capability" : "com.sdl.web.discovery.datalayer.model.TokenServiceCapability",
  "id" : "DefaultTokenService",
  "lastUpdateTime" : 1528313519092,
  "uri" : "http://10.1.1.8:7082/token.svc".          <--- should be 8082
} ]

cd_storage_conf.xml

    <Roles>
        <Role Name="TokenServiceCapability" Url="http://10.1.1.8:8082/token.svc">
        </Role>
        <Role Name="WebCapability">
        </Role>
        <Role Name="DeployerCapability" Url="http://10.1.1.8:8000/httpupload">
        </Role>
        <Role Name="ContentServiceCapability" Url="http://10.1.1.8:8081/content.svc">
        </Role>
    </Roles>
</ConfigRepository>
  • For the environment you are explaining, it seems that you are using the same discovery database for all the groups, AFAIK, every discovery set of services, must have its own database. – Raúl Escudero Aug 10 at 6:56
  • Only for curiosity. Why are you setting up the "group" environments? which is the use of the legacy, express and normal groups? – Raúl Escudero Aug 10 at 7:24
  • They use different proprietary extensions and the data ends up in different staging environments. All express subgroups have a higher priority in the queue over the normal subgroup, but they all end up in equivalent staging environment – Arier Aug 10 at 14:28
up vote 6 down vote accepted

For the environment you are explaining, it seems that you are using the same discovery database for all the groups.

AFAIK all the discovery services, are part of a content delivery envireonment, and they need a diferent discovery database. If you are using the same discovery database for more than one delivery environment, when you update and register the microservices of one environment, you are overwriting ythe setup of the previous environment, as all the capabilities has the same name in all the environments.

I'm not sure if it is possible to share the same database, by changing the name of the capabilities for each environment, but i don't thimk so.

  • 1
    Each group-subgroup of services has their own set of databases, except for normal and express (for internal reasons): they share all their databases, including discovery. This must explain why when I ran the discovery-registration update tool in express, it would update the registration of the express discovery, but when I verified the 'normal' subgroup, all services were registered with the express discovery service. I'll create a test db for the express group-subgroup (this way each subgroup has their own discovery db), and I'll report back. Thanks! – Arier Aug 10 at 14:19

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.