Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up the configuration of Infernalis version radosgw

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to build the configuration of the Infernalis version of radosgw. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

1. Install apache.

# apt-get install apache2 libapache2-mod-fastcgi

two。 Configure apache.

Add the server name to the apache configuration file, that is, add the following to the / etc/apache2/apache2.conf file:

ServerName {fqdn}

Where fqdn is the output of hostname-f.

Enable apache related modules.

A2enmod proxy_fcgi

A2enmod fastcgi

A2enmod rewrite

Start apache.

# service apache2 start

3. Install the radosgw module.

# apt-get install radosgw

4. Create radosgw users and keyring.

Create a keyring for rgw.

# ceph-authtool-- create-keyring / etc/ceph/ceph.client.radosgw.keyring

# chmod + r / etc/ceph/ceph.client.radosgw.keyring

Generate a key for the rgw user.

# ceph-authtool / etc/ceph/ceph.client.radosgw.keyring-n client.radosgw.gateway-- gen-key

Create permissions for the rgw user.

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

Add rgw users to the ceph cluster.

# ceph-k / etc/ceph/ceph.client.admin.keyring auth add client.radosgw.gateway-I / etc/ceph/ceph.client.radosgw.keyring

Distribute the keyring of rgw.

Copy / etc/ceph/ceph.client.radosgw.keyring to other rgw nodes with the ssh command.

5. Create a pool.

When the created rgw user has write permission, rgw automatically creates the required pools, so this step can be omitted.

6. Configure rgw.

Add the following to / etc/ceph/ceph.conf:

[client.radosgw.gateway]

Host = ceph-node1

Keyring = / etc/ceph/ceph.client.radosgw.keyring

Rgw socket path = / tmp/radosgw.sock

Log file = / var/log/radosgw/client.radosgw.gateway.log

Rgw print continue = false

Create a rgw working directory:

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

Create a rgwlog directory

# mkdir-p / var/log/radosgw

7. Start rgw.

# / etc/init.d/radosgw start

8. Configure the radosgw gateway.

Create the rgw.conf file under the / etc/apache2/site-available/ directory and its contents are as follows:

FastCgiExternalServer / var/www/s3gw.fcgi-socket / tmp/radosgw.sock

ServerName ceph-node1

ServerAlias ceph-node1

DocumentRoot / var/www

RewriteEngine On

RewriteRule ^ / (. *) / s3gw.fcgification% {QUERY_STRING} [Etjntmp Autopilot HTTP:Authorization% {HTTP:Authorization}, L]

Header set Access-Control-Allow-Origin "*"

Header set Access-Control-Allow-Methods "HEAD,GET,PUT,POST,DELETE,OPTIONS"

Header set Access-Control-Allow-Headers "authorization,content-type,x-amz-date,x-amz-user-agent,content-md5,neunn-token,neunn-user-id,x-amz-copy-source,x-amz-acl,neunn-radosgw-user-id,neunn-user-adminops"

Header set Access-Control-Expose-Headers "ETag"

Options + ExecCGI

AllowOverride All

SetHandler fastcgi-script

Order allow,deny

Allow from all

AuthBasicAuthoritative Off

AllowEncodedSlashes On

ErrorLog / var/log/apache2/error.log

CustomLog / var/log/apache2/access.log combined

ServerSignature Off

In addition, create an executable file s3gw.fcgi under the / var/www/ directory with the following contents:

#! / bin/sh

Exec / usr/bin/radosgw-c / etc/ceph/ceph.conf-n client.radosgw.gateway

9. Restart apache.

Enable rgw module.

# a2ensite rgw.conf

# a2dissite 000-default

Restart apache.

# service apache2 restart

10. Create an S3 user.

# radosgw-admin user create-uid= "testuser"-display-name= "First User"

The output is as follows:

{"user_id": "testuser"

"display_name": "First User"

"email":

"suspended": 0

"max_buckets": 1000

"auid": 0

"subusers": []

"keys": [

{"user": "testuser"

"access_key": "I0PJDPCIYZ665MW88W9R"

"secret_key": "dxaXZ8U90SXydYzyS5ivamEP20hkLSUViiaR+ZDA"}]

"swift_keys": []

"caps": []

"op_mask": "read, write, delete"

"default_placement":

"placement_tags": []

"bucket_quota": {"enabled": false

"max_size_kb":-1

"max_objects":-1}

"user_quota": {"enabled": false

"max_size_kb":-1

"max_objects":-1}

"temp_url_keys": []}

The more important ones are access_key and secret_key.

11. Set access rights for S3 users.

# radosgw-admin caps add-uid=testuser-caps= "users=*"

# radosgw-admin caps add-uid=testuser-caps= "buckets=*"

# radosgw-admin caps add-uid=testuser-caps= "metadata=*"

# radosgw-admin caps add-uid=testuser-caps= "usage=*"

# radosgw-admin caps add-uid=testuser-caps= "zone=*"

twelve。 Use a browser to access radosgw.

After accessing port 80 of radosgw using a general-purpose browser, the following message appears on the browser:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

Anonymous

This message indicates that the radosgw has been built successfully.

This is the end of the article on "how to build the configuration of the Infernalis version of radosgw". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report