在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):tikv/pd开源软件地址(OpenSource Url):https://github.com/tikv/pd开源编程语言(OpenSource Language):Go 99.3%开源软件介绍(OpenSource Introduction):PDPD is the abbreviation for Placement Driver. It is used to manage and schedule the TiKV cluster. PD supports distribution and fault-tolerance by embedding etcd. If you're interested in contributing to PD, see CONTRIBUTING.md. For more contributing information, please click on the contributor icon above. Build
UsageCommand flagsSingle Node with default portsYou can run # Set correct HostIP here.
export HostIP="192.168.199.105"
pd-server --name="pd" \
--data-dir="pd" \
--client-urls="http://${HostIP}:2379" \
--peer-urls="http://${HostIP}:2380" \
--log-file=pd.log Using curl http://${HostIP}:2379/pd/api/v1/members
{
"members": [
{
"name":"pd",
"member_id":"f62e88a6e81c149",
"peer_urls": [
"http://192.168.199.105:2380"
],
"client_urls": [
"http://192.168.199.105:2379"
]
}
]
} A better tool httpie is recommended: http http://${HostIP}: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: 673
Content-Type: application/json; charset=UTF-8
Date: Thu, 20 Feb 2020 09:49:42 GMT
{
"members": [
{
"client_urls": [
"http://192.168.199.105:2379"
],
"member_id": "f62e88a6e81c149",
"name": "pd",
"peer_urls": [
"http://192.168.199.105:2380"
]
}
]
} DockerYou can use the following command to build a PD image directly: docker build -t tikv/pd . Or you can also use following command to get PD from Docker hub: docker pull pingcap/pd Run a single node with Docker: # Set correct HostIP here.
export HostIP="192.168.199.105"
docker run -d -p 2379:2379 -p 2380:2380 --name pd tikv/pd \
--name="pd" \
--data-dir="pd" \
--client-urls="http://0.0.0.0:2379" \
--advertise-client-urls="http://${HostIP}:2379" \
--peer-urls="http://0.0.0.0:2380" \
--advertise-peer-urls="http://${HostIP}:2380" \
--log-file=pd.log ClusterAs a component of TiKV project, PD needs to run with TiKV to work. The cluster can also include TiDB to provide SQL services. You can refer Deploy a TiDB Cluster Using TiUP or TiDB in Kubernetes Documentation for detailed instructions to deploy a cluster. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论