-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Breezewish <me@breeswish.org>
- Loading branch information
1 parent
71f1cfe
commit 870a8cc
Showing
28 changed files
with
1,471 additions
and
643 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 @@ | ||
# complexCase1 | ||
|
||
TiDB, PD, TiKV, TiFlash each in different hosts. | ||
|
||
## Usage | ||
|
||
1. Start the box: | ||
|
||
```bash | ||
VAGRANT_EXPERIMENTAL="disks" vagrant up | ||
``` | ||
|
||
1. Use [TiUP](https://tiup.io/) to deploy the cluster to the box (only need to do it once): | ||
|
||
```bash | ||
tiup cluster deploy complexCase1 v4.0.8 topology.yaml -i ../_shared/vagrant_key -y --user vagrant | ||
``` | ||
|
||
1. Start the cluster in the box: | ||
|
||
```bash | ||
tiup cluster start complexCase1 | ||
``` | ||
|
||
1. Start TiDB Dashboard server: | ||
|
||
```bash | ||
bin/tidb-dashboard --pd http://10.0.1.31:2379 | ||
``` | ||
|
||
## Cleanup | ||
|
||
```bash | ||
tiup cluster destroy complexCase1 -y | ||
vagrant destroy --force | ||
``` |
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,40 @@ | ||
load "#{File.dirname(__FILE__)}/../_shared/Vagrantfile.partial.pubKey.rb" | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.provider "virtualbox" do |v| | ||
v.memory = 1024 | ||
v.cpus = 1 | ||
end | ||
|
||
(1..5).each do |i| | ||
config.vm.define "node#{i}" do |node| | ||
node.vm.network "private_network", ip: "10.0.1.#{i+30}" | ||
(1..4).each do |j| | ||
node.vm.disk :disk, size: "10GB", name: "disk-#{i}-#{j}" | ||
end | ||
end | ||
end | ||
|
||
config.vm.provision "disk", type: "shell", privileged: false, inline: <<-SHELL | ||
echo "Formatting disks" | ||
sudo mkfs.ext4 -j -L hdd1 /dev/sdb | ||
sudo mkfs.ext4 -j -L hdd2 /dev/sdc | ||
sudo mkfs.ext4 -j -L hdd3 /dev/sdd | ||
sudo mkfs.ext4 -j -L hdd4 /dev/sde | ||
echo "Mounting directories" | ||
sudo mkdir -p /pingcap/tidb-data | ||
echo "/dev/sdb /pingcap/tidb-data ext4 defaults 0 0" | sudo tee -a /etc/fstab | ||
sudo mount /pingcap/tidb-data | ||
sudo mkdir -p /pingcap/tidb-deploy | ||
sudo mkdir -p /pingcap/tidb-data/tikv-1 | ||
sudo mkdir -p /pingcap/tidb-data/tikv-2 | ||
echo "/dev/sdc /pingcap/tidb-deploy ext4 defaults 0 0" | sudo tee -a /etc/fstab | ||
echo "/dev/sdd /pingcap/tidb-data/tikv-1 ext4 defaults 0 0" | sudo tee -a /etc/fstab | ||
echo "/dev/sde /pingcap/tidb-data/tikv-2 ext4 defaults 0 0" | sudo tee -a /etc/fstab | ||
sudo mount /pingcap/tidb-deploy | ||
sudo mount /pingcap/tidb-data/tikv-1 | ||
sudo mount /pingcap/tidb-data/tikv-2 | ||
SHELL | ||
end |
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,85 @@ | ||
global: | ||
user: tidb | ||
deploy_dir: /pingcap/tidb-deploy | ||
data_dir: /pingcap/tidb-data | ||
|
||
server_configs: | ||
tikv: | ||
server.grpc-concurrency: 1 | ||
raftstore.apply-pool-size: 1 | ||
raftstore.store-pool-size: 1 | ||
readpool.unified.max-thread-count: 1 | ||
readpool.storage.use-unified-pool: false | ||
readpool.coprocessor.use-unified-pool: true | ||
storage.block-cache.capacity: 256MB | ||
raftstore.capacity: 5GB | ||
|
||
# Overview: | ||
# 31: 1 PD, 1 TiDB, 2 TiKV | ||
# 32: 1 TiDB, 2 TiKV | ||
# 33: 1 PD, 1 TiFlash | ||
# 34: 2 TiKV, 1 TiFlash | ||
# 35: 1 TiFlash | ||
|
||
pd_servers: | ||
- host: 10.0.1.31 | ||
- host: 10.0.1.33 | ||
|
||
tikv_servers: | ||
- host: 10.0.1.31 | ||
port: 20160 | ||
status_port: 20180 | ||
data_dir: /pingcap/tidb-data/tikv-1/tikv-20160 | ||
config: | ||
server.labels: { host: "tikv1" } | ||
- host: 10.0.1.31 | ||
port: 20161 | ||
status_port: 20181 | ||
data_dir: /pingcap/tidb-data/tikv-2/tikv-20161 | ||
config: | ||
server.labels: { host: "tikv2" } | ||
- host: 10.0.1.32 | ||
port: 20160 | ||
status_port: 20180 | ||
data_dir: /pingcap/tidb-data/tikv-1/tikv-20160 | ||
config: | ||
server.labels: { host: "tikv1" } | ||
- host: 10.0.1.32 | ||
port: 20161 | ||
status_port: 20181 | ||
data_dir: /pingcap/tidb-data/tikv-2/tikv-20161 | ||
config: | ||
server.labels: { host: "tikv2" } | ||
- host: 10.0.1.34 | ||
port: 20160 | ||
status_port: 20180 | ||
data_dir: /pingcap/tidb-data/tikv-1/tikv-20160 | ||
config: | ||
server.labels: { host: "tikv1" } | ||
- host: 10.0.1.34 | ||
port: 20161 | ||
status_port: 20181 | ||
data_dir: /pingcap/tidb-data/tikv-2/tikv-20161 | ||
config: | ||
server.labels: { host: "tikv2" } | ||
|
||
tiflash_servers: | ||
- host: 10.0.1.33 | ||
data_dir: /pingcap/tidb-data/tikv-1/tiflash | ||
- host: 10.0.1.34 | ||
data_dir: /pingcap/tidb-data/tikv-2/tiflash | ||
- host: 10.0.1.35 | ||
data_dir: /pingcap/tidb-data/tikv-1/tiflash | ||
|
||
tidb_servers: | ||
- host: 10.0.1.31 | ||
- host: 10.0.1.32 | ||
|
||
grafana_servers: | ||
- host: 10.0.1.31 | ||
|
||
monitoring_servers: | ||
- host: 10.0.1.31 | ||
|
||
alertmanager_servers: | ||
- host: 10.0.1.31 |
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
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
Oops, something went wrong.