Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

With Swarm 16.1.2 and Gateway 8.1.0, we introduced a new feature called “Per Domain Index”. We can now store metadata from each domain in separate indices within our Elasticsearch database. This feature allows for more efficient searching, querying, and retrieval of objects within a specific domain. It is enabled by settingsearch.perDomainIndex=Truebefore creating a Search Feedsearch feed.

scsctl storage config set -d "search.perDomainIndex=true"

...

Data in Elasticsearch is organized into indices. Each index is made up of one or more shards. Each shard is an instance of a Lucene index, which you can think of as a self-contained search engine that indexes and handles queries for a subset of the data in an Elasticsearch cluster.

Key benefits of the Per Domain Index include:

  1. Improved Search Performance: By indexing objects within a domain, searches can be limited to the domain, reducing the search scope and speeding up retrieval.

  2. Granular Data Management: Each domain can have its own index, allowing administrators to manage indexing based on domain-specific needs.

  3. Scalability: As the number of objects grows, having separate indices for each domain helps in scaling the system without performance degradation.

...

With Per Domain Index (PDI), customers are separated by different domains and use distinct indices. As a result, the latency for each domain is directly related to the number of documents in its respective index, allowing for more efficient performance management.

Info

Note

This should only be enabled with Support guidance. The number of domains that the Swarm cluster supports, is limited due to limitations to the number of shards per Elasticsearch node.

Prerequisites

  • Gateway 8.1.0 or higher

  • Swarm Storage 16.1.2 or higher

Hardware Sizing

  • Shard Size: Recommended shard size between 20 GB and 50 GB.

  • Shard Alignment: Align the number of shards with the number of nodes (shards should be a multiple of nodes).

  • Heap Size: Maximum heap size of 30.5 GB per node.

  • Shard Capacity: A node can handle up to 30.5 GB heap * 20 shards per GB of heap, resulting in a maximum of approximately 600 shards per node.

  • Elastic Limit: Elasticsearch has a default maximum shard limit of 1,000 per node. It is advisable to stay below 600 shards per node for optimal performance.

...

  1. Keep the new search feed index at 100% after PDI is enabled: When enabling PDI, a new set of indices is created, each corresponding to a specific domain. The new search feed means data being indexed with the new search feed targeting particular ES nodes. The new indices need to be fully populated (100%) before switching to them. This means that all documents should be indexed without any gaps or missing data.
    Implementation Steps:

    1. Enable PDI in the Cluster settings.

    2. Create a new search feed based on predefined templates or configurations.

    3. Reindex all existing documents from scratch, non-PDI index will also be available if not deleted.

    4. Monitor the progress of the reindexing process until all indices reflect 100% of the expected documents.

  2. Once completed, set the new search feed as the default: When the search feed is 100%, make it as default. Now, now the cluster should be able is ready to list as per PDI. This switch should be seamless to ensure that users experience no disruption.

    • Implementation Steps:

      1. Confirm the search feed is 100%.

      2. Update the default search feed to the new PDI-enabled search feed.

      3. Conduct the test to verify that the Per Domain Index is visible in the Elasticsearch nodes.

  3. Clean up the previous index (created without PDI) as needed: The old index , which stored data without per-domain segregation, is now redundant. Cleaning it up can free up resources and reduce storage costs.

    • Implementation Steps:

      1. Verify that the new indices are performing correctly and no issues exist.

      2. Delete the old index to remove unnecessary data.

...

  1. Set the new search feed as the default after enabling PDI: If downtime is acceptable, the process is simpler. You can immediately switch to the new search feed after enabling PDI, even if they aren’t are not fully populated. Users will experience downtime or incomplete search results until reindexing is complete.
    Implementation Steps:

    1. Enable PDI and create a new domain-specific search feed.

    2. Immediately update the search configuration to use these the new indicessearch feed.

    3. Reindex documents into the new indices while search may be temporarily affected.

  2. The new index will be temporarily unavailable for listing: During reindexing, the new domain indices may not be fully operational. Users may experience missing or incomplete data in search results.
    Implementation Steps:

    1. Inform users about the planned downtime and potential service disruption.

    2. Monitor the reindexing process to track progress and identify any issues.

  3. Listing will resume after the new search feed reaches 100% completion: Once the reindexing is complete, the search functionality will return to full capacity with complete and accurate listings.
    Implementation Steps:

    1. Monitor reindexing progress and ensure that verify all expected documents are indexed.

    2. Conduct validation checks to ensure data integrity and accuracy.

    3. Notify users when the service is fully restored.

...

  1. Set search.perDomainIndex = False and delete the associated Search Feed: To disable PDI, switch the configuration setting that enables it (search.perDomainIndex) to False. This setting controls whether the system should use per-domain indices or not. After disabling, delete all per-domain search feeds to consolidate data back into a single index.
    Implementation Steps:

    1. Set the configuration search.perDomainIndex to False in your application or search engine settings.

    2. Delete the Per Domain search feed as they are no longer needed.

  2. All Per Domain Indices will be removed, leaving a single index operational: After disabling PDI, the system will revert to using a single index for all domains. This simplifies data management but loses the benefits of domain-specific indexing.

  3. The number of shards will remain unchanged, so there won’t be any issues with single indexing: The shard count configuration is typically set at the cluster level and doesn’t does not change when switching from PDI to a single index. This ensures that the system’s capacity for handling search queries remains stable.
    Implementation Steps:

    1. Review the shard configuration of your search engine to confirm it is optimal for a single index.

    2. Adjust the shard count if necessary to balance performance and resource usage.

...