常用自动化部署方案比较
| 名称 | 实现语言 | 发布时间 | 架构 | DSL (区域特定语言) |
|---|---|---|---|---|
| SaltStack | Python | 2011 | C/S | yaml |
| Ansible | Python | 2012 | Agentless | yaml |
| Puppet | Ruby | 2009 | C/S | Puppet Language |
| Chef | Ruby | 2005 | C/S | 接近Ruby语法的Dsl |
环境准备
在部署 Ceph 存储集群之前,需要对Ceph 客户端和Ceph 节点进行一些基本的配置。安装一个ceph-ansible 管理节点和若干节点的Ceph存储集群来研究 Ceph 的基本特性。此处准备四个Ceph节点(其中adm节点充当ceph-ansible管理节点),以此构成 Ceph存储集群。
| 主机名称 | IP地址 | 操作系统 | 备注 |
|---|---|---|---|
| adm | 100.10.10.163 | ubuntu-18.04.3-server-amd64.iso | ceph-ansible管理节点 |
| N1 | 100.10.10.160/100.10.11.160 | ubuntu-18.04.3-server-amd64.iso | 专用节点 |
| N2 | 100.10.10.161/100.10.11.161 | ubuntu-18.04.3-server-amd64.iso | 专用节点 |
| N3 | 100.10.10.162/100.10.11.162 | ubuntu-18.04.3-server-amd64.iso | 专用节点 |
未特别说明,则操作需在每个节点上执行
添加keys
将密钥添加到系统的受信任密钥列表中,以避免出现安全警告。 对于主要发行版(例如luminous, mimic, nautilus)和开发发行版(release-name-rc1, release-name-rc2),请使用release.asc密钥。
要安装release.asc密钥,请执行以下操作:
# wget -q -O- 'http://100.10.10.163/ceph/keys/release.asc' | sudo apt-key add -
# wget -q -O- 'http://100.10.10.163/os/18.04_LTS/debs.asc' | sudo apt-key add -
# apt-key list
/etc/apt/trusted.gpg
--------------------
pub rsa4096 2015-09-15 [SC]
08B7 3419 AC32 B4E9 66C1 A330 E84A C2C0 460F 3994
uid [ unknown] Ceph.com (release key) <security@ceph.com>
添加CEPH
将Ceph软件包库添加到系统的APT来源列表中。 对于较新版本的Debian/Ubuntu,请在命令行上调用lsb_release -sc以获取简短的代号。
# cp /etc/apt/sources.list /etc/apt/sources.list.org
# > /etc/apt/sources.list
# sudo apt-add-repository 'deb http://100.10.10.163/ceph/debian-nautilus/ bionic main'
# apt-get update -y
修改/etc/hosts文件
# vim /etc/hosts
127.0.0.1 localhost
100.10.10.160 N1
100.10.10.161 N2
100.10.10.162 N3
100.10.10.163 adm
配置ssh免密登录
在adm节点执行以下命令,
# ssh-keygen -t rsa -P ''
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:w3exfRZVT5yUhWGDS0KlJFSXkGOBRB52DY2wXJZfNdI
The key's randomart image is:
+---[RSA 2048]----+
| +O=@@o+*B@|
| +.OBo*.+E=|
| +..=.o ..|
| . o+ .|
| S . o . o|
| o . o |
| |
| |
| |
+----[SHA256]-----+
# ssh-copy-id 100.10.10.160
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@100.10.10.160's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh '100.10.10.160'"
and check to make sure that only the key(s) you wanted were added.
# ssh-copy-id 100.10.10.161
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to

本文详细介绍使用Ceph-ansible进行Ceph存储集群自动化部署的全过程,包括环境准备、节点配置、SSH免密登录、时间同步、软件包安装及Ceph-ansible配置等关键步骤。
&spm=1001.2101.3001.5002&articleId=103961098&d=1&t=3&u=7f93a5427ca54a5db0fcff817050a4fd)
4644

被折叠的 条评论
为什么被折叠?



