Re: how to configure ceph object gateway

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for your reply!
I have try it but no use.

I installed ceph in 3 servers called ceph69, ceph70, ceph71.

All my steps are as follows:
1. vi /etc/ceph/ceph.conf
add these content:

[client.radosgw.gateway]
        host = {host-name}
        keyring = /etc/ceph/keyring.radosgw.gateway
        rgw socket path = /tmp/radosgw.sock
        log file = /var/log/ceph/radosgw.log

2. copy ceph.conf to another 2 server.

cd /etc/ceph
ssh ceph70 tee /etc/ceph/ceph.conf < ceph.conf
ssh ceph71 tee /etc/ceph/ceph.conf < ceph.conf

3. mkdir -p /var/lib/ceph/radosgw/ceph-radosgw.gateway

4. vi /etc/httpd/conf.d/fastcgi.conf, modify FastCgiWrapper to off, and add FastCgiExternalServer.
FastCgiWrapper Off
FastCgiExternalServer /var/www/s3gw.fcgi -socket /tmp/radosgw.sock

5. vi /etc/httpd/conf/httpd.conf
add these content:

<VirtualHost *:80>
        ServerName ceph69
        ServerAdmin zhangyt@xxxxxxxxxxxxxxxxxx
        DocumentRoot /var/www
        <IfModule mod_fastcgi.c>
                <Directory /var/www>
                        Options +ExecCGI
                        AllowOverride All
                        SetHandler fastcgi-script
                        Order allow,deny
                        Allow from all
                        AuthBasicAuthoritative Off
                </Directory>
        </IfModule>
        AllowEncodedSlashes On
        ErrorLog /var/log/httpd/error.log
        CustomLog /var/log/httpd/access.log combined
        ServerSignature Off
</VirtualHost>
RewriteEngine On
RewriteRule ^/([a-zA-Z0-9-_.]*)([/]?.*) /s3gw.fcgi?page=$1&params=$2&%{QUERY_STRING} [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

6. vi /etc/httpd/conf.d/ssl.conf, and modify the following content.
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key

7. vi /var/www/s3gw.fcgi and chmod +x /var/www/s3gw.fcgi 
add these content:

#!/bin/sh
exec /usr/bin/radosgw -c /etc/ceph/ceph.conf -n client.radosgw.gateway

8. GENERATE A KEYRING AND KEY FOR THE GATEWAY
ceph-authtool --create-keyring /etc/ceph/keyring.radosgw.gateway
chmod +r /etc/ceph/keyring.radosgw.gateway

ceph-authtool /etc/ceph/keyring.radosgw.gateway -n client.radosgw.gateway --gen-key
ceph-authtool -n client.radosgw.gateway --cap osd 'allow rwx' --cap mon 'allow rw' /etc/ceph/keyring.radosgw.gateway

9. ADD TO CEPH KEYRING ENTRIES
ceph -k /etc/ceph/ceph.client.admin.keyring auth add client.radosgw.gateway -i /etc/ceph/keyring.radosgw.gateway

10. RESTART SERVICES AND START THE GATEWAY
[root@ceph69 ceph]# service ceph restart
=== mon.0 === 
=== mon.0 === 
Stopping Ceph mon.0 on ceph69...kill 9444...done
=== mon.0 === 
Starting Ceph mon.0 on ceph69...
=== mds.0 === 
=== mds.0 === 
Stopping Ceph mds.0 on ceph69...kill 9518...done
=== mds.0 === 
Starting Ceph mds.0 on ceph69...
starting mds.0 at :/0
=== osd.0 === 
=== osd.0 === 
Stopping Ceph osd.0 on ceph69...kill 9677...done
=== osd.0 === 
Mounting Btrfs on ceph69:/data/osd.0
Scanning for Btrfs filesystems
create-or-move updated item name 'osd.0' weight 0.04 at location {host=ceph69,root=default} to crush map
Starting Ceph osd.0 on ceph69...
starting osd.0 at :/0 osd_data /data/osd.0 /data/osd.0/journal
[root@ceph69 ceph]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@ceph69 ceph]# /etc/init.d/ceph-radosgw start
Starting radosgw instance(s)...
2014-03-07 11:41:55.743996 7fdb098c4820 -1 WARNING: libcurl doesn't support curl_multi_wait()
2014-03-07 11:41:55.744001 7fdb098c4820 -1 WARNING: cross zone / region transfer performance may be affected
Starting client.radosgw.gateway...                         [  OK  ]

