-
Notifications
You must be signed in to change notification settings - Fork 501
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 scheduler_compatibility
- Loading branch information
Showing
17 changed files
with
1,562 additions
and
293 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,36 @@ | ||
# Shards and Replicas | ||
|
||
If a single Prometheus can't hold the current target metrics, the user can shard the targets on multiple Prometheus servers. | ||
Shards use the Prometheus `modulus` configuration, which takes the hash of the `__address__` source label values, and splits the scrape targets based on the number of shards. | ||
|
||
Note that decreasing shards will not reshard data onto the remaining instances, the data must be manually moved. Increasing shards will not reshard data either but it will continue to be available from the original instances. | ||
|
||
It’s not recommended to configure `spec.prometheus.ingress` and `spec.grafana` in the TidbMonitor CR when using multiple shards. And we recommend using Thanos to query the metrics globally. | ||
|
||
## Install Example | ||
|
||
Install TiDB: | ||
|
||
```bash | ||
kubectl apply -f tidb-cluster.yaml -n ${namespace} | ||
``` | ||
|
||
Wait for Pods ready: | ||
|
||
```bash | ||
watch kubectl -n ${namespace} get pod | ||
``` | ||
|
||
Install TidbMonitor with two shards : | ||
|
||
```bash | ||
kubectl apply -f tidb-monitor.yaml -n ${namespace} | ||
``` | ||
|
||
Wait for Pods ready: | ||
|
||
```bash | ||
watch kubectl -n ${namespace} get pod | ||
``` | ||
|
||
We will see that the scrape targets are distributed on the two shards. |
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,45 @@ | ||
# IT IS NOT SUITABLE FOR PRODUCTION USE. | ||
# This YAML describes a basic TiDB cluster with minimum resource requirements, | ||
# which should be able to run in any Kubernetes cluster with storage support. | ||
apiVersion: pingcap.com/v1alpha1 | ||
kind: TidbCluster | ||
metadata: | ||
name: basic | ||
spec: | ||
version: v5.2.1 | ||
timezone: UTC | ||
pvReclaimPolicy: Retain | ||
enableDynamicConfiguration: true | ||
configUpdateStrategy: RollingUpdate | ||
discovery: {} | ||
pd: | ||
baseImage: pingcap/pd | ||
replicas: 1 | ||
# if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used | ||
# storageClassName: local-storage | ||
requests: | ||
storage: "1Gi" | ||
config: {} | ||
tikv: | ||
baseImage: pingcap/tikv | ||
replicas: 1 | ||
# if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used | ||
# storageClassName: local-storage | ||
requests: | ||
storage: "1Gi" | ||
config: | ||
storage: | ||
# In basic examples, we set this to avoid using too much storage. | ||
reserve-space: "0MB" | ||
rocksdb: | ||
# In basic examples, we set this to avoid the following error in some Kubernetes clusters: | ||
# "the maximum number of open file descriptors is too small, got 1024, expect greater or equal to 82920" | ||
max-open-files: 256 | ||
raftdb: | ||
max-open-files: 256 | ||
tidb: | ||
baseImage: pingcap/tidb | ||
replicas: 1 | ||
service: | ||
type: ClusterIP | ||
config: {} |
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,19 @@ | ||
apiVersion: pingcap.com/v1alpha1 | ||
kind: TidbMonitor | ||
metadata: | ||
name: basic | ||
spec: | ||
replicas: 1 | ||
shards: 2 | ||
clusters: | ||
- name: basic | ||
prometheus: | ||
baseImage: prom/prometheus | ||
version: v2.18.1 | ||
initializer: | ||
baseImage: pingcap/tidb-monitor-initializer | ||
version: v5.2.1 | ||
reloader: | ||
baseImage: pingcap/tidb-monitor-reloader | ||
version: v1.0.1 | ||
imagePullPolicy: IfNotPresent |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.