In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Today to play Ceph object storage, before the start, first chat will be idle, I think life is everywhere unstructured data, the simplest example, the following two industries, one is live broadcast, the other is photography.
Now that the live broadcast industry is so popular, it is no exaggeration to say that even a live broadcast software will be produced every day. Not only the video streaming industry, but also cloud photography, which is very popular now. What is cloud photography? I believe that friends who often attend meetings should know that some photos taken on the spot can be sent out immediately, which is very convenient. I believe it will definitely be popular in the future. Some of you who are observant will notice that every photo is marked with a watermark, which is V. Photos. What the hell is this?
Here's a quick look at this company.
V. Photos is a cloud photography service platform, established in 2015, mainly dedicated to providing B end business users with intelligent and convenient commercial photography and photo synchronization archive management professional-level solutions.
The gossip ends here, biabiabiabia...
In addition to streaming media and photo photography, there are medical, banking, satellite and other industries that will generate a lot of unstructured data. So seeing that object storage has so much potential forces us to learn about object storage. The so-called live and learn old, especially we do IT, have to learn new technology every day.
Let's take a look at how Ceph object storage is deployed
The first is to deploy a Ceph environment, which will not be repeated here. Many installation documents on the Internet are relatively clear.
Focus on the RGW part
After installing the cluster
ceph-deploy install --rgw devin-ceph2 #Because it's a test, so only one rgw
Then create an RGW instance
ceph-deploy rgw create devin-ceph2
Then at this time OK, after success will prompt you to visit port 7480
http://10.0.100.201:7480
You will see the following:
anonymous
Because RGW defaults to Civeweb, the default port is 7480, and some people will say, then I can not modify the RGW port ah. The answer must be yes.
Modify the Ceph configuration file for modification. Below is my profile.
[client.rgw.devin-ceph2]host = devin-ceph2rgw_enable_ops_log =truergw_frontends ="civetweb port=80"rgw dns name = s3.devin.comrgw socket path =/var/run/ceph-client.radosgw.sockkeyring =/etc/ceph/ceph.client.radosgw.keyring
You can see that my port is set to 80.
After modifying the configuration file, synchronize to nodes and restart rgw service
ceph-deploy --overwrite-conf config push devin-ceph2 devin-ceph3 devin-ceph4systemctl restart ceph-radosgw.target
So this RGW installation is complete, so how to use RGW? Or how do I prove that my RGW is good?
Some people may say: you stupid ah, just can visit the page, proved successful.
Some people may say: light access to a page tube P ah, to be able to use it.
Don't worry, let's talk about the next two ways to play, one is S3cmd mode
First install S3cmd
yum -y install s3cmd
After installation, run s3cmd --configure to initialize the configuration (to put it bluntly, generate a configuration file)
Then you will be prompted to enter the access key and secret key. Children who have not played ASW related products may say, what are these two keys for? AK and SK, in the jargon. The key is used for authentication and verification. Let's see how it is generated.
If you want to connect RGW with tools, you must first have users. Then create a user.
radosgw-admin user create -uid=devin -display-name="Devin" -email=devin@example.com
AK and SK information will be available after creation. Remember to copy it and use it later.
After copying, configure s3cmd -configure.
After configuration, you can start playing. S3cmd common commands
s3cmd ls #View available buckets3cmd mb s3://devin_bucket #Create bucket, and bucket name is unique, cannot repeat s3cmd ls s3://devin_bucket #List bucket content s3cmd put devin.txt s3://devin_bucket #Upload local file to specified buckets3cmd put --acl-public devin.txt s3://devin_bucket #Upload local file to specified bucket, and enable file anonymous access s3cmd get s3://devin_bucket/devin.txt #Download file locally
Maybe you will encounter problems when playing, so how can you make mistakes?
You can add-d after the command s3cmd, which means turn on debug and debug.
The most common problem encountered is resolution. So how do you solve the problem of parsing?
Check out this article on how to configure lightweight DNS.
And then there's the python-boto approach.
First install python-boto
yum install python-boto
Then create a Python script.
vi s3test.py
It reads as follows:
import boto.s3.connection access_key = 'Y2S78LKZ1ROD0MGIDUBC'secret_key = 'LyGCgoydLI2MGA7C0PtynyfBa3aKODNYQ0sHDMtP'conn = boto.connect_s3( aws_access_key_id=access_key, aws_secret_access_key=secret_key, host='s3.devin.com', port=80, is_secure=False, calling_format=boto.s3.connection.OrdinaryCallingFormat(), ) bucket = conn.create_bucket('devin-bucket')for bucket in conn.get_all_buckets(): print"{name} {created}".format( name=bucket.name, created=bucket.creation_date,)
Here we should pay attention to the modification of AK and SK and host domain name
And then you execute the script.
python s3test.py
The script roughly means importing boto s3 module and then borrowing AK and SK to verify and create a bucket named devin-bucket. After creation, print the result.
OK, this article Ceph object storage is the end of the next article to talk about how to dock OwnCloud network disk applications.
[Posted by Ceph China Community, August 15, 2017]
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.