Placement driver for TiKV
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.
make (equivalent to make build) to build PD. pd-server, pd-ctl, and pd-recover will be produced in the bin directory.PD can be configured using command-line flags. For more information, see PD Configuration Flags.
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.logUsing curl to view PD members:
…You can also use httpie to call the API:
…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/pdThen 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.logAs 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.
No open issues yet, or sync has not completed.