Couchbase indexes

Hello,
I have created an index with a replica and distributed the index on all index nodes. But I see that the index size is not evenly distributed. I see the index is occupying 90% od disk on 1 node and on other 0 bytes even though I specified num partitions 8 and all index nodes on index definition.

Thanks
Bhanu

index definition like below.

CREATE INDEX count_query ON ` (*****) WITH { “defer_build”:true, “nodes”:[ “node1.com:8091”,“node2.com:8091”,node3.com:8091",“node4.com:8091” ], “num_replica”:1, “num_partition”:8 }

@banumyname,

From your index definition, I do not see any partition by clause. So there will only be one partition. As “num_replica” is specified as “1”, there will be two indexes in the system. From the problem description, I understand that one index is using 90% of disk while the other index is not using any disk.

Which version of couchbase-server are you using? Can you kindly share the indexer logs from both the nodes where the indexes reside so that we can analyse the issue further

Thanks,
Varun

Hello Varun, thanks for replying back.

I am using partitioning by hash. I missed to post it while editing the details earlier.

PARTITION BY hash(entry_type) WHERE .

We are using couchbase 6.0.3

Thanks
Bhanu

It depends on values of entry_type. You can also try multiple keys PARTITION BY hash( entry_type , META().id)

Hi, It shouldnt matter on which key i am partitioning right ?

Even if i partition by different key, looks like it is still uneven. this causing the sizing constraints.

It shouldnt matter on which key i am partitioning right

It depends on your data distribution. If let’s say your entry_type has more documents on type “user”, then they all go to one partition and can result in larger data size.

Can you collect the partition level stats using curl -u <username:password> http://localhost:9102/stats?partition=true from each of the indexer nodes and share the details?

Thanks,
Varun