Can one host run three TiKV nodes?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 1台主机可以跑3个tikv节点吗?

| username: hacker_77powerful

Can one test machine run 3 TiKV nodes? Are you planning to make 3 replicas?

| username: kelvin | Original post link

Are you doing container deployment?

| username: changpeng75 | Original post link

Theoretically possible, but it loses the significance of having 3 replicas.

| username: lemonade010 | Original post link

Resource contention, high availability failure, test system can be used.

| username: DBAER | Original post link

The test environment is fine.

| username: hacker_77powerful | Original post link

I would like to ask, for this deployment, is it sufficient for the TiKV ports and directories to be different?
Or does it have to be deployed in containers?

| username: WinterLiu | Original post link

Just set different ports and directories.

| username: zhanggame1 | Original post link

Yes, you can also create 3 replicas. I’ll give you an official example, but it’s best to separate the disks physically, otherwise, it will be slower.

Reference: TiDB Quick Start Guide | PingCAP Documentation Center

# # Global variables are applied to all deployments and used as the default value of
# # the deployments if a specific deployment value is missing.
global:
 user: "tidb"
 ssh_port: 22
 deploy_dir: "/tidb-deploy"
 data_dir: "/tidb-data"

# # Monitored variables are applied to all the machines.
monitored:
 node_exporter_port: 9100
 blackbox_exporter_port: 9115

server_configs:
 tidb:
   instance.tidb_slow_log_threshold: 300
 tikv:
   readpool.storage.use-unified-pool: false
   readpool.coprocessor.use-unified-pool: true
 pd:
   replication.enable-placement-rules: true
   replication.location-labels: ["host"]
 tiflash:
   logger.level: "info"

pd_servers:
 - host: 127.0.0.1

tidb_servers:
 - host: 127.0.0.1

tikv_servers:
 - host: 127.0.0.1
   port: 20160
   status_port: 20180
   config:
     server.labels: { host: "logic-host-1" }

 - host: 127.0.0.1
   port: 20161
   status_port: 20181
   config:
     server.labels: { host: "logic-host-2" }

 - host: 127.0.0.1
   port: 20162
   status_port: 20182
   config:
     server.labels: { host: "logic-host-3" }

tiflash_servers:
 - host: 127.0.0.1

monitoring_servers:
 - host: 127.0.0.1

grafana_servers:
 - host: 127.0.0.1

I modified the official example, and it’s best to use 127.0.0.1 for the IP.

| username: zhaokede | Original post link

This way it can run. But high availability is not achieved, which makes it meaningless.

| username: zhaokede | Original post link

The single-node performance is even better.

| username: zhanggame1 | Original post link

To add, you need to set parameters to limit TiKV memory usage. If the memory is too small, don’t deploy it this way.

| username: TiDBer_QYr0vohO | Original post link

Sure, just add a label and change the port.

| username: hacker_77powerful | Original post link

Thank you, thank you.

| username: TiDBer_RjzUpGDL | Original post link

Sure, using different ports.

| username: 友利奈绪 | Original post link

Are they all put together for testing?

| username: 友利奈绪 | Original post link

It seems like no one officially does it this way.

| username: hacker_77powerful | Original post link

Just test it out. For example, if you have 3 hosts, each with 3 SSD disks, can’t you make 9 TiKV nodes?

| username: 小龙虾爱大龙虾 | Original post link

Remember to tag; not tagging may cause high availability issues.

| username: hacker_77powerful | Original post link

Okay, thank you for the reminder.

| username: madcoder | Original post link

Sure, what is the point of this?