tikv/pd
Fork: 719 Star: 1052 (更新于 2024-11-11 04:54:36)
license: Apache-2.0
Language: Go .
Placement driver for TiKV
最后发布版本: v7.5.4 ( 2024-10-15 15:53:56)
PD
PD is the abbreviation for Placement Driver. It manages and schedules TiKV clusters.
PD supports fault-tolerance by embedding etcd.
If you're interested in contributing to PD, see CONTRIBUTING.md. For more contributing information about where to start, click on the contributor icon above.
Build
- Make sure Go (version 1.23) is installed.
- Use
make
to install PD.pd-server
will be installed in thebin
directory.
Usage
PD can be configured using command-line flags. For more information, see PD Configuration Flags.
Single node with default ports
You 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.
# Set HOST_IP to the address you want to listen on
export HOST_IP="192.168.199.105"
pd-server --name="pd" \
--data-dir="pd" \
--client-urls="http://${HOST_IP}:2379" \
--peer-urls="http://${HOST_IP}:2380" \
--log-file=pd.log
Using curl
to view PD members:
curl http://${HOST_IP}:2379/pd/api/v1/members
{
"members": [
{
"name": "pd",
"member_id": 15980934438217023866,
"peer_urls": [
"http://192.168.199.105:2380"
],
"client_urls": [
"http://192.168.199.105:2379"
],
"deploy_path": "/",
"binary_version": "v6.1.3",
"git_hash": "1a4e975892512a97fb0e5b45c9be69aa76148793"
}
]
}
You can also use httpie to call the API:
http http://${HOST_IP}:2379/pd/api/v1/members
Access-Control-Allow-Headers: accept, content-type, authorization
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE
Access-Control-Allow-Origin: *
Content-Length: 1003
Content-Type: application/json; charset=UTF-8
Date: Mon, 12 Dec 2022 13:46:33 GMT
{
"members": [
{
"name": "pd",
"member_id": 15980934438217023866,
"peer_urls": [
"http://192.168.199.105:2380"
],
"client_urls": [
"http://192.168.199.105:2379"
],
"deploy_path": "/",
"binary_version": "v6.1.3",
"git_hash": "1a4e975892512a97fb0e5b45c9be69aa76148793"
}
]
}
Docker
You can choose one of the following methods to get a PD image:
-
Build locally:
docker build -t pingcap/pd .
-
Pull from Docker Hub:
docker pull pingcap/pd
Then you can run a single node using the following command:
# Set HOST_IP to the address you want to listen on
export HOST_IP="192.168.199.105"
docker run -d -p 2379:2379 -p 2380:2380 --name pd pingcap/pd \
--name="pd" \
--data-dir="pd" \
--client-urls="http://0.0.0.0:2379" \
--advertise-client-urls="http://${HOST_IP}:2379" \
--peer-urls="http://0.0.0.0:2380" \
--advertise-peer-urls="http://${HOST_IP}:2380" \
--log-file=pd.log
Cluster
As 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 or TiDB on Kubernetes Documentation.
最近版本更新:(数据更新于 2024-10-20 12:54:43)
2024-10-15 15:53:56 v7.5.4
2024-09-20 11:19:23 v6.5.11
2024-08-27 14:16:31 v8.1.1
2024-08-22 11:56:08 v8.3.0
2024-08-05 11:48:37 v7.5.3
2024-07-11 17:00:26 v8.2.0
2024-06-20 15:14:51 v6.5.10
2024-06-13 11:44:56 v7.5.2
2024-05-24 16:14:51 v8.1.0
2024-04-26 10:44:18 v7.1.5
主题(topics):
hacktoberfest
tikv/pd同语言 Go最近更新仓库
2024-11-21 13:50:50 XTLS/Xray-core
2024-11-21 06:27:30 ollama/ollama
2024-11-21 05:17:55 Melkeydev/go-blueprint
2024-11-21 04:04:03 dolthub/dolt
2024-11-21 01:52:15 SpecterOps/BloodHound
2024-11-20 13:48:10 1Panel-dev/1Panel