Skip to main content
Version: v3&v6

环境检测

环境检测的脚本需要 root 用户权限执行

sudo su -

1. 下载环境检测脚本

离线/在线使用方式一致,如果是离线环境,提前下载好手动上传到离线服务器执行即可。

x86 架构

curl -O  "https://ones-cn-package.oss-cn-shenzhen.aliyuncs.com/release/envcheck/$(curl -Ls https://ones-cn-package.oss-cn-shenzhen.aliyuncs.com/release/envcheck/latest.txt)/linux/amd64/envcheck.tar"

arm 架构

curl -O  "https://ones-cn-package.oss-cn-shenzhen.aliyuncs.com/release/envcheck/$(curl -Ls https://ones-cn-package.oss-cn-shenzhen.aliyuncs.com/release/envcheck/latest.txt)/linux/arm64/envcheck.tar"

2. 解压环境检测脚本

tar -xvf envcheck.tar

3. 执行环境检测脚本

默认检测的 ONES 安装目录为 /data/ones。如果你的安装目录不是 /data/ones,请使用 --data-path 参数指定 ONES 安装目录。提示安装目录不存在时,手动创建目录。

小型客户场景

chmod +x envcheck && ./envcheck

中型客户场景

chmod +x envcheck && ./envcheck  --cpu-cores 16 --data-disk-size 100GB --mem-size 32GB

4. 查看环境检测结果

可以根据检测结果议进行相关配置和硬件资源调整。

检测结果示例如下:

******** check report ********
+------------------------------+-------------------------------------------------------------------------------------+---------+-----------------------------------------------------------------+
| CHECK ITEM | VALUE | RESULT | REASON |
+------------------------------+-------------------------------------------------------------------------------------+---------+-----------------------------------------------------------------+
| CPU core | arch: amd64, cores: 8 | passed | |
| Memory | 15.0GB | no pass | Memory size needs >= 16.0GB. |
| DiskAvail: /data/ones | path: /data/ones is in disk (mounted on /data, fstype: ext4 available size:143.6GB) | passed | |
| DiskAvail: /var/lib | path: /var/lib is in disk (mounted on /, fstype: ext4 available size:32.0GB) | no pass | disk (mounted on /) available size <= 100.0GB, please check it. |
| IO: /data/ones | seq-read: 136.0MB/s, seq-write: 98.2MB/s | passed | |
| IO: /var/lib | seq-read: 113.0MB/s, seq-write: 75.4MB/s | passed | |
| OS | centos 7.8.2003 | passed | |
| kernel | 3.10.0-1127.19.1.el7.x86_64 | passed | |
| port | | passed | |
| swap | off | passed | |
| SELinux | Disabled | passed | |
| umask | 0022 | passed | |
| Transparent-Hugepage Enabled | madvise | passed | |
| firewalld | inactive | passed | |
| iptables | accept | passed | |
| sysctl | net.ipv4.tcp_syncookies = 1 | no pass | net.ipv4.tcp_tw_reuse != 1 |
| | | | net.ipv4.tcp_tw_recycle != 1 |
| | | | net.ipv4.tcp_fin_timeout != 30 |
| | | | |
+------------------------------+-------------------------------------------------------------------------------------+---------+-----------------------------------------------------------------+
******************************
******** fix solution ********
+---------------------+-----------------------------------------------+
| CHECK ITEM | FIX SOLUTION |
+---------------------+-----------------------------------------------+
| Memory | Please add more memory. |
| DiskAvail: /var/lib | Disk expansion for disk (mounted on /var/lib) |
| sysctl | Please check sysctl configs. |
+---------------------+-----------------------------------------------+
******************************
ERROR 2023/12/11 11:45:34 some checks failed

5. 修改域名解析

基于Ubuntu22,执行如下操作

///删除ubuntu的/etc/resolv.conf 软连接

rm /etc/resolv.conf

///编辑文件,添加可用DNS域名(咨询客户确认) vi /etc/resolv.conf

nameserver 223.5.5.5

nameserver 223.6.6.6

///为了避免 sudo 报主机域名找不到的情况,可以编辑 /etc/hosts, 把主机域名加进去,比如 vi /etc/hosts

192.168.1.100 k8s-node-01