TMAegis
Thêm quy tắc cho cockroachdb

TMA-COCKROACHDB-2.7

Set the File Descriptor Limit to at Least 15,000 to Accommodate Cluster Growth

Trung bìnhCấp 1Tự độngcockroachdb

Mô tả

CockroachDB can use a large number of open file descriptors, often more than is available by default. Therefore, note the following recommendations. For each CockroachDB node: - At a minimum, the file descriptors limit must be 1956 (1700 per store plus 256 for networking). If the limit is below this threshold, the node will not start. - It is recommended to set the file descriptors limit to unlimited; The benchmark rates this recommendation Manual; the automated check covers its objective pass criterion. Reads the hard "Max open files" limit of the running cockroach process; it must be unlimited or at least 15000.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

shell
pid=$(pgrep -o -x cockroach) || exit 1; awk '/^Max open files/ {print ($5 == "unlimited" || $5 + 0 >= 15000) ? "compliant" : "hard limit " $5}' /proc/$pid/limits
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

Set LimitNOFILE=35000 (at least 15000) in the [Service] section of cockroach.service (or a hard nofile limit in /etc/security/limits.conf for non-systemd setups), raise fs.file-max if needed, then restart the node.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
cockroachdbos
Tham chiếu
CIS CockroachDB v25.x Benchmark v1.0.0 - 2.7 Set the File Descriptor Limit to at Least 15,000 to Accommodate Cluster Growth

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target cockroachdb