11. CREATE A GATEWAY USER
[root@ceph69 conf.d]# radosgw-admin user create --uid=wsnote --display-name="wsnote" --email=wsnote@xxxxxxx
{ "user_id": "wsnote",
  "display_name": "wsnote",
  "email": "wsnote@xxxxxxx",
  "suspended": 0,
  "max_buckets": 1000,
  "auid": 0,
  "subusers": [],
  "keys": [
        { "user": "wsnote",
          "access_key": "8BRTJ746Q6AC38MAF5EO",
          "secret_key": "M0dfKnZuwANWefPyujHzABFJPbCMfDDxPAw4vxAU"}],
  "swift_keys": [],
  "caps": [],
  "op_mask": "read, write, delete",
  "default_placement": "",
  "placement_tags": []}
  
The following content is the /etc/ceph/ceph.conf:

; global
[global]
        auth supported = none
        max open files = 131072
        log file = /var/log/ceph/$name.log
        pid file = /var/run/ceph/$name.pid

; monitors
[mon]
        mon data = "">

[mon.0]
        host = ceph69
        mon addr = 121.205.7.69:6789



; mds
[mds]
        keyring = /data/keyring.$name

[mds.0]
        host = ceph69

; osd
[osd]
        osd data = "">
        osd journal = /data/$name/journal
        osd journal size = 1000 ; journal size, in megabytes
        osd mkfs type = btrfs
        osd mount options btrfs = rw,noatime

[osd.0]
        host = ceph69
        devs = /dev/sda3

[osd.1]
        host = ceph70
        devs = /dev/sda3

[osd.2]
        host = ceph71
        devs = /dev/sda3

[client.radosgw.gateway]
        host = ceph69
        keyring = /etc/ceph/keyring.radosgw.gateway
        rgw socket path = /tmp/radosgw.sock
        log file = /var/log/ceph/radosgw.log

That's ALL.
Thanks very much!


At 2014-03-11 13:50:00,"Jean-Charles LOPEZ" <jc.lopez@xxxxxxxxxxx> wrote: >Hi, > >looks like this comes from the apache install. Something is wrong or different with CentOS. > >Replace first command with >ln -s /etc/httpd/sites-available/rgw.conf /etc/httpd/conf.d/rgw.conf > >Replace second command with >unlink /etc/httpd/conf.d/default > >This should make the trick > >JC > > > >On Mar 10, 2014, at 21:53, wsnote <wsnote@xxxxxxx> wrote: > >> >You must also create an rgw.conf file in the /etc/apache2/sites-enabled directory.  >> There is no  /etc/apache2/sites-enabled directory in the CentOS. So I didn't create rgw.conf. I put the content of rgw.conf to the httpd.conf. >>  >> >sudo a2ensite rgw.conf >> >sudo a2dissite default >>  >> These 2 commands was not found in the CentOS. >> I can start /etc/init.d/ceph-radosgw and create a gateway user.But when I used API, it shows "403 forbidden". >> I didn't add wildcart to DNS, because I didn't use domain. >>  >> 在 2014-03-11 10:47:57,"Jean-Charles LOPEZ" <jeanchlopez@xxxxxxx> 写道: >> >Hi, >> > >> >what commands are “not found”? >> > >> >This page for configuring the RGW works fine as far as I know as I used it no later than a week ago. >> > >> >Can you please give us more details? What is your layout (radosgw installed on a ceph node, mon node, standalone node)? >> > >> >Note: In order to get it running, remember you need to have a web server installed and running (apache), ceph base packages obviously, swift if you want to use the swift tool, s3cmd also, s3curl, … >> > >> >JC >> > >> >On Mar 10, 2014, at 19:35, wsnote <wsnote@xxxxxxx> wrote: >> > >> >> OS: CentOS 6.4 >> >> version: ceph 0.67.7 >> >>  >> >> Hello, everyone. >> >> With the help of document, I have install ceph gateway. >> >> But I don't know how to configure it. The web http://ceph.com/docs/master/radosgw/config/ has many command not found.I thought it's written in the ubuntu. >> >> can anyone help? >> >> Thanks! >> >>  >> >>  >> >> _______________________________________________ >> >> ceph-users mailing list >> >> ceph-users@xxxxxxxxxxxxxx >> >> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com >> > >>  >>  >>  >> _______________________________________________ >> ceph-users mailing list >> ceph-users@xxxxxxxxxxxxxx >> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com >


_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux