1、解压tidb包:
tar zxf tidb-latest-linux-amd64.tar.gz
cd tidb-latest-linux-amd64
2、后台执行pd_server:
./bin/pd-server --name=pd1 --data-dir=pd1 --client-urls="http://172.25.51.1:2379" --peer-urls="http://172.25.51.1:2380" --initial-cluster="pd1=http://172.25.51.1:2380" --log-file=pd.log &
netstat -antlp |grep :2379
netstat -antlp |grep :2380
./bin/tidb-server &
3、运行tidb:
netstat -antlp | grep 4000
mysql -h 172.25.51.1 -P 4000 -uroot
>create database zabbix character set utf8 collate utf8_bin;
>CREATE USER 'zabbix'@'%' IDENTIFIED BY 'westos';
>grant all privileges on *.* to 'zabbix'@'%';
>quit
4、数据库备份及迁移:
mysqldump -uroot -pwestos zabbix >/mnt/zabbix.sql
cd /mnt/
mysql -h 172.25.3.6 -P 4000 -uroot
>use zabbix;
>set tidb_batch_insert=1;
>source /mnt/zabbix.sql;
>quit
5、修改server数据传输端口:
vim /etc/zabbix/zabbix_server.conf
\\\
DBPort=4000
\\\
6、修改监控网站访问ip及端口:
vim /etc/zabbix/web/zabbix.conf.php
7、重启服务
systemctl restart zabbix-server.service
systemctl restart zabbix-agent.service
迁移完成 依旧可用!
|