summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorXuanwo2018-10-23 23:12:13 +0800
committerXuanwo2018-10-23 23:12:13 +0800
commit039fe4b9df89cedfc4f155dc197e0322670dd4ee (patch)
tree3cf2991d5b608987e102c5ec35a01f52e33bf3ae
downloadaur-039fe4b9df89cedfc4f155dc197e0322670dd4ee.tar.gz
Add tidb
-rw-r--r--.SRCINFO24
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD57
-rw-r--r--tidb-sysusers.conf1
-rw-r--r--tidb-tmpfiles.conf1
-rw-r--r--tidb.service16
-rw-r--r--tidb.toml239
7 files changed, 342 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ebf34114744f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = tidb
+ pkgdesc = A distributed HTAP database compatible with the MySQL protocol
+ pkgver = 2.0.8
+ pkgrel = 1
+ url = https://github.com/pingcap/tidb
+ arch = x86_64
+ license = Apache
+ makedepends = go
+ makedepends = make
+ provides = tidb-server
+ backup = etc/tidb/tidb.toml
+ source = tidb-2.0.8.tar.gz::https://github.com/pingcap/tidb/archive/v2.0.8.tar.gz
+ source = tidb.service
+ source = tidb-sysusers.conf
+ source = tidb-tmpfiles.conf
+ source = tidb.toml
+ sha256sums = 68e24e9070014d8a36ec426b915da9c02646f2ea4d679d5bd96394631475d726
+ sha256sums = bdc17656dcb014d1e03ba7fa40d587b0de93c5918d9c9fd86d3d1dc31a1a5365
+ sha256sums = 2b147d80985e714d5f861baf76591104c07058b9b6fa573bf0676d675cf8fc20
+ sha256sums = 30ce83fbec8f102c30e438282bb5b18c026d08480f2386d68f1116c12481bf66
+ sha256sums = ce1933beba35deded125aad82b847c65af1beb4f3a45dc1291da848880c4bf63
+
+pkgname = tidb
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..dacef39ed29b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.tar
+*.gz
+*.xz
+*.log
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..865d3095e20d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,57 @@
+# Maintainer: Xuanwo <xuanwo@archlinuxcn.org>
+pkgname=tidb
+pkgver=2.0.8
+pkgrel=1
+pkgdesc='A distributed HTAP database compatible with the MySQL protocol'
+makedepends=('go' 'make')
+arch=('x86_64')
+url='https://github.com/pingcap/tidb'
+license=('Apache')
+provides=('tidb-server')
+backup=(etc/tidb/tidb.toml)
+#depends=('tikv-pd')
+source=(tidb-${pkgver}.tar.gz::https://github.com/pingcap/tidb/archive/v${pkgver}.tar.gz
+ tidb.service
+ tidb-sysusers.conf
+ tidb-tmpfiles.conf
+ tidb.toml)
+sha256sums=('68e24e9070014d8a36ec426b915da9c02646f2ea4d679d5bd96394631475d726'
+ 'bdc17656dcb014d1e03ba7fa40d587b0de93c5918d9c9fd86d3d1dc31a1a5365'
+ '2b147d80985e714d5f861baf76591104c07058b9b6fa573bf0676d675cf8fc20'
+ '30ce83fbec8f102c30e438282bb5b18c026d08480f2386d68f1116c12481bf66'
+ 'ce1933beba35deded125aad82b847c65af1beb4f3a45dc1291da848880c4bf63')
+
+_gopkgname='github.com/pingcap/tidb'
+
+prepare() {
+ export GOPATH="$srcdir/build"
+ rm -rf "$GOPATH/src/$_gopkgname"
+ mkdir -p `dirname "$GOPATH/src/$_gopkgname"`
+ mv -Tv "$srcdir/tidb-${pkgver}" "$GOPATH/src/$_gopkgname"
+}
+
+build() {
+ export GOPATH="$srcdir/build"
+ export PATH=$GOPATH/bin:$PATH
+ export CGO_ENABLED=0
+
+ cd $GOPATH/src/$_gopkgname
+
+ make parserlib
+ go build -o bin/tidb-server tidb-server/main.go
+}
+
+package() {
+ # Install binary
+ install -Dm755 "$srcdir/build/src/$_gopkgname/bin/tidb-server" "$pkgdir/usr/bin/tidb-server"
+ # Install systemd service
+ install -Dm644 "$srcdir/tidb.service" "$pkgdir/usr/lib/systemd/system/tidb.service"
+ # Install sysusers
+ install -Dm644 "$srcdir/tidb-sysusers.conf" "$pkgdir/usr/lib/sysusers.d/tidb.conf"
+ # Install tmpfiles
+ install -Dm644 "$srcdir/tidb-tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/tidb.conf"
+ # Install default config
+ install -Dm644 tidb.toml "$pkgdir/etc/tidb/tidb.toml"
+}
+
+# vim: ft=sh syn=sh et
diff --git a/tidb-sysusers.conf b/tidb-sysusers.conf
new file mode 100644
index 000000000000..6e9bd7eaaa2f
--- /dev/null
+++ b/tidb-sysusers.conf
@@ -0,0 +1 @@
+u tidb - "TiDB is a distributed HTAP database compatible with the MySQL protocol" /
diff --git a/tidb-tmpfiles.conf b/tidb-tmpfiles.conf
new file mode 100644
index 000000000000..95753f6fc615
--- /dev/null
+++ b/tidb-tmpfiles.conf
@@ -0,0 +1 @@
+d /var/lib/tidb 0755 tidb tidb -
diff --git a/tidb.service b/tidb.service
new file mode 100644
index 000000000000..f36cc98aadb2
--- /dev/null
+++ b/tidb.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=TiDB is a distributed HTAP database compatible with the MySQL protocol
+Documentation=https://github.com/pingcap/tidb
+Requires=pd.service
+After=pd.service network.target
+
+[Service]
+User=tidb
+WorkingDirectory=/var/lib/tidb
+LimitNOFILE=1048576
+ExecStart=/usr/bin/tidb-server --config=/etc/tidb/tidb.toml
+ExecReload=/bin/kill -SIGUSR1 $MAINPID
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tidb.toml b/tidb.toml
new file mode 100644
index 000000000000..5481b49237a7
--- /dev/null
+++ b/tidb.toml
@@ -0,0 +1,239 @@
+# TiDB Configuration.
+
+# TiDB server host.
+host = "0.0.0.0"
+
+# TiDB server port.
+port = 4000
+
+# Registered store name, [tikv, mocktikv]
+store = "tikv"
+
+# TiDB storage path.
+path = "127.0.0.1:2379"
+
+# The socket file to use for connection.
+socket = ""
+
+# Run ddl worker on this tidb-server.
+run-ddl = true
+
+# Schema lease duration, very dangerous to change only if you know what you do.
+lease = "45s"
+
+# When create table, split a separated region for it. It is recommended to
+# turn off this option if there will be a large number of tables created.
+split-table = true
+
+# The limit of concurrent executed sessions.
+token-limit = 1000
+
+# Only print a log when out of memory quota.
+# Valid options: ["log", "cancel"]
+oom-action = "log"
+
+# Set the memory quota for a query in bytes. Default: 32GB
+mem-quota-query = 34359738368
+
+# Enable coprocessor streaming.
+enable-streaming = false
+
+# Set system variable 'lower_case_table_names'
+lower-case-table-names = 2
+
+[log]
+# Log level: debug, info, warn, error, fatal.
+level = "info"
+
+# Log format, one of json, text, console.
+format = "text"
+
+# Disable automatic timestamp in output
+disable-timestamp = false
+
+# Stores slow query log into separated files.
+slow-query-file = ""
+
+# Queries with execution time greater than this value will be logged. (Milliseconds)
+slow-threshold = 300
+
+# Queries with internal result greater than this value will be logged.
+expensive-threshold = 10000
+
+# Maximum query length recorded in log.
+query-log-max-len = 2048
+
+# File logging.
+[log.file]
+# Log file name.
+filename = ""
+
+# Max log file size in MB (upper limit to 4096MB).
+max-size = 300
+
+# Max log file keep days. No clean up by default.
+max-days = 0
+
+# Maximum number of old log files to retain. No clean up by default.
+max-backups = 0
+
+# Rotate log by day
+log-rotate = true
+
+[security]
+# Path of file that contains list of trusted SSL CAs for connection with mysql client.
+ssl-ca = ""
+
+# Path of file that contains X509 certificate in PEM format for connection with mysql client.
+ssl-cert = ""
+
+# Path of file that contains X509 key in PEM format for connection with mysql client.
+ssl-key = ""
+
+# Path of file that contains list of trusted SSL CAs for connection with cluster components.
+cluster-ssl-ca = ""
+
+# Path of file that contains X509 certificate in PEM format for connection with cluster components.
+cluster-ssl-cert = ""
+
+# Path of file that contains X509 key in PEM format for connection with cluster components.
+cluster-ssl-key = ""
+
+[status]
+# If enable status report HTTP service.
+report-status = true
+
+# TiDB status port.
+status-port = 10080
+
+# Prometheus pushgateway address, leaves it empty will disable prometheus push.
+metrics-addr = ""
+
+# Prometheus client push interval in second, set \"0\" to disable prometheus push.
+metrics-interval = 15
+
+[performance]
+# Max CPUs to use, 0 use number of CPUs in the machine.
+max-procs = 0
+# StmtCountLimit limits the max count of statement inside a transaction.
+stmt-count-limit = 5000
+
+# Set keep alive option for tcp connection.
+tcp-keep-alive = true
+
+# The maximum number of retries when commit a transaction.
+retry-limit = 10
+
+# Whether support cartesian product.
+cross-join = true
+
+# Stats lease duration, which influences the time of analyze and stats load.
+stats-lease = "3s"
+
+# Run auto analyze worker on this tidb-server.
+run-auto-analyze = true
+
+# Probability to use the query feedback to update stats, 0 or 1 for always false/true.
+feedback-probability = 0.0
+
+# The max number of query feedback that cache in memory.
+query-feedback-limit = 1024
+
+# Pseudo stats will be used if the ratio between the modify count and
+# row count in statistics of a table is greater than it.
+pseudo-estimate-ratio = 0.7
+
+[proxy-protocol]
+# PROXY protocol acceptable client networks.
+# Empty string means disable PROXY protocol, * means all networks.
+networks = ""
+
+# PROXY protocol header read timeout, unit is second
+header-timeout = 5
+
+[plan-cache]
+enabled = false
+capacity = 2560
+shards = 256
+
+[prepared-plan-cache]
+enabled = false
+capacity = 100
+
+[opentracing]
+# Enable opentracing.
+enable = false
+
+# Whether to enable the rpc metrics.
+rpc-metrics = false
+
+[opentracing.sampler]
+# Type specifies the type of the sampler: const, probabilistic, rateLimiting, or remote
+type = "const"
+
+# Param is a value passed to the sampler.
+# Valid values for Param field are:
+# - for "const" sampler, 0 or 1 for always false/true respectively
+# - for "probabilistic" sampler, a probability between 0 and 1
+# - for "rateLimiting" sampler, the number of spans per second
+# - for "remote" sampler, param is the same as for "probabilistic"
+# and indicates the initial sampling rate before the actual one
+# is received from the mothership
+param = 1.0
+
+# SamplingServerURL is the address of jaeger-agent's HTTP sampling server
+sampling-server-url = ""
+
+# MaxOperations is the maximum number of operations that the sampler
+# will keep track of. If an operation is not tracked, a default probabilistic
+# sampler will be used rather than the per operation specific sampler.
+max-operations = 0
+
+# SamplingRefreshInterval controls how often the remotely controlled sampler will poll
+# jaeger-agent for the appropriate sampling strategy.
+sampling-refresh-interval = 0
+
+[opentracing.reporter]
+# QueueSize controls how many spans the reporter can keep in memory before it starts dropping
+# new spans. The queue is continuously drained by a background go-routine, as fast as spans
+# can be sent out of process.
+queue-size = 0
+
+# BufferFlushInterval controls how often the buffer is force-flushed, even if it's not full.
+# It is generally not useful, as it only matters for very low traffic services.
+buffer-flush-interval = 0
+
+# LogSpans, when true, enables LoggingReporter that runs in parallel with the main reporter
+# and logs all submitted spans. Main Configuration.Logger must be initialized in the code
+# for this option to have any effect.
+log-spans = false
+
+# LocalAgentHostPort instructs reporter to send spans to jaeger-agent at this address
+local-agent-host-port = ""
+
+[tikv-client]
+# Max gRPC connections that will be established with each tikv-server.
+grpc-connection-count = 16
+
+# After a duration of this time in seconds if the client doesn't see any activity it pings
+# the server to see if the transport is still alive.
+grpc-keepalive-time = 10
+
+# After having pinged for keepalive check, the client waits for a duration of Timeout in seconds
+# and if no activity is seen even after that the connection is closed.
+grpc-keepalive-timeout = 3
+
+# max time for commit command, must be twice bigger than raft election timeout.
+commit-timeout = "41s"
+
+[binlog]
+
+# Socket file to write binlog.
+binlog-socket = ""
+
+# WriteTimeout specifies how long it will wait for writing binlog to pump.
+write-timeout = "15s"
+
+# If IgnoreError is true, when writting binlog meets error, TiDB would stop writting binlog,
+# but still provide service.
+ignore-error = false