Ceph cluster configure introduce - 1

简介:
ceph存储集群运行需要osd和mon模块, 如果要使用对象存储, 需要添加radosgw模块, 如果需要使用ceph 文件系统需要添加mds模块.
这些模块在启动时, 需要读取配置文件, ceph所有类型的daemon配置文件统一放在一个配置文件中, 配置文件的顺序如下 :
The default Ceph configuration file locations in sequential order include:
$CEPH_CONF (i.e., the path following the $CEPH_CONF environment variable)
-c path/path (i.e., the -c command line argument)
/etc/ceph/ceph.conf
~/.ceph/config
./ceph.conf (i.e., in the current working directory)

以上配置文件ceph.conf指集群名为ceph的配置文件, 如果集群名为其他如openstack, 那么配置文件名为openstack.conf.

在配置文件中未配置的参数, CEPH在头文件中定义了一些默认值,  默认值在如下文件中定义 :
ceph/src/common/config_opts.h

Ceph存储集群的配置包含哪些内容呢? 大致如下 : 
Cluster Identity  (uuid)
Authentication settings  认证
Cluster membership
Host names
Host addresses
Paths to keyrings  KEY文件路径
Paths to journals   osd journal路径
Paths to data   DATA路径
Other runtime options

配置文件注释, ;或#开头. 例如 : 
# <--A number (#) sign precedes a comment.
; A comment may be anything.
# Comments always follow a semi-colon (;) or a pound (#) on each line.
# The end of the line terminates a comment.
# We recommend that you provide comments in your configuration file(s).

前面说了, 所有的ceph存储集群daemon使用同一个配置文件, 那么要区分不同daemon的配置, 使用section来区分.
例如 :
全局配置, 一般用于配置公共项, 可以被其他章节的配置覆盖.
[global]

Description:	Settings under [global] affect all daemons in a Ceph Storage Cluster.
Example:	auth supported = cephx
object storage devices daemon配置
[osd]

Description:	Settings under [osd] affect all ceph-osd daemons in the Ceph Storage Cluster, and override the same setting in [global].
Example:	osd journal size = 1000
monitor daemon配置 
[mon]

Description:	Settings under [mon] affect all ceph-mon daemons in the Ceph Storage Cluster, and override the same setting in [global].
Example:	mon addr = 10.0.0.101:6789
metadata storage daemon配置 
[mds]

Description:	Settings under [mds] affect all ceph-mds daemons in the Ceph Storage Cluster, and override the same setting in [global].
Example:	host = myserver01
客户端配置
[client]

Description:	Settings under [client] affect all Ceph Clients (e.g., mounted Ceph Filesystems, mounted Ceph Block Devices, etc.).
Example:	log file = /var/log/ceph/radosgw.log


针对daemon还支持不同的instance使用不同的配置, 例如一台机器启动了多个osd daemon, 可以对每个daemon配置不同的参数.
You may specify settings for particular instances of a daemon. You may specify an instance by entering its type, delimited by a period (.) and by the instance ID. The instance ID for a Ceph OSD Daemon is always numeric, but it may be alphanumeric for Ceph Monitors and Ceph Metadata Servers.
[osd.1]
# settings affect osd.1 only.

[mon.a]
# settings affect mon.a only.

[mds.b]
# settings affect mds.b only.

# osd instance id必须是数字, mon和mds的instance可以是数字字母.

# 客户端配置同样支持不同的客户端使用不同的配置.
[client.radosgw.instance-name]
# settings affect client.radosgw.instance-name only.


优先级
全局 配置<daemon 配置<daemon.process 配置
优先级高的配置将覆盖优先级低的配置.

配置文件中可以使用的变量, 包括集群名, daemon类型, instance id, 主机名, daemon_instance_id组合. :
Metavariables simplify Ceph Storage Cluster configuration dramatically. When a metavariable is set in a configuration value, Ceph expands the metavariable into a concrete value. Metavariables are very powerful when used within the [global], [osd], [mon], [mds] or [client] sections of your configuration file. Ceph metavariables are similar to Bash shell expansion.

Ceph supports the following metavariables:

$cluster

Description:	Expands to the Ceph Storage Cluster name. Useful when running multiple Ceph Storage Clusters on the same hardware.
Example:	/etc/ceph/$cluster.keyring
Default:	ceph
$type

Description:	Expands to one of mds, osd, or mon, depending on the type of the instant daemon.
Example:	/var/lib/ceph/$type
$id

Description:	Expands to the daemon identifier. For osd.0, this would be 0; for mds.a, it would be a.
Example:	/var/lib/ceph/$type/$cluster-$id
$host

Description:	Expands to the host name of the instant daemon.
$name

Description:	Expands to $type.$id.
Example:	/var/run/ceph/$cluster-$name.asok


[参考]
目录
相关文章
|
存储 运维 云计算
深度解析云计算计费方式,看完这篇全懂了!
深度解析云计算计费方式,看完这篇全懂了! 随着科技的飞速发展,云计算已经成为了我们生活中不可或缺的一部分。然而,对于云计算的计费方式,你是否感到困惑呢?这篇文章将为你深度解析云计算的计费方式,让你看完之后全懂了!
1093 1
|
移动开发 Java HTML5
Springboot web静态资源配置
Springboot web静态资源配置
864 0
|
应用服务中间件 nginx
Nginx rewrite(URL)地址重定向
Nginx rewrite(URL)地址重定向
942 0
|
缓存 运维 安全
云巧组件标准
可组装式应用的理论,结合了云原生的理念和交付质量要求,云巧对云巧组件设计了六大维度的标准。根据这六大维度名称的英文首字母组成单词ACCORD
2724 0
|
9月前
|
存储 人工智能 运维
idc机房智能运维解决方案
华汇数据中心一体化智能运维方案应运而生,以“自主可控、精准洞察、智能决策”三大核心能力,助力企业实现运维效率提升与综合成本下降的数字化转型目标。
539 24
|
Python
【Leetcode刷题Python】53. 最大子数组和
LeetCode第53题"最大子数组和"的Python解决方案,利用动态规划的思想,通过一次遍历数组并维护当前最大和以及全局最大和来求解。
327 2
|
前端开发 JavaScript 开发者
Bootstrap 3.x 版本基础引入指南
Bootstrap 3.x 版本基础引入指南
548 0
|
存储 SQL 监控
【Clickhouse 探秘】你真正知道 Clickhouse 吗?
ClickHouse 是一个开源的列式数据库管理系统,专为在线分析处理(OLAP)设计。它由 Yandex 开发并于 2016 年开源。ClickHouse 以其高性能、实时数据处理能力和易用性著称,广泛应用于大数据分析、日志处理和用户行为分析等领域。其主要特点包括列式存储、向量化执行、分布式架构、丰富的数据类型和 SQL 支持。
1405 4
|
SQL 存储 关系型数据库
SQL文件导入MySQL数据库的详细指南
数据库中的数据转移是一项常规任务,无论是在数据迁移过程中,还是在数据备份、还原场景中,导入导出SQL文件显得尤为重要。特别是在使用MySQL数据库时,如何将SQL文件导入数据库是一项基本技能。本文将详细介绍如何将SQL文件导入MySQL数据库,并提供一个清晰、完整的步骤指南。这篇文章的内容字数大约在
1425 1
|
传感器 Linux API
远程处理器消息框架(RPMSG) 【ChatGPT】
远程处理器消息框架(RPMSG) 【ChatGPT】