client-py icon indicating copy to clipboard operation
client-py copied to clipboard

cannnot connect to PD on k8s from local.

Open swapnil-raj opened this issue 3 years ago • 1 comments

I have deployed tikv on my k8s cluster using tidb operator. when i port forward basic-pd:2379 service to my local and try to connect to it using python client. i am using client = TransactionClient.connect(["127.0.0.1:2379"]) to connect to PD, which gives error:

Exception: [/root/.cargo/git/checkouts/client-rust-5a1ccd35a54db20f/eb1d2da/tikv-client-pd/src/cluster.rs:264]: failed to connect to [Member { name: "basic-pd-0", member_id: 15548971879676424159, peer_urls: ["http://basic-pd-0.basic-pd-peer.tikv.svc:2380/"], client_urls: ["http://basic-pd-0.basic-pd-peer.tikv.svc:2379/"], leader_priority: 0, deploy_path: "", binary_version: "", git_hash: "", dc_location: ""

I think its advertising its service url and that is obviously not accessible from my local. Although if i exec to any pod on my k8s cluster i am able to connect to tikv. Any idea on how can i connect from my local to tikv?

swapnil-raj avatar Jun 21 '22 09:06 swapnil-raj

Use mirrord.

caniko avatar Jun 24 '24 10:06 caniko