我能够在一个节点(一台物理机)上部署多副本吗,如在一个节点部署 3 个 tidb,3 个 pd,3个 tikv ?
我使用 tidb operator 部署,一共 3 个 pd 只有一个 pod 正常 runnning,另外两个都报了 etcd 的错:
[main.go:288] [“run server failed”] [error=“[PD:etcd:ErrStartEtcd]member 10f0df000a58db81 has already been bootstrapped: member 10f0df000a58db81 has already been bootstrapped”] [stack=“main.start\n\t/workspace/source/pd/cmd/pd-server/main.go:288\nmain.createServerWrapper\n\t/workspace/source/pd/cmd/pd-server/main.go:194\ngithub.com/spf13/cobra.(*Command).execute\n\t/root/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/root/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115\ngithub.com/spf13/cobra.(*Command).Execute\n\t/root/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039\nmain.main\n\t/workspace/source/pd/cmd/pd-server/main.go:71\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:272”]
使用 operator 部署的话能够配置每个 pd 副本的 initial-cluster-state 吗?
更新:测试集群中有两个节点,我将 pd 的 replica 设置为2,可以看到两个 pd 的 pod 分别被schedule 到两个节点上了,并且分别挂载到各自的 pvc。
但是只有一个 pod 正常运行,另一个 pod 仍然报了相同的错误:
[INFO] [etcd.go:310] ["starting an etcd server"] [etcd-version=3.5.15] [git-sha="Not provided (use ./build instead of go build)"] [go-version=go1.23.12] [go-os=linux] [go-arch=amd64] [max-cpu-set=112] [max-cpu-available=112] [member-initialized=false] [name=tidb-pd-5j8zv2] [data-dir=/var/lib/pd] [wal-dir=] [wal-dir-dedicated=]
[member-dir=/var/lib/pd/member] [force-new-cluster=false] [heartbeat-interval=500ms] [election-timeout=3s] [initial-election-tick-advance=true] [snapshot-count=100000] [max-wals=5] [max-snapshots=5] [snapshot-catchup-entries=5000] [initial-advertise-peer-urls="[http://tidb-pd-pd-5j8zv2.tidb-pd-pd-peer.test:2380]"] [listen-peer-urls="[\"http://[::]:2380\"]"] [advertise-client-urls="[http://tidb-pd-pd-5j8zv2.tidb-pd-pd-peer.test:2379]"] [listen-client-urls="[\"http://[::]:2379\"]"] [listen-metrics-urls="[]"] [cors="[*]"] [host-whitelist="[*]"] [initial-cluster="tidb-pd-4jo1o5=http://tidb-pd-pd-4jo1o5.tidb-pd-pd-peer.test:2380,tidb-pd-5j8zv2=http://tidb-pd-pd-5j8zv2.tidb-pd-pd-peer.test:2380"] [initial-cluster-state=new] [initial-cluster-token=tidb-cluster] [quota-backend-bytes=8589934592] [max-request-bytes=157286400] [max-concurrent-streams=4294967295] [pre-vote=true] [initial-corrupt-check=false] [corrupt-check-time-interval=0s] [compact-check-time-enabled=false] [compact-check-time-interval=1m0s] [auto-compaction-mode=periodic] [auto-compaction-retention=1h0m0s] [auto-compaction-interval=1h0m0s] [discovery-url=] [discovery-proxy=] [downgrade-check-interval=5s]
[WARN] [server.go:344] ["exceeded recommended request limit"] [max-request-bytes=157286400] [max-request-size="157 MB"] [recommended-request-bytes=10485760] [recommended-request-size="10 MB"]
[INFO] [backend.go:81] ["opened backend db"] [path=/var/lib/pd/member/snap/db] [took=991.989µs]
[INFO] [etcd.go:377] ["closing etcd server"] [name=tidb-pd-5j8zv2] [data-dir=/var/lib/pd] [advertise-peer-urls="[http://tidb-pd-pd-5j8zv2.tidb-pd-pd-peer.test:2380]"] [advertise-client-urls="[http://tidb-pd-pd-5j8zv2.tidb-pd-pd-peer.test:2379]"]
[INFO] [etcd.go:379] ["closed etcd server"] [name=tidb-pd-5j8zv2] [data-dir=/var/lib/pd] [advertise-peer-urls="[http://tidb-pd-pd-5j8zv2.tidb-pd-pd-peer.test:2380]"] [advertise-client-urls="[http://tidb-pd-pd-5j8zv2.tidb-pd-pd-peer.test:2379]"]
[FATAL] [main.go:288] ["run server failed"] [error="[PD:etcd:ErrStartEtcd]member 74834717553fce0f has already been bootstrapped: member 74834717553fce0f has already been bootstrapped"] [stack="main.start\n\t/workspace/source/pd/cmd/pd-server/main.go:288\nmain.createServerWrapper\n\t/workspace/source/pd/cmd/pd-server/main.go:194\ngithub.com/spf13/cobra.(*Command).execute\n\t/root/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/root/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115\ngithub.com/spf13/cobra.(*Command).Execute\n\t/root/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039\nmain.main\n\t/workspace/source/pd/cmd/pd-server/main.go:71\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:272"]