Package: ceph-deploy
ceph-deployis a way to deploy Ceph relying on just SSH access to
the servers,sudo, and some Python. It runs fully on your
workstation, requiring no servers, databases, or anything like that.If you set up and tear down Ceph clusters a lot, and want minimal
extra bureaucracy, this is for you.ThisREADMEprovides a brief overview of ceph-deploy, for thorough
documentation please go tohttp://ceph.com/ceph-deploy/docsWhat this tool is notIt is not a generic deployment system, it is only for Ceph, and is designed
for users who want to quickly get Ceph running with sensible initial settings
without the overhead of installing Chef, Puppet or Juju.It does not handle client configuration beyond pushing the Ceph config file
and users who want fine-control over security settings, partitions or directory
locations should use a tool such as Chef or Puppet.InstallationDepending on what type of usage you are going to have withceph-deployyou
might want to look into the different ways to install it. For automation, you
might want tobootstrapdirectly. Regular users ofceph-deploywould
probably install from the OS packages or from the Python Package Index.Python Package IndexIf you are familiar with Python install tools (likepipandeasy_install) you can easily installceph-deploylike:pip install ceph-deployor:easy_install ceph-deployIt should grab all the dependencies for you and install into the current user’s
environment.We highly recommend usingvirtualenvand installing dependencies in
a contained way.DEBAll new releases ofceph-deployare pushed to allcephDEB release
repos.The DEB release repos are found at:http://ceph.com/debian-{release}
http://ceph.com/debian-testingThis means, for example, that installingceph-deployfromhttp://ceph.com/debian-giantwill install the same version as fromhttp://ceph.com/debian-fireflyorhttp://ceph.com/debian-testing.RPMAll new releases ofceph-deployare pushed to allcephRPM release
repos.The RPM release repos are found at:http://ceph.com/rpm-{release}
http://ceph.com/rpm-testingMake sure you add the proper one for your distribution (i.e. el7 vs rhel7).This means, for example, that installingceph-deployfromhttp://ceph.com/rpm-giantwill install the same version as fromhttp://ceph.com/rpm-fireflyorhttp://ceph.com/rpm-testing.bootstrappingTo get the source tree ready for use, run this once:./bootstrapYou can symlink theceph-deployscript in this somewhere
convenient (like~/bin), or add the current directory toPATH,
or just always type the full path toceph-deploy.SSH and Remote Connectionsceph-deploywill attempt to connect via SSH to hosts when the hostnames do
not match the current host’s hostname. For example, if you are connecting to
hostnode1it will attempt an SSH connection as long as the current host’s
hostname isnotnode1.ceph-deploy at a minimum requires that the machine from which the script is
being run can ssh as root without password into each Ceph node.To enable this generate a new ssh keypair for the root user with no passphrase
and place the public key (id_rsa.puborid_dsa.pub) in:/root/.ssh/authorized_keysand ensure that the following lines are in the sshd config:PermitRootLogin without-password
PubkeyAuthentication yesThe machine running ceph-deploy does not need to have the Ceph packages
installed unless it needs to admin the cluster directly using thecephcommand line tool.usernamesWhen not specified the connection will be done with the same username as the
one executingceph-deploy. This is useful if the same username is shared in
all the nodes but can be cumbersome if that is not the case.A way to avoid this is to define the correct usernames to connect with in the
SSH config, but you can also use the--usernameflag as well:ceph-deploy --username ceph install node1ceph-deploythen in turn would useceph@node1to connect to that host.This would be the same expectation for any action that warrants a connection to
a remote host.Managing an existing clusterYou can use ceph-deploy to provision nodes for an existing cluster.
To grab a copy of the cluster configuration file (normallyceph.conf):ceph-deploy config pull HOSTYou will usually also want to gather the encryption keys used for that
cluster:ceph-deploy gatherkeys MONHOSTAt this point you can skip the steps below that create a new cluster
(you already have one) and optionally skip installation and/or monitor
creation, depending on what you are trying to accomplish.Creating a new clusterCreating a new configurationTo create a new configuration file and secret key, decide what hosts
will runceph-mon, and run:ceph-deploy new MON [MON..]listing the hostnames of the monitors.  EachMONcan bea simple hostname.  It must be DNS resolvable without the fully
qualified domain name.a fully qualified domain name.  The hostname is assumed to be the
leading component up to the first..aHOST:FQDNpair, of both the hostname and a fully qualified
domain name or IP address.  For example,foo,foo.example.com,foo:something.example.com, andfoo:1.2.3.4are all valid.  Note, however, that the hostname
should match that configured on the hostfoo.The above will create aceph.confandceph.mon.keyringin your
current directory.Edit initial cluster configurationYou want to review the generatedceph.conffile and make sure that
themon_hostsetting contains the IP addresses you would like the
monitors to bind to.  These are the IPs that clients will initially
contact to authenticate to the cluster, and they need to be reachable
both by external client-facing hosts and internal cluster daemons.Installing packagesTo install the Ceph software on the servers, run:ceph-deploy install HOST [HOST..]This installs the current defaultstablerelease. You can choose a
different release track with command line options, for example to use
a release candidate:ceph-deploy install --testing HOSTOr to test a development branch:ceph-deploy install --dev=wip-mds-now-works-no-kidding HOST [HOST..]Proxy or Firewall InstallsIf attempting to install behind a firewall or through a proxy you can
use the--no-adjust-reposthat will tell ceph-deploy to skip any changes
to the distro’s repository in order to install the packages and it will go
straight to package installation.That will allow an environment without internet access to point toits own
repositories. This means that those repositories will need to be properly
setup (and mirrored with all the necessary dependencies) before attempting an
install.Another alternative is to set thewgetenv variables to point to the right
hosts, for example, put following lines into/root/.wgetrcon each node
(since ceph-deploy runs wget as root):http_proxy=http://host:port
ftp_proxy=http://host:port
https_proxy=http://host:portDeploying monitorsTo actually deployceph-monto the hosts you chose, run:ceph-deploy mon create HOST [HOST..]Without explicit hosts listed, hosts inmon_initial_membersin the
config file are deployed. That is, the hosts you passed toceph-deployneware the default value here.Gather keysTo gather authenticate keys (for administering the cluster and
bootstrapping new nodes) to the local directory, run:ceph-deploy gatherkeys HOST [HOST...]whereHOSTis one of the monitor hosts.Once these keys are in the local directory, you can provision new OSDs etc.Deploying OSDsTo prepare a node for running OSDs, run:ceph-deploy osd create HOST:DISK[:JOURNAL] [HOST:DISK[:JOURNAL] ...]After that, the hosts will be running OSDs for the given data disks.
If you specify a raw disk (e.g.,/dev/sdb), partitions will be
created and GPT labels will be used to mark and automatically activate
OSD volumes.  If an existing partition is specified, the partition
table will not be modified.  If you want to destroy the existing
partition table on DISK first, you can include the--zap-diskoption.If there is already a prepared disk or directory that is ready to become an
OSD, you can also do:ceph-deploy osd activate HOST:DIR[:JOURNAL] [...]This is useful when you are managing the mounting of volumes yourself.Admin hostsTo prepare a host with aceph.confandceph.client.admin.keyringkeyring so that it can administer the cluster, run:ceph-deploy admin HOST [HOST ...]Forget keysThenewandgatherkeysput some Ceph authentication keys in keyrings in
the local directory.  If you are worried about them being there for security
reasons, run:ceph-deploy forgetkeysand they will be removed.  If you need them again later to deploy additional
nodes, simply re-run:ceph-deploy gatherkeys HOST [HOST...]and they will be retrieved from an existing monitor node.Multiple clustersAll of the above commands take a--cluster=NAMEoption, allowing
you to manage multiple clusters conveniently from one workstation.
For example:ceph-deploy --cluster=us-west new
vi us-west.conf
ceph-deploy --cluster=us-west monFAQBefore anythingMake sure you have the latest version ofceph-deploy. It is actively
developed and releases are coming weekly (on average). The most recent versions
ofceph-deploywill have a--versionflag you can use, otherwise check
with your package manager and update if there is anything new.Why is feature X not implemented?Usually, features are added when/if it is sensible for someone that wants to
get started with ceph and said feature would make sense in that context.  If
you believe this is the case and you’ve read “what this tool is not” and
still think featureXshould exist in ceph-deploy, open a feature request
in the ceph tracker:http://tracker.ceph.com/projects/ceph-deploy/issuesA command gave me an error, what is going on?Most of the commands forceph-deployare meant to be run remotely in a host
that you have configured when creating the initial config. If a given command
is not working as expected try to run the command that failed in the remote
host and assert the behavior there.If the behavior in the remote host is the same, then it is probably not
something wrong withceph-deployper-se. Make sure you capture the output
of both theceph-deployoutput and the output of the command in the remote
host.Issues with monitorsIf your monitors are not starting, make sure that the{hostname}you used
when you ranceph-deploymon create {hostname}match the actualhostname-sin the remote host.Newer versions ofceph-deployshould warn you if the results are different
but that might prevent the monitors from reaching quorum.Developing ceph-deployNow that you have cracked your teeth on Ceph, you might find that you want to
contribute to ceph-deploy.ResourcesBug tracking:http://tracker.ceph.com/projects/ceph-deploy/issuesMailing list and IRC info is the same as cephhttp://ceph.com/resources/mailing-list-irc/Submitting PatchesPlease add test cases to cover any code you add. You can test your changes
by runningtox(You will also needmockandpytest) from inside
the git cloneWhen creating a commit message please usegit commit-sor otherwise addSigned-off-by:Your Name <email@address.dom>to your commit message.Patches can then be submitted by a pull request on GitHub.