diff options
-rw-r--r-- | doc/man/8/ceph-authtool.rst | 2 | ||||
-rw-r--r-- | doc/man/8/radosgw.rst | 56 | ||||
-rw-r--r-- | doc/man/8/rbd.rst | 6 | ||||
-rw-r--r-- | man/ceph-mon.8 | 32 | ||||
-rw-r--r-- | man/ceph-osd.8 | 20 | ||||
-rw-r--r-- | man/ceph.8 | 8 | ||||
-rw-r--r-- | man/monmaptool.8 | 7 | ||||
-rw-r--r-- | man/mount.ceph.8 | 10 | ||||
-rw-r--r-- | man/radosgw-admin.8 | 16 | ||||
-rw-r--r-- | man/radosgw.8 | 28 | ||||
-rw-r--r-- | man/rbd.8 | 12 | ||||
-rw-r--r-- | src/cephfs.cc | 1 | ||||
-rw-r--r-- | src/common/safe_io.h | 1 | ||||
-rw-r--r-- | src/mds/MDBalancer.cc | 9 | ||||
-rw-r--r-- | src/mon/Paxos.cc | 2 | ||||
-rw-r--r-- | src/osd/PG.cc | 6 | ||||
-rw-r--r-- | src/osd/ReplicatedPG.cc | 4 | ||||
-rw-r--r-- | src/test/system/systest_runnable.cc | 1 |
18 files changed, 150 insertions, 71 deletions
diff --git a/doc/man/8/ceph-authtool.rst b/doc/man/8/ceph-authtool.rst index 9a47f20f126..23346cffabb 100644 --- a/doc/man/8/ceph-authtool.rst +++ b/doc/man/8/ceph-authtool.rst @@ -110,7 +110,7 @@ Example To create a new keyring containing a key for client.foo:: - ceph-authtool -c -n client.foo --gen-key keyring + ceph-authtool -C -n client.foo --gen-key keyring To associate some capabilities with the key (namely, the ability to mount a Ceph filesystem):: diff --git a/doc/man/8/radosgw.rst b/doc/man/8/radosgw.rst index e3f37ac5968..520e5263701 100644 --- a/doc/man/8/radosgw.rst +++ b/doc/man/8/radosgw.rst @@ -37,30 +37,27 @@ Options Specify a unix domain socket path. -Examples -======== +Configuration +============= + +Currently it's the easiest to use the RADOS Gateway with Apache and mod_fastcgi:: -An apache example configuration for using the RADOS gateway:: + FastCgiExternalServer /var/www/s3gw.fcgi -socket /tmp/radosgw.sock <VirtualHost *:80> ServerName rgw.example1.com ServerAlias rgw ServerAdmin webmaster@example1.com - DocumentRoot /var/www/web1/web/ + DocumentRoot /var/www - #turn engine on RewriteEngine On - - #following is important for RGW/rados RewriteRule ^/([a-zA-Z0-9-_.]*)([/]?.*) /s3gw.fcgi?page=$1¶ms=$2&%{QUERY_STRING} [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] - <IfModule mod_fcgid.c> - SuexecUserGroup web1 web1 - <Directory /var/www/web1/web/> + <IfModule mod_fastcgi.c> + <Directory /var/www> Options +ExecCGI AllowOverride All - SetHandler fcgid-script - FCGIWrapper /var/www/fcgi-scripts/web1/radosgw .fcgi + SetHandler fastcgi-script Order allow,deny Allow from all AuthBasicAuthoritative Off @@ -68,28 +65,37 @@ An apache example configuration for using the RADOS gateway:: </IfModule> AllowEncodedSlashes On - - # ErrorLog /var/log/apache2/error.log - # CustomLog /var/log/apache2/access.log combined ServerSignature Off - </VirtualHost> -And the corresponding radosgw script:: +And the corresponding radosgw script (/var/www/s3gw.fcgi):: #!/bin/sh - exec /usr/bin/radosgw -c /etc/ceph.conf + exec /usr/bin/radosgw -c /etc/ceph/ceph.conf -n client.radosgw.gateway + +The radosgw daemon is a standalone process which needs a configuration +section in the ceph.conf The section name should start with +'client.radosgw.' as specified in /etc/init.d/radosgw:: + + [client.radosgw.gateway] + host = gateway + keyring = /etc/ceph/keyring.radosgw.gateway + rgw socket path = /tmp/radosgw.sock + +You will also have to generate a key for the radosgw to use for +authentication with the cluster:: + + ceph-authtool -C -n client.radosgw.gateway --gen-key /etc/ceph/keyring.radosgw.gateway + ceph-authtool -n client.radosgw.gateway --cap mon 'allow r' --cap osd 'allow rwx' --cap mds 'allow' /etc/ceph/keyring.radosgw.gateway -By default radosgw will run as single threaded and its execution will -be controlled by the fastcgi process manager. An alternative way to -run it would be by specifying (along the lines of) the following in -the apache config:: +And add the key to the auth entries:: - FastCgiExternalServer /var/www/web1/web/s3gw.fcgi -socket /tmp/.radosgw.sock + ceph auth add client.radosgw.gateway --in-file=keyring.radosgw.gateway -and specify a unix domain socket path (either by passing a command -line option, or through ceph.conf). +Now you can start Apache and the radosgw daemon:: + /etc/init.d/apache2 start + /etc/init.d/radosgw start Availability ============ diff --git a/doc/man/8/rbd.rst b/doc/man/8/rbd.rst index fbf8e3cf638..7069e301d96 100644 --- a/doc/man/8/rbd.rst +++ b/doc/man/8/rbd.rst @@ -154,7 +154,11 @@ To delete an rbd image (be careful!):: To create a new snapshot:: - rbd create mypool/myimage@mysnap + rbd snap create mypool/myimage@mysnap + +To delete a snapshot:: + + rbd snap rm mypool/myimage@mysnap To map an image via the kernel with cephx enabled:: diff --git a/man/ceph-mon.8 b/man/ceph-mon.8 index f1812b5aa22..6a4dd9c688b 100644 --- a/man/ceph-mon.8 +++ b/man/ceph-mon.8 @@ -1,4 +1,4 @@ -.TH "CEPH-MON" "8" "September 22, 2011" "dev" "Ceph" +.TH "CEPH-MON" "8" "February 17, 2012" "dev" "Ceph" .SH NAME ceph-mon \- ceph monitor daemon . @@ -64,6 +64,36 @@ Use \fIceph.conf\fP configuration file instead of the default \fB/etc/ceph/ceph.conf\fP to determine monitor addresses during startup. .UNINDENT +.INDENT 0.0 +.TP +.B \-\-mkfs +Initialize the \fBmon data\fP directory with seed information to form +and initial ceph file system or to join an existing monitor +cluster. Three pieces of information must be provided: +.INDENT 7.0 +.IP \(bu 2 +The cluster fsid. This can come from a monmap (\fB\-\-monmap <path>\fP) or +explicitly via \fB\-\-fsid <uuid>\fP. +.IP \(bu 2 +A list of monitors and their addresses. This list of monitors +can come from a monmap (\fB\-\-monmap <path>\fP), the \fBmon host\fP +configuration value (in \fIceph.conf\fP or via \fB\-m +host1,host2,...\(ga), or \(ga\(gamon addr\fP lines in \fIceph.conf\fP. If this +monitor is to be part of the initial monitor quorum for a new +Ceph cluster, then it must be included in the initial list, +matching either the name or address of a monitor in the list. +When matching by address, either the \fBpublic addr\fP or \fBpublic +subnet\fP options may be used. +.IP \(bu 2 +The monitor secret key \fBmon.\fP. This must be included in the +keyring provided via \fB\-\-keyring <path>\fP. +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-keyring +Specify a keyring for use with \fB\-\-mkfs\fP. +.UNINDENT .SH AVAILABILITY .sp \fBceph\-mon\fP is part of the Ceph distributed file system. Please refer diff --git a/man/ceph-osd.8 b/man/ceph-osd.8 index bcc9c7f500b..153cc925761 100644 --- a/man/ceph-osd.8 +++ b/man/ceph-osd.8 @@ -1,4 +1,4 @@ -.TH "CEPH-OSD" "8" "September 22, 2011" "dev" "Ceph" +.TH "CEPH-OSD" "8" "February 17, 2012" "dev" "Ceph" .SH NAME ceph-osd \- ceph object storage daemon . @@ -99,6 +99,24 @@ you won\(aqt lose data. .UNINDENT .INDENT 0.0 .TP +.B \-\-get\-cluster\-fsid +Print the cluster fsid (uuid) and exit. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-get\-osd\-fsid +Print the OSD\(aqs fsid and exit. The OSD\(aqs uuid is generated at +\-\-mkfs time and is thus unique to a particular instantiation of +this OSD. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-get\-journal\-fsid +Print the journal\(aqs uuid. The journal fsid is set to match the OSD +fsid at \-\-mkfs time. +.UNINDENT +.INDENT 0.0 +.TP .B \-c ceph.conf, \-\-conf=ceph.conf Use \fIceph.conf\fP configuration file instead of the default \fB/etc/ceph/ceph.conf\fP for runtime configuration options. diff --git a/man/ceph.8 b/man/ceph.8 index ba41bb0c5a3..94210b2ebcb 100644 --- a/man/ceph.8 +++ b/man/ceph.8 @@ -1,4 +1,4 @@ -.TH "CEPH" "8" "September 22, 2011" "dev" "Ceph" +.TH "CEPH" "8" "February 17, 2012" "dev" "Ceph" .SH NAME ceph \- ceph file system control utility . @@ -47,13 +47,11 @@ To start in interactive mode, no arguments are necessary. Control\-d or \(aqquit\(aq will exit. .SS Watch mode .sp -To watch cluster state changes in real time, starting in \-w (watch) -mode will print updates to stdout as they occur. For example, to keep -an eye on cluster state, run: +Watch mode shows cluster state changes as they occur. For example: .sp .nf .ft C -ceph \-C ceph.conf \-w +ceph \-w .ft P .fi .SS Command line mode diff --git a/man/monmaptool.8 b/man/monmaptool.8 index f4f5a2b009b..5e465fe8747 100644 --- a/man/monmaptool.8 +++ b/man/monmaptool.8 @@ -1,4 +1,4 @@ -.TH "MONMAPTOOL" "8" "September 22, 2011" "dev" "Ceph" +.TH "MONMAPTOOL" "8" "February 17, 2012" "dev" "Ceph" .SH NAME monmaptool \- ceph monitor cluster map manipulation tool . @@ -77,6 +77,11 @@ will add a monitor with the specified ip:port to the map. .B \-\-rm name will remove the monitor with the specified ip:port from the map. .UNINDENT +.INDENT 0.0 +.TP +.B \-\-fsid uuid +will set the fsid to the given uuid. If not specified with \-\-create, a random fsid will be generated. +.UNINDENT .SH EXAMPLE .sp To create a new map with three monitors (for a fresh Ceph file system): diff --git a/man/mount.ceph.8 b/man/mount.ceph.8 index 90177945026..160b8447748 100644 --- a/man/mount.ceph.8 +++ b/man/mount.ceph.8 @@ -1,4 +1,4 @@ -.TH "MOUNT.CEPH" "8" "September 22, 2011" "dev" "Ceph" +.TH "MOUNT.CEPH" "8" "February 17, 2012" "dev" "Ceph" .SH NAME mount.ceph \- mount a ceph file system . @@ -107,10 +107,14 @@ memory. Default: calculated from available memory string, set the name of the hidden snapdir. Default: .snap .TP .B \fBname\fP -string, used with cephx, Default: guest +RADOS user to authenticate as when using cephx. Default: guest .TP .B \fBsecret\fP -string, used with cephx +secret key for use with cephx. This option is insecure because it exposes +the secret on the command line. To avoid this, use the secretfile option. +.TP +.B \fBsecretfile\fP +path to file containing the secret key to use with cephx .TP .B \fBip\fP my ip diff --git a/man/radosgw-admin.8 b/man/radosgw-admin.8 index 3c2c09858ff..782d35689b2 100644 --- a/man/radosgw-admin.8 +++ b/man/radosgw-admin.8 @@ -1,4 +1,4 @@ -.TH "RADOSGW-ADMIN" "8" "September 22, 2011" "dev" "Ceph" +.TH "RADOSGW-ADMIN" "8" "February 17, 2012" "dev" "Ceph" .SH NAME radosgw-admin \- rados REST gateway user administration utility . @@ -32,12 +32,12 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] . .SH SYNOPSIS .nf -\fBradosgw-admin\fP \fIcommand\fP [ \fIoptions\fP \fI...\fP ] +\fBradosgw\-admin\fP \fIcommand\fP [ \fIoptions\fP \fI...\fP ] .fi .sp .SH DESCRIPTION .sp -\fBradosgw-admin\fP is a RADOS gateway user administration utility. It +\fBradosgw\-admin\fP is a RADOS gateway user administration utility. It allows creating and modifying users. .SH COMMANDS .sp @@ -137,7 +137,7 @@ Generate a new user: .sp .nf .ft C -$ radosgw-admin user gen \-\-display\-name="johnny rotten" \-\-email=johnny@rotten.com +$ radosgw\-admin user gen \-\-display\-name="johnny rotten" \-\-email=johnny@rotten.com User ID: CHBQFRTG26I8DGJDGQLW Secret Key: QR6cI/31N+J0VKVgHSpEGVSfEEsmf6PyXG040KCB Display Name: johnny rotten @@ -148,7 +148,7 @@ Remove a user: .sp .nf .ft C -$ radosgw-admin user rm \-\-uid=CHBQFRTG26I8DGJDGQLW +$ radosgw\-admin user rm \-\-uid=CHBQFRTG26I8DGJDGQLW .ft P .fi .sp @@ -156,7 +156,7 @@ Remove a bucket: .sp .nf .ft C -$ radosgw-admin bucket unlink \-\-bucket=foo +$ radosgw\-admin bucket unlink \-\-bucket=foo .ft P .fi .sp @@ -164,12 +164,12 @@ Show the logs of a bucket from April 1st 2011: .sp .nf .ft C -$ radosgw-admin log show \-\-bucket=foo \-\-date=2011=04\-01 +$ radosgw\-admin log show \-\-bucket=foo \-\-date=2011=04\-01 .ft P .fi .SH AVAILABILITY .sp -\fBradosgw-admin\fP is part of the Ceph distributed file system. Please +\fBradosgw\-admin\fP is part of the Ceph distributed file system. Please refer to the Ceph wiki at \fI\%http://ceph.newdream.net/wiki\fP for more information. .SH SEE ALSO diff --git a/man/radosgw.8 b/man/radosgw.8 index 3119c57cea9..fe09c860a38 100644 --- a/man/radosgw.8 +++ b/man/radosgw.8 @@ -1,4 +1,4 @@ -.TH "RADOSGW" "8" "September 22, 2011" "dev" "Ceph" +.TH "RADOSGW" "8" "February 17, 2012" "dev" "Ceph" .SH NAME radosgw \- rados REST gateway . @@ -61,11 +61,11 @@ Specify a unix domain socket path. .UNINDENT .SH CONFIGURATION .sp -Currently it's the easiest to use the RADOS Gateway with Apache and mod_fastcgi +Currently it\(aqs the easiest to use the RADOS Gateway with Apache and mod_fastcgi: .sp .nf .ft C -FastCgiExternalServer /var/www/s3gw.fcgi -socket /tmp/radosgw.sock +FastCgiExternalServer /var/www/s3gw.fcgi \-socket /tmp/radosgw.sock <VirtualHost *:80> ServerName rgw.example1.com @@ -93,17 +93,18 @@ FastCgiExternalServer /var/www/s3gw.fcgi -socket /tmp/radosgw.sock .ft P .fi .sp -And the corresponding radosgw script (/var/www/s3gw.fgci): +And the corresponding radosgw script (/var/www/s3gw.fcgi): .sp .nf .ft C #!/bin/sh -exec /usr/bin/radosgw -c /etc/ceph/ceph.conf -n client.radosgw.gateway +exec /usr/bin/radosgw \-c /etc/ceph/ceph.conf \-n client.radosgw.gateway .ft P .fi .sp -The radosgw daemon is a standalone process which needs a configuration section in the ceph.conf -The section name should start with 'client.radosgw.' as specified in /etc/init.d/radosgw +The radosgw daemon is a standalone process which needs a configuration +section in the ceph.conf The section name should start with +\(aqclient.radosgw.\(aq as specified in /etc/init.d/radosgw: .sp .nf .ft C @@ -114,24 +115,25 @@ The section name should start with 'client.radosgw.' as specified in /etc/init.d .ft P .fi .sp -You will also have to generate a key for the radosgw to use for authentication with the cluster +You will also have to generate a key for the radosgw to use for +authentication with the cluster: .sp .nf .ft C -ceph-authtool -C -n client.radosgw.gateway --gen-key /etc/ceph/keyring.radosgw.gateway -ceph-authtool -n client.radosgw.gateway --cap mon 'allow r' --cap osd 'allow rwx' --cap mds 'allow' /etc/ceph/keyring.radosgw.gateway +ceph\-authtool \-C \-n client.radosgw.gateway \-\-gen\-key /etc/ceph/keyring.radosgw.gateway +ceph\-authtool \-n client.radosgw.gateway \-\-cap mon \(aqallow r\(aq \-\-cap osd \(aqallow rwx\(aq \-\-cap mds \(aqallow\(aq /etc/ceph/keyring.radosgw.gateway .ft P .fi .sp -And add the key to the auth entries +And add the key to the auth entries: .sp .nf .ft C -ceph auth add client.radosgw.gateway --in-file=keyring.radosgw.gateway +ceph auth add client.radosgw.gateway \-\-in\-file=keyring.radosgw.gateway .ft P .fi .sp -Now you can start Apache and the radosgw daemon +Now you can start Apache and the radosgw daemon: .sp .nf .ft C diff --git a/man/rbd.8 b/man/rbd.8 index 0278137d857..ff20f034ff5 100644 --- a/man/rbd.8 +++ b/man/rbd.8 @@ -1,4 +1,4 @@ -.TH "RBD" "8" "September 22, 2011" "dev" "Ceph" +.TH "RBD" "8" "February 17, 2012" "dev" "Ceph" .SH NAME rbd \- manage rados block device (RBD) images . @@ -194,7 +194,15 @@ To create a new snapshot: .sp .nf .ft C -rbd create mypool/myimage@mysnap +rbd snap create mypool/myimage@mysnap +.ft P +.fi +.sp +To delete a snapshot: +.sp +.nf +.ft C +rbd snap rm mypool/myimage@mysnap .ft P .fi .sp diff --git a/src/cephfs.cc b/src/cephfs.cc index 8ec0737426a..46d3ff8ea27 100644 --- a/src/cephfs.cc +++ b/src/cephfs.cc @@ -24,6 +24,7 @@ #include <sys/stat.h> #include <fcntl.h> #include <stdlib.h> +#include <unistd.h> #include "client/ioctl.h" using namespace std; diff --git a/src/common/safe_io.h b/src/common/safe_io.h index b62d682341c..4c2991fe6e8 100644 --- a/src/common/safe_io.h +++ b/src/common/safe_io.h @@ -16,6 +16,7 @@ #define CEPH_SAFE_IO #include "common/compiler_extensions.h" +#include <sys/types.h> #ifdef __cplusplus extern "C" { diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index d81b9ead2e4..598558e25da 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -1155,6 +1155,7 @@ void MDBalancer::dump_pop_map() { return; // this is dumb +/* char fn[32]; snprintf(fn, sizeof(fn), "popdump.%d.mds%d", beat_epoch, mds->get_nodeid()); @@ -1174,10 +1175,9 @@ void MDBalancer::dump_pop_map() iq.pop_front(); // pop stats - /*for (int a=0; a<MDS_NPOP; a++) - for (int b=0; b<META_NPOP; b++) - myfile << in->popularity[a].pop[b].get(now) << "\t"; - */ + //for (int a=0; a<MDS_NPOP; a++) + // for (int b=0; b<META_NPOP; b++) + // myfile << in->popularity[a].pop[b].get(now) << "\t"; // recurse, depth-first. if (in->is_dir()) { @@ -1214,6 +1214,7 @@ void MDBalancer::dump_pop_map() } myfile.close(); +*/ } diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index 94064e3baaa..66c720af533 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -1069,7 +1069,7 @@ version_t Paxos::get_stashed(bufferlist& bl) bool Paxos::is_consistent() { bool consistent = true; - if (first_committed > latest_stashed) + if (first_committed > 1 && first_committed > latest_stashed) consistent = false; if (first_committed > last_committed) consistent = false; diff --git a/src/osd/PG.cc b/src/osd/PG.cc index d5497797673..447b15d36fc 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4912,13 +4912,13 @@ bool PG::PriorSet::affected_by_map(const OSDMapRef osdmap, const PG *debug_pg) c } // did a down osd in cur get (re)marked as lost? - map<int,epoch_t>::const_iterator p = blocked_by.find(o); - if (p != blocked_by.end()) { + map<int,epoch_t>::const_iterator r = blocked_by.find(o); + if (r != blocked_by.end()) { if (!osdmap->exists(o)) { dout(10) << "affected_by_map osd." << o << " no longer exists" << dendl; return true; } - if (osdmap->get_info(o).lost_at != p->second) { + if (osdmap->get_info(o).lost_at != r->second) { dout(10) << "affected_by_map osd." << o << " (re)marked as lost" << dendl; return true; } diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 26b5a9d8c40..d757b658053 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5512,8 +5512,8 @@ int ReplicatedPG::recover_replicas(int max) } dout(10) << __func__ << ": recover_object_replicas(" << soid << ")" << dendl; - map<hobject_t,pg_missing_t::item>::const_iterator p = m.missing.find(soid); - started += recover_object_replicas(soid, p->second.need); + map<hobject_t,pg_missing_t::item>::const_iterator r = m.missing.find(soid); + started += recover_object_replicas(soid, r->second.need); } } diff --git a/src/test/system/systest_runnable.cc b/src/test/system/systest_runnable.cc index a342d8a5fd5..f646d2323f9 100644 --- a/src/test/system/systest_runnable.cc +++ b/src/test/system/systest_runnable.cc @@ -28,6 +28,7 @@ #include <sys/syscall.h> #include <sys/types.h> #include <sys/wait.h> +#include <unistd.h> #include <vector> #if defined(__FreeBSD__) |