运用 ceph-ansible 安排 Ceph
使用 Ceph 的 Ansible 仓库可以让部署变得顺畅简单 1、复制 ssh 密钥到所有服务器我在所有的服务器上都有一个名为 cephadmin 的共同用户(在此背景下,每个树莓派都是一台服务器)。cephadmin 用户配置了无密码的 sudo,以方便工作。 使用 ssh-keygen 生成密钥后,使用 ssh-copy-id 部署所有密钥。 我使用了一个 Bash for 循环,因为我使用的是一致并递增的主机名: $ for i in{0..3}; dossh-copy-id cephadmin@rpi4b4-$i; done 你需要每个接受并输入密码,但你可以用 expect 来自动完成。 2、克隆 ceph-ansible 并安装依赖安装 Git 来克隆仓库: $ sudoyum install git-y 克隆 ceph-ansible 仓库: $ gitclone https://github.com/ceph/ceph-ansible.git $ cd ceph-ansible/ 我使用的是 CentOS 7 的 AArch64 构建,所以在继续之前,我必须安装一些所需的包。 首先安装 Python pip: $ sudoyum install python3-pip -y 接着是 ceph-ansible 需要的包: $ sudoyum install python3-devel libffi-devel openssl-devel -y 最后,ceph-ansible 需要的依赖: $ pip3 install -r requirements.txt --user 我收到了这个错误: You are linking against OpenSSL1.0.2, which isno longer supported by the OpenSSL project. Tousethis version of cryptography you need to upgrade to a newer version of OpenSSL.For this version only you can also set the environment variable CRYPTOGRAPHY_ALLOW_OPENSSL_102 to allow OpenSSL1.0.2. 这可能与架构有关,因为我无法在 CentOS 7 虚拟机中复现该错误。 部署时,将 CRYPTOGRAPHY_ALLOW_OPENSSL_102 导出为 True,这样 Ansible 就可以运行了。 $ export CRYPTOGRAPHY_ALLOW_OPENSSL_102=True 3、配置 ceph-ansible 进行部署现在你可以使用 ceph-ansible 部署 Ceph 了。 复制 site.yml.sample 到 site.yml: $ mv site.yml.sample site.yml 在 group_vars 目录下创建 all.yml: $ cat<< EOF >> group_vars/all.yml ceph_origin: repository ceph_repository: community ceph_repository_type: cdn ceph_stable_release: nautilus monitor_interface: wlan0 public_network:"192.168.100.0/24" cluster_network:"192.168.100.0/24" dashboard_enabled:false configure_firewall:false EOF 在 group_vars 目录下创建 osds.yml: $ cat<< EOF >> group_vars/all.yml osd_scenario: collocated devices: -/dev/sda -/dev/sdb EOF 创建一个 inventory 文件: $ cat<< EOF >> inventory [mons] (编辑:威海站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |