diff options
author | Xuanwo | 2018-10-22 23:59:08 +0800 |
---|---|---|
committer | Xuanwo | 2018-10-22 23:59:08 +0800 |
commit | 8745a77aa4f224e0054c6018463176d8ca3744fd (patch) | |
tree | 210a40b7de86ad52a7f0ca9fce5939be4b4b7075 | |
download | aur-8745a77aa4f224e0054c6018463176d8ca3744fd.tar.gz |
Add tikv-pd
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | PKGBUILD | 61 | ||||
-rw-r--r-- | pd-sysusers.conf | 1 | ||||
-rw-r--r-- | pd.service | 20 | ||||
-rw-r--r-- | pd.toml | 91 |
6 files changed, 196 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..3d84f8763338 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = tikv-pd + pkgdesc = Manage and schedule the TiKV cluster. + pkgver = 2.0.5 + pkgrel = 1 + url = https://github.com/pingcap/pd + arch = x86_64 + license = Apache + makedepends = go + makedepends = make + provides = pd-server + backup = etc/pd/pd.toml + source = pd-2.0.5.tar.gz::https://github.com/pingcap/pd/archive/v2.0.5.tar.gz + source = pd.service + source = pd-sysusers.conf + source = pd.toml + sha256sums = 4f3d267aa0c34828aea8b4797a02041efa32e81cda2c72d51e0b1f5bafab858b + sha256sums = 3b540c0cc468816b3be2d8d271f5649c836860c1e2eddfa7c043880bef226917 + sha256sums = 5edd250ba9e70a4f8d27581ed658f0fbfeca58ca62429dec12bb5fffc0919b67 + sha256sums = 14d8031f7d5d071e99dd3291c966d246c89a852b9c54a889d83b7c01421a45fc + +pkgname = tikv-pd + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..335ec9573de5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.tar.gz diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..712b4485cdcb --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,61 @@ +# Maintainer: Xuanwo <xuanwo@archlinuxcn.org> +pkgname=tikv-pd +pkgver=2.0.5 +pkgrel=1 +pkgdesc='Manage and schedule the TiKV cluster.' +makedepends=('go' 'make') +arch=('x86_64') +url='https://github.com/pingcap/pd' +license=('Apache') +provides=('pd-server') +backup=(etc/pd/pd.toml) +source=(pd-${pkgver}.tar.gz::https://github.com/pingcap/pd/archive/v${pkgver}.tar.gz + pd.service + pd-sysusers.conf + pd.toml) +sha256sums=('4f3d267aa0c34828aea8b4797a02041efa32e81cda2c72d51e0b1f5bafab858b' + '3b540c0cc468816b3be2d8d271f5649c836860c1e2eddfa7c043880bef226917' + '5edd250ba9e70a4f8d27581ed658f0fbfeca58ca62429dec12bb5fffc0919b67' + '14d8031f7d5d071e99dd3291c966d246c89a852b9c54a889d83b7c01421a45fc') + +_gopkgname='github.com/pingcap/pd' + +prepare() { + export GOPATH="$srcdir/build" + rm -rf "$GOPATH/src/$_gopkgname" + mkdir -p `dirname "$GOPATH/src/$_gopkgname"` + mv -Tv "$srcdir/pd-${pkgver}" "$GOPATH/src/$_gopkgname" +} + +build() { + export GOPATH="$srcdir/build" + export PATH=$GOPATH/bin:$PATH + export CGO_ENABLED=0 + + cd $GOPATH/src/$_gopkgname + + go build -o bin/pd-server cmd/pd-server/main.go + go build -o bin/pd-ctl cmd/pd-ctl/main.go + go build -o bin/pd-tso-bench cmd/pd-tso-bench/main.go + go build -o bin/pd-recover cmd/pd-recover/main.go + +} + +package() { + # Install binary + install -Dm755 "$srcdir/build/src/$_gopkgname/bin/pd-server" "$pkgdir/usr/bin/pd-server" + install -Dm755 "$srcdir/build/src/$_gopkgname/bin/pd-ctl" "$pkgdir/usr/bin/pd-ctl" + install -Dm755 "$srcdir/build/src/$_gopkgname/bin/pd-tso-bench" "$pkgdir/usr/bin/pd-tso-bench" + install -Dm755 "$srcdir/build/src/$_gopkgname/bin/pd-recover" "$pkgdir/usr/bin/pd-recover" + # Install systemd service + install -Dm644 "$srcdir/pd.service" "$pkgdir/usr/lib/systemd/system/pd.service" + # Install sysusers + install -Dm644 "$srcdir/pd-sysusers.conf" "$pkgdir/usr/lib/sysusers.d/pd.conf" + # Install default pd config + install -Dm644 pd.toml "$pkgdir/etc/pd/pd.toml" + + # Remove .git + find "$pkgdir" -type d -name ".git" -exec rm -r '{}' + +} + +# vim: ft=sh syn=sh et diff --git a/pd-sysusers.conf b/pd-sysusers.conf new file mode 100644 index 000000000000..8683495c47d7 --- /dev/null +++ b/pd-sysusers.conf @@ -0,0 +1 @@ +u pd - "Placement driver for TiKV" / diff --git a/pd.service b/pd.service new file mode 100644 index 000000000000..d1993b14c0ca --- /dev/null +++ b/pd.service @@ -0,0 +1,20 @@ +[Unit] +Description=Placement driver for TiKV +Documentation=https://github.com/pingcap/pd +After=network.target + +[Service] +PermissionsStartOnly=true +LimitNOFILE=1048576 +LimitNPROC=512 +CapabilityBoundingSet=CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_BIND_SERVICE +NoNewPrivileges=true +User=pd +WorkingDirectory=~ +ExecStart=/usr/bin/pd-server --config=/etc/pd/pd.toml +ExecReload=/bin/kill -SIGUSR1 $MAINPID +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/pd.toml b/pd.toml new file mode 100644 index 000000000000..156b85c8474a --- /dev/null +++ b/pd.toml @@ -0,0 +1,91 @@ +# PD Configuration. + +name = "pd" +data-dir = "default.pd" + +client-urls = "http://127.0.0.1:2379" +# if not set, use ${client-urls} +advertise-client-urls = "" + +peer-urls = "http://127.0.0.1:2380" +# if not set, use ${peer-urls} +advertise-peer-urls = "" + +initial-cluster = "pd=http://127.0.0.1:2380" +initial-cluster-state = "new" + +lease = 3 +tso-save-interval = "3s" + +namespace-classifier = "table" + +enable-prevote = true + +[security] +# Path of file that contains list of trusted SSL CAs. if set, following four settings shouldn't be empty +cacert-path = "" +# Path of file that contains X509 certificate in PEM format. +cert-path = "" +# Path of file that contains X509 key in PEM format. +key-path = "" + +[log] +level = "info" + +# log format, one of json, text, console +#format = "text" + +# disable automatic timestamps in output +#disable-timestamp = false + +# file logging +[log.file] +#filename = "" +# max log file size in MB +#max-size = 300 +# max log file keep days +#max-days = 28 +# maximum number of old log files to retain +#max-backups = 7 +# rotate log by day +#log-rotate = true + +[metric] +# prometheus client push interval, set "0s" to disable prometheus. +interval = "15s" +# prometheus pushgateway address, leaves it empty will disable prometheus. +address = "" + +[schedule] +max-merge-region-size = 0 +max-merge-region-keys = 0 +split-merge-interval = "1h" +max-snapshot-count = 3 +max-pending-peer-count = 16 +max-store-down-time = "30m" +leader-schedule-limit = 4 +region-schedule-limit = 4 +replica-schedule-limit = 8 +merge-schedule-limit = 8 +tolerant-size-ratio = 5.0 + +# customized schedulers, the format is as below +# if empty, it will use balance-leader, balance-region, hot-region as default +# [[schedule.schedulers]] +# type = "evict-leader" +# args = ["1"] + +[replication] +# The number of replicas for each region. +max-replicas = 3 +# The label keys specified the location of a store. +# The placement priorities is implied by the order of label keys. +# For example, ["zone", "rack"] means that we should place replicas to +# different zones first, then to different racks if we don't have enough zones. +location-labels = [] + +[label-property] +# Do not assign region leaders to stores that have these tags. +# [[label-property.reject-leader]] +# key = "zone" +# value = "cn1 |