04-参数优化(Ceph Pacific)
1. 操作系统
# cat /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
kernel.pid_max=4194304
fs.file-max=26345836
vm.swappiness=0
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 16384 16777216
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
[root@ceph-test-node-0 ceph-cluster]# cat /etc/security/limits.d/ceph.conf
* soft nofile 655360
* hard nofile 655360
* soft nproc 655350
* hard nproc 655350
* soft memlock unlimited
* hard memlock unlimited
2. 存储系统
[root@ceph-test-node-0 ceph-cluster]# cat init-ceph.conf
[global]
#All clusters have a front-side public network.
#If you have two NICs, you can configure a back side cluster
#network for OSD object replication, heart beats, backfilling,
#recovery, etc.
public network = 172.16.0.0/24
cluster network = 10.0.0.0/24
#Clusters require authentication by default.
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
#Choose reasonable numbers for your journals, number of replicas
#and placement groups.
osd pool default size = 3 # Write an object n times.
osd pool default min size = 2 # Allow writing n copy in a degraded state.
osd pool default pg num = 32
osd pool default pgp num = 32
#Choose a reasonable crush leaf type.
#0 for a 1-node cluster.
#1 for a multi node cluster in a single rack
#2 for a multi node, multi chassis cluster with multiple hosts in a chassis
#3 for a multi node cluster with hosts across racks, etc.
osd crush chooseleaf type = 1
[mon]
# 监视器之间允许的时钟漂移,以秒为单位,默认值为0.05s
mon clock drift allowed = 2
# 时钟漂移警告的指数退避,默认值为5s
mon clock drift warn backoff = 10
# 禁止删除存储池
mon allow pool delete = false
[mgr]
mgr/cephadm/container_image_prometheus registry.local:5000/prometheus
mgr/cephadm/container_image_node_exporter registry.local:5000/node_exporter
mgr/cephadm/container_image_grafana registry.local:5000/grafana
mgr/cephadm/container_image_alertmanager registry.local:5000/alertmanger
[osd]
# 可以执行预定清理时的下限时间,默认值为0
osd scrub begin hour = 0
# 可以执行预定清理时的上限时间,默认值为24
osd scrub end hour = 7
[client]
# 启用RADOS块设备(RBD)的缓存,默认启用
rbd cache = true
# 从直写模式开始,并在收到第一个刷新请求后切换回写。
# 启用此选项是一种保守但安全的设置,以防在rbd上运行的VM太旧而无法发送刷新,例如2.6.32之前的Linux中的virtio驱动程序,默认启用
rbd cache writethrough until flush = true