{"id":13615902,"url":"https://github.com/tikv/pd","last_synced_at":"2026-01-16T15:56:31.567Z","repository":{"id":36952631,"uuid":"53311716","full_name":"tikv/pd","owner":"tikv","description":"Placement driver for TiKV","archived":false,"fork":false,"pushed_at":"2025-05-08T07:24:20.000Z","size":91506,"stargazers_count":1090,"open_issues_count":570,"forks_count":730,"subscribers_count":86,"default_branch":"master","last_synced_at":"2025-05-08T20:54:50.049Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tikv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-03-07T09:13:06.000Z","updated_at":"2025-05-08T07:24:25.000Z","dependencies_parsed_at":"2024-01-17T11:37:33.883Z","dependency_job_id":"ec65e0f8-3af0-42d6-b154-6a3d7e7e0d9c","html_url":"https://github.com/tikv/pd","commit_stats":{"total_commits":3957,"total_committers":213,"mean_commits":"18.577464788732396","dds":0.8117260550922416,"last_synced_commit":"a929a546a790222299b556e449816e622288a5d1"},"previous_names":["pingcap/pd"],"tags_count":265,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tikv","download_url":"https://codeload.github.com/tikv/pd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253155580,"owners_count":21862724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-08-01T20:01:20.188Z","updated_at":"2026-01-16T15:56:31.517Z","avatar_url":"https://github.com/tikv.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# PD\n\n[![Check Status](https://github.com/tikv/pd/actions/workflows/check.yaml/badge.svg)](https://github.com/tikv/pd/actions/workflows/check.yaml)\n[![Build \u0026 Test Status](https://github.com/tikv/pd/actions/workflows/pd-tests.yaml/badge.svg?branch=master)](https://github.com/tikv/pd/actions/workflows/pd-tests.yaml)\n[![GitHub release](https://img.shields.io/github/release/tikv/pd.svg)](https://github.com/tikv/pd/releases)\n[![Go Report Card](https://goreportcard.com/badge/github.com/tikv/pd)](https://goreportcard.com/report/github.com/tikv/pd)\n[![codecov](https://codecov.io/gh/tikv/pd/branch/master/graph/badge.svg)](https://codecov.io/gh/tikv/pd)\n\nPD is the abbreviation for Placement Driver. It manages and schedules [TiKV](https://github.com/tikv/tikv) clusters.\n\nPD supports fault-tolerance by embedding [etcd](https://github.com/etcd-io/etcd).\n\n[\u003cimg src=\"docs/contribution-map.png\" alt=\"contribution-map\" width=\"180\"/\u003e](https://github.com/pingcap/tidb-map/blob/master/maps/contribution-map.md#pd-placement-driver-for-tikv)\n\nIf you're interested in contributing to PD, see [CONTRIBUTING.md](./CONTRIBUTING.md). For more contributing information about where to start, click on the contributor icon above.\n\n## Build\n\n1. Make sure [*Go*](https://golang.org/) (version 1.23) is installed.\n2. Use `make` to install PD. `pd-server` will be installed in the `bin` directory.\n\n## Usage\n\nPD can be configured using command-line flags. For more information, see [PD Configuration Flags](https://docs.pingcap.com/tidb/stable/command-line-flags-for-pd-configuration).\n\n### Single node with default ports\n\nYou can run `pd-server` directly on your local machine. If you want to connect to PD from outside, you can let PD listen on the host IP.\n\n```bash\n# Set HOST_IP to the address you want to listen on\nexport HOST_IP=\"192.168.199.105\"\n\npd-server --name=\"pd\" \\\n          --data-dir=\"pd\" \\\n          --client-urls=\"http://${HOST_IP}:2379\" \\\n          --peer-urls=\"http://${HOST_IP}:2380\" \\\n          --log-file=pd.log\n```\n\nUsing `curl` to view PD members:\n\n```bash\ncurl http://${HOST_IP}:2379/pd/api/v1/members\n\n{\n  \"members\": [\n    {\n      \"name\": \"pd\",\n      \"member_id\": 15980934438217023866,\n      \"peer_urls\": [\n        \"http://192.168.199.105:2380\"\n      ],\n      \"client_urls\": [\n        \"http://192.168.199.105:2379\"\n      ],\n      \"deploy_path\": \"/\",\n      \"binary_version\": \"v6.1.3\",\n      \"git_hash\": \"1a4e975892512a97fb0e5b45c9be69aa76148793\"\n    }\n  ]\n}\n```\n\nYou can also use [httpie](https://github.com/jkbrzt/httpie) to call the API:\n\n```bash\nhttp http://${HOST_IP}:2379/pd/api/v1/members\n\nAccess-Control-Allow-Headers: accept, content-type, authorization\nAccess-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE\nAccess-Control-Allow-Origin: *\nContent-Length: 1003\nContent-Type: application/json; charset=UTF-8\nDate: Mon, 12 Dec 2022 13:46:33 GMT\n\n{\n  \"members\": [\n    {\n      \"name\": \"pd\",\n      \"member_id\": 15980934438217023866,\n      \"peer_urls\": [\n        \"http://192.168.199.105:2380\"\n      ],\n      \"client_urls\": [\n        \"http://192.168.199.105:2379\"\n      ],\n      \"deploy_path\": \"/\",\n      \"binary_version\": \"v6.1.3\",\n      \"git_hash\": \"1a4e975892512a97fb0e5b45c9be69aa76148793\"\n    }\n  ]\n}\n```\n\n### Docker\n\nYou can choose one of the following methods to get a PD image:\n\n- Build locally:\n\n    ```bash\n    docker build -t pingcap/pd .\n    ```\n\n- Pull from Docker Hub:\n\n    ```bash\n    docker pull pingcap/pd\n    ```\n\nThen you can run a single node using the following command:\n\n```bash\n# Set HOST_IP to the address you want to listen on\nexport HOST_IP=\"192.168.199.105\"\n\ndocker run -d -p 2379:2379 -p 2380:2380 --name pd pingcap/pd \\\n          --name=\"pd\" \\\n          --data-dir=\"pd\" \\\n          --client-urls=\"http://0.0.0.0:2379\" \\\n          --advertise-client-urls=\"http://${HOST_IP}:2379\" \\\n          --peer-urls=\"http://0.0.0.0:2380\" \\\n          --advertise-peer-urls=\"http://${HOST_IP}:2380\" \\\n          --log-file=pd.log\n```\n\n### Cluster\n\nAs a component of the TiKV project, PD needs to run with TiKV to work. The cluster can also include TiDB to provide SQL services. For detailed instructions to deploy a cluster, refer to [Deploy a TiDB Cluster Using TiUP](https://docs.pingcap.com/tidb/stable/production-deployment-using-tiup) or [TiDB on Kubernetes Documentation](https://docs.pingcap.com/tidb-in-kubernetes/stable).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikv%2Fpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftikv%2Fpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikv%2Fpd/lists"}