# Replication config in class schema

**URL:** <https://forum.weaviate.io/t/replication-config-in-class-schema/1408>\
**Category:** Support\
**Created:** [February 7, 2024, 9:07am UTC](https://forum.weaviate.io/t/replication-config-in-class-schema/1408 "2024-02-07T09:07:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lawrence\_Hope](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/lawrence_hope/32/926_2.png) [@Lawrence\_Hope](https://forum.weaviate.io/u/Lawrence_Hope)\
**Post date:** [February 7, 2024, 9:07am UTC](https://forum.weaviate.io/t/replication-config-in-class-schema/1408/1 "2024-02-07T09:07:28Z")

</div>

### Description

Following code works only when I comment out the replication factor = 3 part. When I turn on the replication, the error message is – UnexpectedStatusCodeError: Collection may not have been created properly.! Unexpected status code: 422, with response body: {‘error’: [{‘message’: ‘init sharding state: not enough replicas: found 1 want 3’}]}.

We did successfully setup 3 node weaviate server in docker compose. Why there is a sharding involved? and is there anything we missed in configuration?

* * *

client.connect()

client.collections.delete(“GptLists”)

GptsVectors = client.collections.create(  
name=“GptLists”,  
# Not working yet  
# replication\_config=wvc.Configure.replication(  
# factor=3  
# ),  
vectorizer\_config=wvc.Configure.Vectorizer.text2vec\_openai(  
model=“text-embedding-3-small”,  
),  
generative\_config=wvc.Configure.Generative.openai(),  
inverted\_index\_config=wvc.Configure.inverted\_index(  
index\_property\_length=True  
),  
vector\_index\_config=wvc.Configure.VectorIndex.hnsw(),  
properties=[  
wvc.Property(name=“title”, data\_type=wvc.DataType.TEXT),  
wvc.Property(name=“description”, data\_type=wvc.DataType.TEXT),  
wvc.Property(name=“prompt\_starters”, data\_type=wvc.DataType.TEXT\_ARRAY),  
wvc.Property(name=“welcome\_message”, data\_type=wvc.DataType.TEXT),  
wvc.Property(name=“categories”, data\_type=wvc.DataType.TEXT, skip\_vectorization=True),  
wvc.Property(name=“language”, data\_type=wvc.DataType.TEXT, skip\_vectorization=True),  
wvc.Property(name=“conversations”, data\_type=wvc.DataType.INT, skip\_vectorization=True),  
],  
)

### Server Setup Information

- Weaviate Version: 1.23.7
- Deployment Method:   
Docker Compose
- Multi Node? Number of Running Nodes:  
3 Node
- Used Client Language and Version:  
Python Client V4

### Any additional Information

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [February 7, 2024, 7:39pm UTC](https://forum.weaviate.io/t/replication-config-in-class-schema/1408/2 "2024-02-07T19:39:49Z")

</div>

Hi @Lawrence_Hope ! Welcome to our community!

Can you make sure you see all 3 nodes in your endpoint:  
[http://localhost:8080/v1/nodes](http://localhost:8080/v1/nodes)

Looks like it may not be findinf the other 2 classes, given the error message.

---

<div class="post-metadata">

**Author:** ![Lawrence\_Hope](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/lawrence_hope/32/926_2.png) [@Lawrence\_Hope](https://forum.weaviate.io/u/Lawrence_Hope)\
**Post date:** [February 7, 2024, 8:56pm UTC](https://forum.weaviate.io/t/replication-config-in-class-schema/1408/3 "2024-02-07T20:56:30Z")

</div>

## This is what I have in response, looks like only see one node. {“nodes”:[{“batchStats”:{“queueLength”:0,“ratePerSecond”:0},“gitHash”:“d5c2694”,“name”:“weaviate1”,“shards”:null,“stats”:{“objectCount”:0,“shardCount”:1},“status”:“HEALTHY”,“version”:“1.23.7”}]} 200

In the docker-compose file and the log output from weaviate, we did see THREE nodes running up in the SAME IP in SAME machine. But at different port. Here is the abbreviated docker compose:

weaviate-1:  
command:  
- --host  
- 0.0.0.0  
- --port  
- ‘8080’  
- --scheme  
- http  
image: semitechnologies/weaviate:1.23.7  
init: true  
ports:  
- 8080:8080  
- 50051:50051  
CLUSTER\_HOSTNAME: ‘weaviate1’  
CLUSTER\_GOSSIP\_BIND\_PORT: ‘7100’  
CLUSTER\_DATA\_BIND\_PORT: ‘7101’

## weaviate-2: command: - --host - 0.0.0.0 - --port - ‘8080’ - --scheme - http image: semitechnologies/weaviate:1.23.7 init: true ports: - 8081:8080 - 50052:50051 CLUSTER\_HOSTNAME: ‘weaviate2’ CLUSTER\_GOSSIP\_BIND\_PORT: ‘7102’ CLUSTER\_DATA\_BIND\_PORT: ‘7103’ CLUSTER\_JOIN: ‘weaviate-node-1:7100’ weaviate-3: command: - --host - 0.0.0.0 - --port - ‘8080’ - --scheme - http image: semitechnologies/weaviate:1.23.7 init: true ports: - 8082:8080 - 50053:50051 CLUSTER\_HOSTNAME: ‘weaviate3’ CLUSTER\_GOSSIP\_BIND\_PORT: ‘7104’ CLUSTER\_DATA\_BIND\_PORT: ‘7105’ CLUSTER\_JOIN: ‘weaviate-node-1:7100’

## By using 8081 and 8082 too. We got this output: {“nodes”:[{“batchStats”:{“queueLength”:0,“ratePerSecond”:0},“gitHash”:“d5c2694”,“name”:“weaviate1”,“shards”:null,“stats”:{“objectCount”:0,“shardCount”:1},“status”:“HEALTHY”,“version”:“1.23.7”}]} 200 {“nodes”:[{“batchStats”:{“queueLength”:0,“ratePerSecond”:0},“gitHash”:“d5c2694”,“name”:“weaviate2”,“shards”:null,“stats”:{“objectCount”:0,“shardCount”:0},“status”:“HEALTHY”,“version”:“1.23.7”}]} 200 {“nodes”:[{“batchStats”:{“queueLength”:0,“ratePerSecond”:0},“gitHash”:“d5c2694”,“name”:“weaviate3”,“shards”:null,“stats”:{“objectCount”:0,“shardCount”:0},“status”:“HEALTHY”,“version”:“1.23.7”}]} 200

I think we are closed to find out true reasons. 😉

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [February 7, 2024, 9:22pm UTC](https://forum.weaviate.io/t/replication-config-in-class-schema/1408/4 "2024-02-07T21:22:45Z")

</div>

That seems to be the issue.

Your **weaviate-1** server is not aware of the other nodes.

Probably you can see some logs on that on the other clusters.

Can you change `CLUSTER_JOIN`on the other containers should point to be like:

## CLUSTER\_JOIN: ‘weaviate-1:7100’

this should be the same name for your weaviate-1 service.

Let me know if this helps.

---

<div class="post-metadata">

**Author:** ![Lawrence\_Hope](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/lawrence_hope/32/926_2.png) [@Lawrence\_Hope](https://forum.weaviate.io/u/Lawrence_Hope)\
**Post date:** [February 8, 2024, 6:49am UTC](https://forum.weaviate.io/t/replication-config-in-class-schema/1408/5 "2024-02-08T06:49:56Z")

</div>

It works!!! 🤩 Thank you so much.

And the output now is good and found 3 replicates: weaviate-1-1 | time=“2024-02-08T06:47:23Z” level=debug msg=“shard=ATQ75mAl0dOa is ready” action=startup  
weaviate-1-1 | time=“2024-02-08T06:47:23Z” level=info msg=“Created shard gptlists\_ATQ75mAl0dOa in 1.803349ms”  
weaviate-1-1 | time=“2024-02-08T06:47:23Z” level=debug msg=“shard=bVpE1J0RJv8L is ready” action=startup  
weaviate-1-1 | time=“2024-02-08T06:47:23Z” level=debug msg=“shard=ATQ75mAl0dOa is ready” action=startup  
weaviate-1-1 | time=“2024-02-08T06:47:23Z” level=debug msg=“shard=KTUzZd8b6Y23 is ready” action=startup  
weaviate-1-1 | time=“2024-02-08T06:47:23Z” level=debug msg=“prefilled level in vector cache” action=hnsw\_vector\_cache\_prefill\_level count=0 hnsw\_level=0 index\_id=main took=“83.773µs”  
weaviate-1-1 | time=“2024-02-08T06:47:23Z” level=info msg=“prefilled vector cache” action=hnsw\_vector\_cache\_prefill count=1000 index\_id=main limit=1000000000000 took=“141.915µs”  
weaviate-1-1 | time=“2024-02-08T06:47:23Z” level=debug msg=“received HTTP request” action=restapi\_request method=GET url=/v1/schema/GptLists  
weaviate-2-1 | time=“2024-02-08T06:47:34Z” level=debug msg=" memberlist: Initiating push/pull sync with: weaviate3 172.21.0.6:7104"  
weaviate-3-1 | time=“2024-02-08T06:47:34Z” level=debug msg=" memberlist: Stream connection from=172.21.0.7:43294"  
weaviate-3-1 | time=“2024-02-08T06:47:49Z” level=debug msg=" memberlist: Initiating push/pull sync with: weaviate2 172.21.0.7:7102"  
weaviate-2-1 | time=“2024-02-08T06:47:49Z” level=debug msg=" memberlist: Stream connection from=172.21.0.6:35250"  
weaviate-1-1 | time=“2024-02-08T06:47:51Z” level=debug msg=" memberlist: Initiating push/pull sync with: weaviate3 172.21.0.6:7104"  
weaviate-3-1 | time=“2024-02-08T06:47:51Z” level=debug msg=" memberlist: Stream connection from=172.21.0.4:38106"  
weaviate-3-1 | time=“2024-02-08T06:48:04Z” level=debug msg=" memberlist: Stream connection from=172.21.0.7:33010"  
weaviate-2-1 | time=“2024-02-08T06:48:04Z” level=debug msg=" memberlist: Initiating push/pull sync with: weaviate3 172.21.0.6:7104"  
weaviate-3-1 | time=“2024-02-08T06:48:19Z” level=debug msg=" memberlist: Initiating push/pull sync with: weaviate2 172.21.0.7:7102"  
weaviate-2-1 | time=“2024-02-08T06:48:19Z” level=debug msg=" memberlist: Stream connection from=172.21.0.6:42494"  
weaviate-3-1 | time=“2024-02-08T06:48:21Z” level=debug msg=" memberlist: Stream connection from=172.21.0.4:33954"  
weaviate-1-1 | time=“2024-02-08T06:48:21Z” level=debug msg=" memberlist: Initiating push/pull sync with: weaviate3 172.21.0.6:7104"  
weaviate-2-1 | time=“2024-02-08T06:48:34Z” level=debug msg=" memberlist: Initiating push/pull sync with: weaviate1 172.21.0.4:7100"  
weaviate-1-1 | time=“2024-02-08T06:48:34Z” level=debug msg=" memberlist: Stream connection from=172.21.0.7:42088"
