TiDB 分布式数据库(一)
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,## TiDB :A Distributed SQL Database# github :https://github.com/pingcap/tidb# doc : https://github.c
千家信息网最后更新 2026年11月01日TiDB 分布式数据库(一)
#
# TiDB :A Distributed SQL Database
# github :https://github.com/pingcap/tidb
# doc : https://github.com/pingcap/docs-cn
#
软件下载
[root@KVM_2 ~]# wget http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz
单节点测试
[root@KVM_2 ~]# tar -xf tidb-latest-linux-amd64.tar.gz [root@KVM_2 ~]# cd tidb-latest-linux-amd64/[root@KVM_2 tidb-latest-linux-amd64]# [root@KVM_2 tidb-latest-linux-amd64]# mkdir /data/tidb/{data,log} -p[root@KVM_2 tidb-latest-linux-amd64]# mkdir /data/tidb/data/{pd,tikv} -p[root@KVM_2 tidb-latest-linux-amd64]# ./bin/pd-server --data-dir=/data/tidb/data/pd --log-file=/data/tidb/log/pd.log &[root@KVM_2 tidb-latest-linux-amd64]# ./bin/tikv-server --pd="127.0.0.1:2379" --data-dir=/data/tidb/data/tikv --log-file=/data/tidb/log/tikv.log &[root@KVM_2 tidb-latest-linux-amd64]# ./bin/tidb-server --store=tikv --path="127.0.0.1:2379" --log-file=/data/tidb/log/tidb.log &参数解释:
https://github.com/pingcap/docs-cn/blob/master/op-guide/configuration.md#tidb
#测试
#安装mysql客户端工具
[root@KVM_2 ~]# yum install -y mariadb[root@KVM_2 ~]# mysql -h 127.0.0.1 -P 4000 -u root -D testWelcome to the MariaDB monitor. Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.7.1-TiDB-1.0 MySQL Community Server (GPL)Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MySQL [test]> show databases;+--------------------+| Database |+--------------------+| INFORMATION_SCHEMA || PERFORMANCE_SCHEMA || mysql || test |+--------------------+4 rows in set (0.00 sec)MySQL [(none)]> select user from mysql.user;+------+| user |+------+| root |+------+1 row in set (0.00 sec)MySQL [(none)]> create database wordpressdb;Query OK, 0 rows affected (2.02 sec)MySQL [(none)]> create user 'wordpressuser'@'localhost' identified by '123456';Query OK, 1 row affected (0.01 sec)MySQL [(none)]> grant all on wordpressdb.* to 'wordpressuser'@'localhost' identified by '123456';;Query OK, 0 rows affected (0.02 sec)MySQL [(none)]> grant all on wordpressdb.* to 'wordpressuser'@'%' identified by '123456';;Query OK, 1 row affected (0.02 sec)MySQL [(none)]> flush privileges;Query OK, 0 rows affected (0.00 sec)MySQL [(none)]> exitByeMySQL [(none)]> show databases;+--------------------+| Database |+--------------------+| INFORMATION_SCHEMA || PERFORMANCE_SCHEMA || mysql || test || wordpressdb |+--------------------+5 rows in set (0.00 sec)MySQL [test]> exit
#查看端口
[root@KVM_2 ~]# netstat -lntupActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:2379 0.0.0.0:* LISTEN 13474/./bin/pd-serv tcp 0 0 127.0.0.1:2380 0.0.0.0:* LISTEN 13474/./bin/pd-serv tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2577/dnsmasq tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1324/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1766/master tcp 0 0 127.0.0.1:20160 0.0.0.0:* LISTEN 13490/./bin/tikv-se tcp6 0 0 :::22 :::* LISTEN 1324/sshd tcp6 0 0 ::1:25 :::* LISTEN 1766/master tcp6 0 0 :::10080 :::* LISTEN 13528/./bin/tidb-se tcp6 0 0 :::4000 :::* LISTEN 13528/./bin/tidb-se udp 0 0 0.0.0.0:28688 0.0.0.0:* 1020/dhclient udp 0 0 192.168.122.1:53 0.0.0.0:* 2577/dnsmasq udp 0 0 0.0.0.0:67 0.0.0.0:* 2577/dnsmasq udp 0 0 0.0.0.0:68 0.0.0.0:* 1020/dhclient udp 0 0 0.0.0.0:68 0.0.0.0:* 1019/dhclient udp 0 0 0.0.0.0:53726 0.0.0.0:* 1019/dhclient udp6 0 0 :::6511 :::* 1019/dhclient udp6 0 0 :::53726 :::* 1020/dhclient
测试
参数
客户
客户端
工具
端口
节点
软件
软件下载
解释
分布式
数据
数据库
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
什么是科技互联网
博彦科技互联网金融
互联网科技的
互联网 科技
喔噻互联网科技
以房互联网科技
迪茉互联网科技
艾特科技互联网
郑州华宇互联网科技
互联网科技论坛
撒么互联网科技公司
互联网科技寓意
互联网对科技的发展
重庆互联网医院沙龙医盟信息科技
青岛科技大学互联网大赛研究生
元气玛特互联网科技公司是外包吗
领航科技大厦互联网公司
广州燕处互联网科技有限公司
新氧科技和美国互联网有关系吗
如何强化互联网金融科技
上海卓越科技互联网
互联网巨头反垄断金融科技
奇酷互联网络科技
广州互联网络科技有限公司
美国互联网前沿科技
深圳市罗太互联网科技有限公司
黑云互联网科技有限公司
现代互联网科技公司
现代科技的标志之一的互联网
互联网科技快速发展优美句子