Multi-node setup
Replication settings
The replication factor of a collection cannot be updated by updating the collection's definition.
From v1.32 by using replica movement, the replication factor of a shard can be changed.
Configure replication settings, such as async replication and deletion resolution strategy.
If a snippet doesn't work or you have feedback, please open a GitHub issue.
from weaviate.classes.config import Configure, ReplicationDeletionStrategy
client.collections.create(
"Article",
replication_config=Configure.replication(
factor=3,
async_enabled=True, # Enable asynchronous repair
deletion_strategy=ReplicationDeletionStrategy.TIME_BASED_RESOLUTION, # Added in v1.28; Set the deletion conflict resolution strategy
),
)
Additional information
To use replication factors greater than one, use a multi-node deployment.
For details on the configuration parameters, see the following:
Sharding settings
Configure sharding per collection.
If a snippet doesn't work or you have feedback, please open a GitHub issue.
from weaviate.classes.config import Configure
client.collections.create(
"Article",
sharding_config=Configure.sharding(
virtual_per_physical=128,
desired_count=1,
desired_virtual_count=128,
),
)
Additional information
For details on the configuration parameters, see the following:
Inspect shards (for a collection)
An index itself can be comprised of multiple shards.
If a snippet doesn't work or you have feedback, please open a GitHub issue.
articles = client.collections.use("Article")
article_shards = articles.config.get_shards()
print(article_shards)
Update shard status
You can manually update a shard to change it's status. For example, update the shard status from READONLY to READY after you make other changes.
If a snippet doesn't work or you have feedback, please open a GitHub issue.
articles = client.collections.use("Article")
article_shards = articles.config.update_shards(
status="READY",
shard_names=shard_names, # The names (List[str]) of the shard to update (or a shard name)
)
print(article_shards)
Further resources
Questions and feedback
If you have any questions or feedback, let us know in the user forum.
