[CentOS] TiDB安装中需要注意的问题

本人是使用Ansible做的部署,按照文档做还是很容易部署的。

1. 文件系统已使用ext4格式,修改挂载参数(增加nodelalloc和noatime)

首先,检查系统的文件格式,命令如下

#vi /etc/fstab

在你设置的数据存储的挂载点那一行里,第三节为磁盘格式,在第四节设置参数(注意,以逗号分隔)。

然后需要重新启动,在启动时,系统会读取此文件挂载磁盘。

2. 时间同步服务同步问题

如果在部署时报出如下错误,有两个原因,一个是服务器中未启动ntp服务,另一个是启动了但没有及时同步。

TASK [check_config_dynamic : Preflight check - fail when NTP service is not running or ntpstat is not synchronised to NTP server] ***************************************************
fatal: [10.222.222.36]: FAILED! => {"changed": false, "cmd": "ntpstat | grep -w synchronised | wc -l", "delta": "0:00:00.098635", "end": "2018-03-02 13:33:31.529697", "failed_when_result": true, "rc": 0, "start": "2018-03-02 13:33:31.431062", "stderr": "", "stderr_lines": [], "stdout": "0", "stdout_lines": ["0"]}
fatal: [10.222.222.35]: FAILED! => {"changed": false, "cmd": "ntpstat | grep -w synchronised | wc -l", "delta": "0:00:00.113097", "end": "2018-03-02 13:33:31.635350", "failed_when_result": true, "rc": 0, "start": "2018-03-02 13:33:31.522253", "stderr": "", "stderr_lines": [], "stdout": "0", "stdout_lines": ["0"]}
fatal: [10.222.222.34]: FAILED! => {"changed": false, "cmd": "ntpstat | grep -w synchronised | wc -l", "delta": "0:00:00.113614", "end": "2018-03-02 13:33:31.644088", "failed_when_result": true, "rc": 0, "start": "2018-03-02 13:33:31.530474", "stderr": "", "stderr_lines": [], "stdout": "0", "stdout_lines": ["0"]}

对于第一重问题,运行命令:

$ sudo systemctl start ntpd.service

如果提示没有发现ntpd.service,通过一下命令安装:

$ sudo yum install ntp

检查ntp状态:

$ ntpstat

如果正常的话,会返回如下结果,重点是(词synchronised-同步):

synchronised to NTP server (85.199.214.101) at stratum 2
   time correct to within 91 ms
   polling server every 1024 s

3. 简单安装,需要的机器数以及内存和磁盘要求

本人使用的虚拟机安装的,创建了4台虚机, 每个虚拟机分配2GB的内存,动态30G的磁盘。

4台机器分配:1 台安装TiDB Server和PD,3台安装TiKV。

30G的磁盘,会被用掉23G多点。

(遇到其他问题,欢迎交流)
















猜你喜欢

转载自blog.csdn.net/leon_founder/article/details/79425746