随笔分类 - tidb数据库
关于tidb数据库的一些软件安装维护
摘要:1、添加跳过认证tidb的配置文件(单节点即可)[root@localhost conf]# vi tidb.toml [security]skip-grant-table = true 2、停止服务systemctl stop tidb-40003、root启动脚本/tidb-deploy/tid
阅读全文
摘要:思路:找到cluster id 和 分配的id 启动单点的pd pd-recover修复pd 恢复成pd集群 强制删除多个pd 启动tidb集群 1、pd的日志报错 [root@localhost log]# pwd /tidb-deploy/pd-2379/log [root@localhost
阅读全文
摘要:```bash命令及sql查看#tidb热点regins查看select * from information_schema.tidb_hot_regions where REGION_ID='121930461';select * from information_schema.TIKV_REGI
阅读全文
摘要:[root@host-2 wj]# vi kill_tidb_zombie.sh #!/bin/bash source /etc/profile cat /dev/null > /tmp/sql_tmp_kill_zombie.sql kill_tidb_zom(){ #查询僵尸进程 mysql -
阅读全文
摘要:1、查看时间 MySQL [test]> SELECT NOW(); + + | NOW() | + + | 2022-02-15 02:01:12 | + + 1 row in set (0.00 sec) MySQL [test]> select @@global.time_zone,@@ses
阅读全文
摘要:环境:tidb4.0.8、centos7.6 1、tidb扩容ticdc 1. 添加节点信息到 scale-out.yaml 文件 cdc_servers: - host: 172.168.20.51 port: 8300 deploy_dir: "/data1/tidb-deploy/cdc-83
阅读全文
摘要:实际操作: 1、下载4.0.12离线包 https://pingcap.com/download-cn/community/ 2、升级tiup cd /data1/update_tidb tar xzvf tidb-community-server-v4.0.12-linux-amd64.tar.g
阅读全文
摘要:环境:tidb4.8 例如:将rkw_ezc_prod数据库的所有表 导入到 new_dababase_name数据库中 1、使用mydumper导出数据 /usr/bin/mydumper -l 60000 -h 192.168.1.10 -P 4001 -u root -p 'password'
阅读全文
摘要:环境:tidb4 这儿问题是:前段时间执行了大型sql,数据库tikv节点卡死,sql没有释放。 一、查看是否有节点down,手动启动节点 tiup cluster stop tidb -N 172.21.210.36:20160 #停单个节点(注意:这儿的tidb是集群的名称,不是某个主键名称 t
阅读全文
摘要:环境:tidb4.0 错误详情: mysql> select count(*) total,zrqdm from wpt_jbdjxx_hcy where xt_zxbz='0' and ywlsh in (select ywlsh from wpt_jbdjxx where xt_confirm
阅读全文
摘要:环境:centos7 1、离线包下载 https://pingcap.com/download-cn/community/ (工具下载也在这儿如lightning) 2、部署离线环境 TiUP 组件 将离线包发送到目标集群的中控机后,执行以下命令安装 TiUP 组件: tar xzvf tidb-c
阅读全文
摘要:环境:tidb4.0、centos7 1、tidb操作停止启动、重启 tiup cluster stop tidb tiup cluster start tidb tiup cluster restart tidb 2、tidb查看参数配置sql命令 SHOW CONFIG WHERE type =
阅读全文
摘要:环境:tidb4.0、centos7 1、查看集群节点信息 tiup cluster display tidb 2、剔除节点 tiup cluster scale-in tidb --node 172.21.210.39:20160 其中 --node 参数为需要下线节点的 ID。 预期输出 Sca
阅读全文
摘要:环境:centos7、tidb4.0.4、tiup-v1.0.8 添加两个tikv节点 172.21.210.37-38 思路:初始化两台服务器、配置ssh互通——>编辑配置文件——>执行扩容命令——>重启grafana 1、初始化服务器、配置ssh互通 1、时间同步 2、配置ssh ssh-cop
阅读全文
摘要:环境:tidb4.0.4、centos7 前提:使用dumper导出了数据文件,可以是csv、mysql都可以,如果导入的库中有数据,需要先手动清空表数据 truncate table check_data_sync ; 官网的说明:https://docs.pingcap.com/zh/tidb/
阅读全文
摘要:环境:centos7、tidb3.0 思路:查找store-id——>重集群中移除节点——>查看节点是否下线完成——>停止节点服务——>移除配置信息——>更新监控信息 1、在中控机上找到要移除tikv的store-id [tidb@tidb-21 ~]$ /home/tidb/tidb-ansibl
阅读全文
摘要:环境:tidb4.0、tiup 1、在tidb的监控机上修改配置文件 找到grafan的配置文件 find / -name grafana.ini 修改以下两项 domain = 172.21.210.32 #有localhost 改为ip root_url = %(protocol)s://%(d
阅读全文
摘要:环境:centos7.6、ansible2.5、tidb3.0.2 连接地址:https://docs.pingcap.com/zh/tidb/v3.0/scale-tidb-using-ansible(官网的扩容缩荣操作) 扩容 TiKV 节点 例如,如果要添加两个 TiDB 节点(node44-
阅读全文
摘要:环境:centos7.6、tidb3.2、ansible-2.5 优化tikv的sync-log参数:ture——>false # 默认为 true,表示强制将数据刷到磁盘上。如果是非金融安全级别的业务场景,建议设置成 false, # 以便获得更高的性能。 1、中控机上修改配置文件 1.在配置文件
阅读全文
摘要:1、tidb最小要求 TiDB 系统调优的官方建议: TiKV 内存使用情况 除了以上列出的 block-cache 以及 write-buffer 会占用系统内存外: 需预留一些内存作为系统的 page cache TiKV 在处理大的查询的时候(例如 select * from ...)会读取数
阅读全文