1、Create the cluster. ---->ceph-deploy new {initial-monitor-node(s)}
2、Change the default number of replicas in the Ceph configuration file from 3 to 2 so that
Ceph can achieve an active + clean state with just two Ceph OSDs. Add the following line under the [global] section:---> osd pool default size = 23、If you have more than one network interface, add the public network setting under the [global] section of your Ceph configuration file.
See the Network Configuration Reference for details. ----->public network = {ip-address}/{netmask}
4、Install Ceph. ----> ceph-deploy install {ceph-node}[{ceph-node} ...]
5、Add the initial monitor(s) and gather the keys: ----> ceph-deploy mon create-initial/stat/remove/Once you complete the process, your local directory should have the following keyrings:
{cluster-name}.client.admin.keyring
{cluster-name}.bootstrap-osd.keyring
{cluster-name}.bootstrap-mds.keyring
{cluster-name}.bootstrap-rgw.keyring
3、ADD/REMOVE OSDS:
1、LIST DISKS :
To list the disks on a node, execute the following command: ---> ceph-deploy disk list {node-name [node-name]...}2、ZAP DISKS:
To zap a disk (delete its partition table) in preparation for use with Ceph, execute the following:
ceph-deploy disk zap {osd-server-name}:{disk-name}
ceph-deploy disk zap osdserver1:sda3、PREPARE OSDS:
ceph-deploy osd prepare ceph-osd1:/dev/sda ceph-osd1:/dev/sdb4、activate the OSDs:
ceph-deploy osd activate ceph-osd1:/dev/sda1 ceph-osd1:/dev/sdb15、Use ceph-deploy to copy the configuration file and admin key to your admin node and your Ceph Nodes
so that you can use the ceph CLI without having to specify the monitor address and ceph.client.admin.keyring
each time you execute a command. ----->ceph-deploy admin {admin-node} {ceph-node}6、Ensure that you have the correct permissions for the ceph.client.admin.keyring.sudo chmod +r /etc/ceph/ceph.client.admin.keyring7、Check your cluster’s health.
ceph health/status
root@ceph-client:/home/megaium# rbd create mypool/myimage --size 1024002016-01-28 09:56:40.605656 7f56cb67f7c0 0 librados: client.admin authentication error (1) Operation not permitted
rbd: couldn't connect to the cluster!
查看日志:
2016-01-27 22:44:17.755764 7ffb8a1fa8c0 0 mon.ceph-client does not exist in monmap, will attempt to join an existing cluster2016-01-27 22:44:17.756031 7ffb8a1fa8c0 -1 no public_addr or public_network specified, and mon.ceph-client not present in monmap or ceph.conf