INSTALLATION (CEPH-DEPLOY)
A Ceph Client and a Ceph Node may require some basic configuration work prior to deploying a Ceph Storage Cluster. You can also avail yourself of help by getting involved in the Ceph community.
Once you have completed your preflight checklist, you should be able to begin deploying a Ceph Storage Cluster.
Most Ceph users don’t store objects directly in the Ceph Storage Cluster. They typically use at least one of Ceph Block Devices, the Ceph Filesystem, and Ceph Object Storage.
The ceph-deploy tool operates out of a directory on an admin node. Any host with network connectivity and a modern python environment and ssh (such as Linux) should work.
In the descriptions below, Node refers to a single machine.
Add Ceph repositories to the ceph-deploy admin node. Then, install ceph-deploy.
For Debian and Ubuntu distributions, perform the following steps:
Note
You can also use the EU mirror eu.ceph.com for downloading your packages by replacing https://ceph.com/ by http://eu.ceph.com/
For CentOS 7, perform the following steps:
Please see the EPEL wiki page for more information.
Note
You can also use the EU mirror eu.ceph.com for downloading your packages by replacing https://ceph.com/ by http://eu.ceph.com/
The Ceph project does not currently publish release RPMs for openSUSE, but a stable version of Ceph is included in the default update repository, so installing it is just a matter of:
sudo zypper install ceph
sudo zypper install ceph-deploy
If the distro version is out-of-date, open a bug at https://bugzilla.opensuse.org/index.cgi and possibly try your luck with one of the following repositories:
The admin node must have password-less SSH access to Ceph nodes. When ceph-deploy logs in to a Ceph node as a user, that particular user must have passwordless sudo privileges.
We recommend installing NTP on Ceph nodes (especially on Ceph Monitor nodes) to prevent issues arising from clock drift. See Clock for details.
On CentOS / RHEL, execute:
sudo yum install ntp ntpdate ntp-doc
On Debian / Ubuntu, execute:
sudo apt install ntp
Ensure that you enable the NTP service. Ensure that each Ceph Node uses the same NTP time server. See NTP for details.
For ALL Ceph Nodes perform the following steps:
or:
sudo yum install openssh-server
The ceph-deploy utility must login to a Ceph node as a user that has passwordless sudo privileges, because it needs to install software and configuration files without prompting for passwords.
Recent versions of ceph-deploy support a --username option so you can specify any user that has password-less sudo (including root, although this is NOT recommended). To use ceph-deploy
--username
{username}, the user you specify must have password-less SSH access to the Ceph node, as ceph-deploy will not prompt you for a password.
We recommend creating a specific user for ceph-deploy on ALL Ceph nodes in the cluster. Please do NOT use “ceph” as the user name. A uniform user name across the cluster may improve ease of use (not required), but you should avoid obvious user names, because hackers typically use them with brute force hacks (e.g., root, admin, {productname}). The following procedure, substituting {username} for the user name you define, describes how to create a user with passwordless sudo.
Note
Starting with the Infernalis release the “ceph” user name is reserved for the Ceph daemons. If the “ceph” user already exists on the Ceph nodes, removing the user must be done before attempting an upgrade.
Since ceph-deploy will not prompt for a password, you must generate SSH keys on the admin node and distribute the public key to each Ceph node. ceph-deploy will attempt to generate the SSH keys for initial monitors.
{username} each time you execute ceph-deploy. This has the added benefit of streamlining ssh and scp usage. Replace {username} with the user name you created:Ceph OSDs peer with each other and report to Ceph Monitors over the network. If networking is off by default, the Ceph cluster cannot come online during bootup until you enable networking.
The default configuration on some distributions (e.g., CentOS) has the networking interface(s) off by default. Ensure that, during boot up, your network interface(s) turn(s) on so that your Ceph daemons can communicate over the network. For example, on Red Hat and CentOS, navigate to /etc/sysconfig/network-scripts and ensure that the ifcfg-{iface} file has ONBOOT set to yes.
Ensure connectivity using ping with short hostnames (hostname
-s). Address hostname resolution issues as necessary.
Note
Hostnames should resolve to a network IP address, not to the loopback IP address (e.g., hostnames should resolve to an IP address other than 127.0.0.1). If you use your admin node as a Ceph node, you should also ensure that it resolves to its hostname and IP address (i.e., not its loopback IP address).
Ceph Monitors communicate using port 6789 by default. Ceph OSDs communicate in a port range of 6800:7300 by default. See the Network Configuration Reference for details. Ceph OSDs can use multiple network connections to communicate with clients, monitors, other OSDs for replication, and other OSDs for heartbeats.
On some distributions (e.g., RHEL), the default firewall configuration is fairly strict. You may need to adjust your firewall settings allow inbound requests so that clients in your network can communicate with daemons on your Ceph nodes.
For firewalld on RHEL 7, add the ceph-mon service for Ceph Monitor nodes and the ceph service for Ceph OSDs and MDSs to the public zone and ensure that you make the settings permanent so that they are enabled on reboot.
For example, on monitors:
sudo firewall-cmd --zone=public --add-service=ceph-mon --permanent
and on OSDs and MDSs:
sudo firewall-cmd --zone=public --add-service=ceph --permanent
Once you have finished configuring firewalld with the --permanent flag, you can make the changes live immediately without rebooting:
sudo firewall-cmd --reload
For iptables, add port 6789 for Ceph Monitors and ports 6800:7300 for Ceph OSDs. For example:
sudo iptables -A INPUT -i {iface} -p tcp -s {ip-address}/{netmask} --dport 6789 -j ACCEPT
Once you have finished configuring iptables, ensure that you make the changes persistent on each node so that they will be in effect when your nodes reboot. For example:
/sbin/service iptables save
On CentOS and RHEL, you may receive an error while trying to execute ceph-deploy commands. If requiretty is set by default on your Ceph nodes, disable it by executing sudo
visudo and locate the Defaults
requiretty setting. Change it to Defaults:ceph
!requiretty or comment it out to ensure that ceph-deploy can connect using the user you created with Create a Ceph Deploy User.
Note
If editing, /etc/sudoers, ensure that you use sudo
visudo rather than a text editor.
On CentOS and RHEL, SELinux is set to Enforcing by default. To streamline your installation, we recommend setting SELinux to Permissive or disabling it entirely and ensuring that your installation and cluster are working properly before hardening your configuration. To set SELinux to Permissive, execute the following:
sudo setenforce 0
To configure SELinux persistently (recommended if SELinux is an issue), modify the configuration file at /etc/selinux/config.
Ensure that your package manager has priority/preferences packages installed and enabled. On CentOS, you may need to install EPEL. On RHEL, you may need to enable optional repositories.
sudo yum install yum-plugin-priorities
For example, on RHEL 7 server, execute the following to install yum-plugin-priorities and enable the rhel-7-server-optional-rpms repository:
sudo yum install yum-plugin-priorities --enablerepo=rhel-7-server-optional-rpms
This completes the Quick Start Preflight. Proceed to the Storage Cluster Quick Start.
If you haven’t completed your Preflight Checklist, do that first. This Quick Start sets up a Ceph Storage Cluster using ceph-deploy on your admin node. Create a three Ceph Node cluster so you can explore Ceph functionality.
As a first exercise, create a Ceph Storage Cluster with one Ceph Monitor and three Ceph OSD Daemons. Once the cluster reaches a active
+
clean state, expand it by adding a fourth Ceph OSD Daemon, a Metadata Server and two more Ceph Monitors. For best results, create a directory on your admin node for maintaining the configuration files and keys that ceph-deploy generates for your cluster.
mkdir my-cluster
cd my-cluster
The ceph-deploy utility will output files to the current directory. Ensure you are in this directory when executing ceph-deploy.
Important
Do not call ceph-deploy with sudo or run it as root if you are logged in as a different user, because it will not issue sudo commands needed on the remote host.
If at any point you run into trouble and you want to start over, execute the following to purge the Ceph packages, and erase all its data and configuration:
ceph-deploy purge {ceph-node} [{ceph-node}]
ceph-deploy purgedata {ceph-node} [{ceph-node}]
ceph-deploy forgetkeys
rm ceph.*
If you execute purge, you must re-install Ceph. The last rm command removes any files that were written out by ceph-deploy locally during a previous installation.
On your admin node from the directory you created for holding your configuration details, perform the following steps using ceph-deploy.
Specify node(s) as hostname, fqdn or hostname:fqdn. For example:
ceph-deploy new node1
Check the output of ceph-deploy with ls and cat in the current directory. You should see a Ceph configuration file (ceph.conf), a monitor secret keyring (ceph.mon.keyring), and a log file for the new cluster. See ceph-deploy new -h for additional details.
network setting under the [global] section of your Ceph configuration file. See the Network Configuration Reference for details.For example,:
public network = 10.1.2.0/24
to use IPs in the 10.1.2.0/24 (or 10.1.2.0/255.255.255.0) network.
For example:
ceph-deploy install node1 node2 node3
The ceph-deploy utility will install Ceph on each node.
Once you complete the process, your local directory should have the following keyrings:
Note
If this process fails with a message similar to “Unable to find /etc/ceph/ceph.client.admin.keyring”, please ensure that the IP listed for the monitor node in ceph.conf is the Public IP, not the Private IP.
For example:
ceph-deploy admin node1 node2 node3
For example:
ceph-deploy osd create --data /dev/vdb node1
ceph-deploy osd create --data /dev/vdb node2
ceph-deploy osd create --data /dev/vdb node3
Your cluster should report HEALTH_OK. You can view a more complete cluster status with:
ssh node1 sudo ceph -s
Once you have a basic cluster up and running, the next step is to expand cluster. Add a Ceph Metadata Server to node1. Then add a Ceph Monitor and Ceph Manager to node2 and node3 to improve reliability and availability.
To use CephFS, you need at least one metadata server. Execute the following to create a metadata server:
ceph-deploy mds create {ceph-node}
For example:
ceph-deploy mds create node1
A Ceph Storage Cluster requires at least one Ceph Monitor and Ceph Manager to run. For high availability, Ceph Storage Clusters typically run multiple Ceph Monitors so that the failure of a single Ceph Monitor will not bring down the Ceph Storage Cluster. Ceph uses the Paxos algorithm, which requires a majority of monitors (i.e., greather than N/2 where N is the number of monitors) to form a quorum. Odd numbers of monitors tend to be better, although this is not required.
Add two Ceph Monitors to your cluster:
ceph-deploy mon add {ceph-nodes}
For example:
ceph-deploy mon add node2 node3
Once you have added your new Ceph Monitors, Ceph will begin synchronizing the monitors and form a quorum. You can check the quorum status by executing the following:
ceph quorum_status --format json-pretty
Tip
When you run Ceph with multiple monitors, you SHOULD install and configure NTP on each monitor host. Ensure that the monitors are NTP peers.
The Ceph Manager daemons operate in an active/standby pattern. Deploying additional manager daemons ensures that if one daemon or host fails, another one can take over without interrupting service.
To deploy additional manager daemons:
ceph-deploy mgr create node2 node3
You should see the standby managers in the output from:
ssh node1 sudo ceph -s
To use the Ceph Object Gateway component of Ceph, you must deploy an instance of RGW. Execute the following to create an new instance of RGW:
ceph-deploy rgw create {gateway-node}
For example:
ceph-deploy rgw create node1
By default, the RGW instance will listen on port 7480. This can be changed by editing ceph.conf on the node running the RGW as follows:
[client]
rgw frontends = civetweb port=80
To use an IPv6 address, use:
[client]
rgw frontends = civetweb port=[::]:80
To store object data in the Ceph Storage Cluster, a Ceph client must:
The Ceph Client retrieves the latest cluster map and the CRUSH algorithm calculates how to map the object to a placement group, and then calculates how to assign the placement group to a Ceph OSD Daemon dynamically. To find the object location, all you need is the object name and the pool name. For example:
ceph osd map {poolname} {object-name}
Exercise: Locate an Object
As an exercise, lets create an object. Specify an object name, a path to a test file containing some object data and a pool name using the rados
put command on the command line. For example:
echo {Test-data} > testfile.txt
ceph osd pool create mytest 8
rados put {object-name} {file-path} --pool=mytest
rados put test-object-1 testfile.txt --pool=mytest
To verify that the Ceph Storage Cluster stored the object, execute the following:
rados -p mytest ls
Now, identify the object location:
ceph osd map {pool-name} {object-name}
ceph osd map mytest test-object-1
Ceph should output the object’s location. For example:
osdmap e537 pool 'mytest' (1) object 'test-object-1' -> pg 1.d1743484 (1.4) -> up [1,0] acting [1,0]
To remove the test object, simply delete it using the rados
rm command.
For example:
rados rm test-object-1 --pool=mytest
To delete the mytest pool:
ceph osd pool rm mytest
(For safety reasons you will need to supply additional arguments as prompted; deleting pools destroys data.)
As the cluster evolves, the object location may change dynamically. One benefit of Ceph’s dynamic rebalancing is that Ceph relieves you from having to perform data migration or balancing manually.
To use this guide, you must have executed the procedures in the Storage Cluster Quick Start guide first. Ensure your Ceph Storage Cluster is in an active
+
clean state before working with the Ceph Block Device.
Note
The Ceph Block Device is also known as RBD or RADOS Block Device.
You may use a virtual machine for your ceph-client node, but do not execute the following procedures on the same physical node as your Ceph Storage Cluster nodes (unless you use a VM). See FAQ for details.
The ceph-deploy utility copies the keyring to the /etc/ceph directory. Ensure that the keyring file has appropriate read permissions (e.g., sudo
chmod
+r
/etc/ceph/ceph.client.admin.keyring).
See block devices for additional details.
To use the CephFS Quick Start guide, you must have executed the procedures in the Storage Cluster Quick Start guide first. Execute this quick start on the Admin Host.
+
clean state. Also, ensure that you have at least one Ceph Metadata Server running.You have already created an MDS (Storage Cluster Quick Start) but it will not become active until you create some pools and a filesystem. See Create a Ceph filesystem.
ceph osd pool create cephfs_data
ceph osd pool create cephfs_metadata
ceph fs new cephfs_metadata cephfs_data
The Ceph Storage Cluster runs with authentication turned on by default. You should have a file containing the secret key (i.e., not the keyring itself). To obtain the secret key for a particular user, perform the following procedure:
Mount CephFS as a kernel driver.
sudo mkdir /mnt/mycephfs
sudo mount -t ceph {ip-address-of-monitor}:6789:/ /mnt/mycephfs
The Ceph Storage Cluster uses authentication by default. Specify a user name and the secretfile you created in the Create a Secret File section. For example:
sudo mount -t ceph 192.168.0.1:6789:/ /mnt/mycephfs -o name=admin,secretfile=admin.secret
Note
Mount the CephFS filesystem on the admin node, not the server node. See FAQ for details.
Mount CephFS as a Filesystem in User Space (FUSE).
sudo mkdir ~/mycephfs
sudo ceph-fuse -m {ip-address-of-monitor}:6789 ~/mycephfs
The Ceph Storage Cluster uses authentication by default. Specify a keyring if it is not in the default location (i.e., /etc/ceph):
sudo ceph-fuse -k ./ceph.client.admin.keyring -m 192.168.0.1:6789 ~/mycephfs
See CephFS for additional information. CephFS is not quite as stable as the Ceph Block Device and Ceph Object Storage. See Troubleshooting if you encounter trouble.
As of firefly (v0.80), Ceph Storage dramatically simplifies installing and configuring a Ceph Object Gateway. The Gateway daemon embeds Civetweb, so you do not have to install a web server or configure FastCGI. Additionally, ceph-deploy can install the gateway package, generate a key, configure a data directory and create a gateway instance for you.
Tip
Civetweb uses port 7480 by default. You must either open port 7480, or set the port to a preferred port (e.g., port 80) in your Ceph configuration file.
To start a Ceph Object Gateway, follow the steps below:
From the working directory of your administration server, create an instance of the Ceph Object Gateway on the client-node. For example:
ceph-deploy rgw create
Once the gateway is running, you should be able to access it on port 7480. (e.g., http://client-node:7480).
-s). For example, if your node name is client-node, add a section like this after the [global] section:Note
Ensure that you leave no whitespace between port=
Important
If you intend to use port 80, make sure that the Apache server is not running otherwise it will conflict with Civetweb. We recommend to remove Apache in this case.
On Red Hat Enterprise Linux 6 and Ubuntu, run the following command:
sudo service radosgw restart id=rgw.
See Preflight Checklist for more information on configuring firewall with firewall-cmd or iptables.
You should be able to make an unauthenticated request, and receive a response. For example, a request with no parameters like this:
http://:80
Should result in a response like this:
anonymous
See the Configuring Ceph Object Gateway guide for additional administration and API details.