In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to build RGW in Ceph deployment, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!
Deploy Ceph RGW
Enter the my-cluster directory described above.
Cd my-cluster modifies the default port (optional)
RGW uses Civetweb as its Web Sevice by default, while Civetweb uses port 7480 by default to provide services. If you want to modify the port (such as port 80), you need to modify the configuration file of Ceph. Add a section [client.rgw.] to the configuration file, where you need to modify the hostname to RGW. As follows:
[client.rgw.node4] rgw_frontends = "civetweb port=80"
The configuration file is then pushed to the RGW node.
$ceph-deploy-- overwrite-conf config push node4 installs CEPH OBJECT GATEWAY
The format is:
$ceph-deploy install-- rgw [...]
Since we have only one RGW in our environment, execute the command:
$ceph-deploy install-- rgw node4 manages the RGW node
The Ceph CLI tool needs to be run in administrator mode, so you need to execute the following command:
$ceph-deploy admin node4 installs the RGW instance
Execute the command:
$ceph-deploy rgw create node4
Once RGW is running, we can access it through port 7480 (if not modified). Such as:
Http://node4:7480
If RGW is working properly, it should return similar information:
Anonymous
Note: the rest of the steps to create a user should be run on the RGW node.
Create S3 user
To access RGW normally, you need to create the corresponding RGW user and give the appropriate permissions, and the radosgw-admin command implements these functions.
Create a user named testuser by executing the following command:
Radosgw-admin user create-- uid= "testuser"-- display-name= "First User"
The output of the command is roughly 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": []}
Note: you need to remember to return the values of keys- > access_key and keys- > secret_key in the result, which are used to confirm the access of S3 interface.
Create a Swift user
The Swift user is created as a sub-user subuser, execute the following command:
$radosgw-admin subuser create-uid=testuser-subuser=testuser:swift-access=full
The output is roughly as follows:
"user_id": "testuser", "display_name": "First User", "email": "," suspended ": 0," max_buckets ": 1000," auid ": 0," subusers ": [{" id ":" testuser:swift "," permissions ":" full-control "}]," keys ": [{" user ":" testuser:swift " "access_key": "3Y1LNW4Q6X0Y53A52DET", "secret_key": ""}, {"user": "testuser", "access_key": "I0PJDPCIYZ665MW88W9R", "secret_key": "dxaXZ8U90SXydYzyS5ivamEP20hkLSUViiaR+ZDA"}], "swift_keys": [{"user": "testuser:swift", "secret_key": "244+fz2gSqoHwR3lYtSbIyomyPHf3i7rgSJrF\ / IA"}] "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": []
Note: you need to remember to return the value of swift_keys- > secret_key in the result, which is used for the Swift API access confirmation.
Test S3 interface
You need to create a Python test script to test S3 access. The script connects to the RGW, creates a bucket, and lists all the bucket. Where the values of the variables access_key and secret_access come from the keys- > access_key and keys- > secret_key returned by the radosgw-admin command when the S3 user command is created.
Perform the following steps to first install the python-boto library, which is used to connect to S3:
$apt-get install python-boto
Create and edit the Python script:
$vi s3test.pyimport boto.s3.connectionaccess_key = 'I0PJDPCIYZ665MW88W9R'secret_key =' dxaXZ8U90SXydYzyS5ivamEP20hkLSUViiaR+ZDA'conn = boto.connect_s3 (aws_access_key_id=access_key, aws_secret_access_key=secret_key, host=' {hostname}', port= {port}, is_secure=False, calling_format=boto.s3.connection.OrdinaryCallingFormat () ) bucket = conn.create_bucket ('my-new-bucket') for bucket in conn.get_all_buckets (): print "{name} {created}" .format (name=bucket.name, created=bucket.creation_date,)
Replace {hostname}, {port} with real-world hostname (or ip) and RGW ports. Execute the command to test:
$python s3test.py
The output should look like this:
My-new-bucket-2 2017-02-19T04:34:17.530Z5.4.8 Test Swift Interface
Swfit can be accessed from the command line. First install the relevant software packages:
$apt-get install python-setuptools$ apt-get install python-swiftclient
Execute the following command, Fan Wen Swift interface:
$swift-A http://{IP ADDRESS}: {port} / auth/1.0-U testuser:swift-K'{swift_secret_key} 'list
Replace relevant parameters such as {IP ADDRESS}, {port}, {swift_secret_key}, where {swift_secret_key} is the value of swift_keys- > secret_key returned by the radosgw-admin command when the Swift user is created. The normal output should be:
My-new-bucket above is all the content of the article "how to build RGW in Ceph deployment". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.