-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ngaut-bumping-go-version
- Loading branch information
Showing
16 changed files
with
758 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# TiDB Configuration. | ||
|
||
# TiDB server host. | ||
host = "0.0.0.0" | ||
|
||
# TiDB server port. | ||
port = 4000 | ||
|
||
# Registered store name, [memory, goleveldb, boltdb, tikv, mocktikv] | ||
store = "mocktikv" | ||
|
||
# TiDB storage path. | ||
path = "/tmp/tidb" | ||
|
||
# The socket file to use for connection. | ||
#socket = "" | ||
|
||
# Socket file to write binlog. | ||
#binlog-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 = "10s" | ||
|
||
[log] | ||
# Log level: info, debug, warn, error, fatal. | ||
level = "info" | ||
|
||
# Log format, one of json, text, console. | ||
format = "text" | ||
|
||
# Disable automatic timestamps in output | ||
disable-timestamp = false | ||
|
||
# Queries with execution time greater than this value will be logged. (Milliseconds) | ||
slow-threshold = 300 | ||
|
||
# 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. | ||
#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 | ||
|
||
[security] | ||
# This option causes the server to start without using the privilege system at all. | ||
skip-grant-table = false | ||
|
||
# Path of file that contains list of trusted SSL CAs. | ||
ssl-ca = "" | ||
|
||
# Path of file that contains X509 certificate in PEM format. | ||
ssl-cert = "" | ||
|
||
# Path of file that contains X509 key in PEM format. | ||
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] | ||
# Set keep alive option for tcp connection. | ||
tcp-keep-alive = true | ||
|
||
# The maximum number of retries when commit a transaction. | ||
retry-limit = 10 | ||
|
||
# The number of goroutines that participate joining. | ||
join-concurrency = 5 | ||
|
||
# Whether support cartesian product. | ||
cross-join = true | ||
|
||
# Stats lease duration, which inflences the time of analyze and stats load. | ||
stats-lease = "3s" | ||
|
||
[xprotocol] | ||
# Start TiDB x server. | ||
xserver = false | ||
|
||
# TiDB x protocol server host. | ||
xhost = "0.0.0.0" | ||
|
||
# TiDB x protocol server port. | ||
xport = 14000 | ||
|
||
# The socket file to use for x protocol connection. | ||
xsocket = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright 2017 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package config | ||
|
||
import ( | ||
"path" | ||
"runtime" | ||
"testing" | ||
|
||
. "github.com/pingcap/check" | ||
) | ||
|
||
var _ = Suite(&testConfigSuite{}) | ||
|
||
type testConfigSuite struct{} | ||
|
||
func TestT(t *testing.T) { | ||
CustomVerboseFlag = true | ||
TestingT(t) | ||
} | ||
|
||
func (s *testConfigSuite) TestConfig(c *C) { | ||
conf := new(Config) | ||
conf.BinlogSocket = "/tmp/socket" | ||
conf.Performance.RetryLimit = 20 | ||
|
||
_, filename, _, _ := runtime.Caller(0) | ||
configFile := path.Join(path.Dir(filename), "config.toml.example") | ||
err := conf.Load(configFile) | ||
c.Assert(err, IsNil) | ||
|
||
// Test that the original value will not be clear by load the config file that does not contain the option. | ||
c.Assert(conf.BinlogSocket, Equals, "/tmp/socket") | ||
|
||
// Test that the value will be overwritten by the config file. | ||
c.Assert(conf.Performance.RetryLimit, Equals, 10) | ||
|
||
// Reset | ||
conf.BinlogSocket = "" | ||
|
||
// Make sure the example config is the same as default config. | ||
c.Assert(conf, DeepEquals, GetGlobalConfig()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.