安装过程
topology.yaml 文件内容
global:
user: "tidb"
ssh_port: 22
deploy_dir: "/tidb-deploy"
data_dir: "/tidb-data"
monitored:
deploy_dir: "/tidb-deploy/monitored-9100"
data_dir: "/tidb-data/monitored-9100"
log_dir: "/tidb-deploy/monitored-9100/log"
server_configs:
tidb:
log.slow-threshold: 300
log.level: warn
binlog.enable: false
binlog.ignore-error: false
tikv:
readpool.storage.use-unified-pool: true
readpool.coprocessor.use-unified-pool: true
pd:
schedule.leader-schedule-limit: 4
schedule.region-schedule-limit: 2048
schedule.replica-schedule-limit: 64
replication.enable-placement-rules: true
pd_servers:
- host: 192.168.0.7
tidb_servers:
- host: 192.168.0.7
tikv_servers:
- host: 192.168.0.7
- host: 192.168.0.6
- host: 192.168.0.8
tiflash_servers:
- host: 192.168.0.9
monitoring_servers:
- host: 192.168.0.8
grafana_servers:
- host: 192.168.0.8
alertmanager_servers:
- host: 192.168.0.8
部署命令:
root@3 tidb]# tiup cluster deploy tidb-test v4.0.0-beta.2 /opt/tidb/topology.yaml --user root
Starting /root/.tiup/components/cluster/v0.4.6/cluster deploy tidb-test v4.0.0-beta.2 /opt/tidb/topology.yaml --user root
Please confirm your topology:
TiDB Cluster: tidb-test
TiDB Version: v4.0.0-beta.2
Type Host Ports Directories
---- ---- ----- -----------
pd 192.168.0.7 2379/2380 /tidb-deploy/pd-2379,/tidb-data/pd-2379
tikv 192.168.0.7 20160/20180 /tidb-deploy/tikv-20160,/tidb-data/tikv-20160
tikv 192.168.0.6 20160/20180 /tidb-deploy/tikv-20160,/tidb-data/tikv-20160
tikv 192.168.0.8 20160/20180 /tidb-deploy/tikv-20160,/tidb-data/tikv-20160
tidb 192.168.0.7 4000/10080 /tidb-deploy/tidb-4000
tiflash 192.168.0.9 9000/8123/3930/20170/20292/8234 /tidb-deploy/tiflash-9000,/tidb-data/tiflash-9000
prometheus 192.168.0.8 9090 /tidb-deploy/prometheus-9090,/tidb-data/prometheus-9090
grafana 192.168.0.8 3000 /tidb-deploy/grafana-3000
alertmanager 192.168.0.8 9093/9094 /tidb-deploy/alertmanager-9093,/tidb-data/alertmanager-9093
Attention:
1. If the topology is not what you expected, check your yaml file.
1. Please confirm there is no port/directory conflicts in same host.
Do you want to continue? [y/N]: y
Input SSH password:
+ Generate SSH keys ... ⠦ Generate private key
+ Generate SSH keys ... Done
+ Download TiDB components
- Download pd:v4.0.0-beta.2 ... Done
- Download tikv:v4.0.0-beta.2 ... Done
- Download tidb:v4.0.0-beta.2 ... Done
- Download tiflash:v4.0.0-beta.2 ... Done
- Download prometheus:v4.0.0-beta.2 ... Done
- Download grafana:v4.0.0-beta.2 ... Done
- Download alertmanager:v0.17.0 ... Done
- Download node_exporter:v0.17.0 ... Done
- Download blackbox_exporter:v0.12.0 ... Done
+ Initialize target host environments
- Prepare 192.168.0.7:22 ... Done
- Prepare 192.168.0.6:22 ... Done
- Prepare 192.168.0.8:22 ... Done
- Prepare 192.168.0.9:22 ... Done
+ Copy files
- Copy pd -> 192.168.0.7 ... Done
- Copy tikv -> 192.168.0.7 ... Done
- Copy tikv -> 192.168.0.6 ... Done
- Copy tikv -> 192.168.0.8 ... Done
- Copy tidb -> 192.168.0.7 ... Done
- Copy tiflash -> 192.168.0.9 ... Done
- Copy prometheus -> 192.168.0.8 ... Done
- Copy grafana -> 192.168.0.8 ... Done
- Copy alertmanager -> 192.168.0.8 ... Done
- Copy node_exporter -> 192.168.0.7 ... Done
- Copy node_exporter -> 192.168.0.6 ... Done
- Copy node_exporter -> 192.168.0.8 ... Done
- Copy node_exporter -> 192.168.0.9 ... Done
- Copy blackbox_exporter -> 192.168.0.7 ... Done
- Copy blackbox_exporter -> 192.168.0.6 ... Done
- Copy blackbox_exporter -> 192.168.0.8 ... Done
- Copy blackbox_exporter -> 192.168.0.9 ... Done
Deployed cluster `tidb-test` successfully
Do you want to start the cluster now? [y/N]: You can use `cluster start tidb-test` to start the cluster manually.
从上面看部署是成功的,接下来启动集群
tiup cluster start tidb-test
然后出现了这个报错
去日志中查看了下发现是执行:
sudo -H -u root bash -c "systemctl daemon-reload && systemctl start tiflash-9000.service && systemctl enable tiflash-9000.service"
命令卡住了,去tiflash的目标机器上查看systemctl 的执行记录
[root@1 log]# journalctl -xe
--
-- Unit tiflash-9000.service has finished shutting down.
4月 09 17:52:21 1 systemd[1]: Started tiflash service.
-- Subject: Unit tiflash-9000.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit tiflash-9000.service has finished starting up.
--
-- The start-up result is done.
4月 09 17:52:21 1 run_tiflash.sh[10129]: sync ...
4月 09 17:52:21 1 run_tiflash.sh[10129]: real 0m0.003s
4月 09 17:52:21 1 run_tiflash.sh[10129]: user 0m0.000s
4月 09 17:52:21 1 run_tiflash.sh[10129]: sys 0m0.001s
4月 09 17:52:21 1 systemd[1]: tiflash-9000.service: main process exited, code=exited, status=1/FAILURE
4月 09 17:52:21 1 run_tiflash.sh[10129]: ok
4月 09 17:52:21 1 run_tiflash.sh[10129]: /tidb-deploy/tiflash-9000/scripts/run_tiflash.sh: line 18: /tidb-deploy/tiflash-9000/bin/tiflash/tiflash: No such file or directory
4月 09 17:52:21 1 systemd[1]: Unit tiflash-9000.service entered failed state.
4月 09 17:52:21 1 systemd[1]: tiflash-9000.service failed.
4月 09 17:52:36 1 systemd[1]: tiflash-9000.service holdoff time over, scheduling restart.
4月 09 17:52:36 1 systemd[1]: Stopped tiflash service.
接着去tiflash的安装目录看看看run_tiflash.sh脚本的18行的命令对应的命令存不存在
得到如上结果,前面部署是成功的,没有异常但是在执行时候却缺少了执行文件。
请教下这种问题要如何解决?