1 Ceph 配置Ceph集群
Install Distributed File System "Ceph" to Configure Storage Cluster.
For example on here, Configure Cluster with 1 admin Node and 3 Storage Node like follows.
|
+--------------------+ | +-------------------+
| [dlp.srv.world] |10.0.0.30 | 10.0.0.x| [ Client ] |
| Ceph-Deploy +-----------+-----------+ |
| | | | |
+--------------------+ | +-------------------+
+----------------------------+----------------------------+
| | |
|10.0.0.51 |10.0.0.52 |10.0.0.53
+-----------+-----------+ +-----------+-----------+ +-----------+-----------+
| [node01.srv.world] | | [node02.srv.world] | | [node03.srv.world] |
| Object Storage +----+ Object Storage +----+ Object Storage |
| Monitor Daemon | | | | |
| | | | | |
+-----------------------+ +-----------------------+ +-----------------------+ [1] Add a user for Ceph admin on all Nodes.
It adds "cent" user on this exmaple. [2] Grant root priviledge to Ceph admin user just added above with sudo settings.
And also install required packages.
Furthermore, If Firewalld is running on all Nodes, allow SSH service.
Set all of above on all Nodes.
[root@dlp ~]# echo -e 'Defaults:cent !requiretty\ncent ALL = (root) NOPASSWD:ALL' | tee /etc/sudoers.d/ceph
[root@dlp ~]# chmod 440 /etc/sudoers.d/ceph
[root@dlp ~]# yum -y install centos-release-ceph-hammer epel-release yum-plugin-priorities
[root@dlp ~]# sed -i -e "s/enabled=1/enabled=1\npriority=1/g" /etc/yum.repos.d/CentOS-Ceph-Hammer.repo
[root@dlp ~]# firewall-cmd --add-service=ssh --permanent
[root@dlp ~]# firewall-cmd –reload [3] On Monitor Node (Monitor Daemon), If Firewalld is running, allow required port.
[root@dlp ~]# firewall-cmd --add-port=6789/tcp --permanent
[root@dlp ~]# firewall-cmd –reload [4] On Storage Nodes (Object Storage), If Firewalld is running, allow required ports.
[root@dlp ~]# firewall-cmd --add-port=6800-7100/tcp --permanent
[root@dlp ~]# firewall-cmd –reload [4] Login as a Ceph admin user and configure Ceph.
Set SSH key-pair from Ceph Admin Node (it's "dlp.srv.world" on this example) to all storage Nodes.
[cent@dlp ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/cent/.ssh/id_rsa):
Created directory '/home/cent/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/cent/.ssh/id_rsa.
Your public key has been saved in /home/cent/.ssh/id_rsa.pub.
The key fingerprint is:
54:c3:12:0e:d3:65:11:49:11:73:35:1b:e3:e8:63:5a cent@dlp.srv.world
The key's randomart image is:
[cent@dlp ~]$ vi ~/.ssh/config
# create new ( define all nodes and users )
Host dlp
Hostname dlp.srv.world
User cent
Host node01
Hostname node01.srv.world
User cent
Host node02
Hostname node02.srv.world
User cent
Host node03
Hostname node03.srv.world
User cent