Ali cloud OSS to build blog map bed

First, the basic concept

Before bed for the blog set up map, to understand some concepts

Figure bed

Sometimes do not want to put everything into all the blog server resides, such as a picture into another place, this time we need something called map bed. Figure bed is a picture of the storage server, upload pictures to chart the bed, you can get by connecting to the picture.

In the halo background blog settings - attachment settings have set map bed address of the server, the storage location can be local, they shoot clouds, seven cattle cloud, Ali cloud, Tencent cloud, Baidu cloud, etc. If your ECS larger space, or simply do not want trouble, you can ignore this article. Since my ECS only 40G of space, but also to keep other assorted things, so there will be no local picture, but the use Ali cloud OSS (object store) , so it will not take up hard disk space ECS itself

Ali cloud the basic concepts of OSS

To use OSS, you have to understand many concepts, so I will just introduce the concept that we need to use, others I did not go through much practice, after all, energy is limited.

OSS concept: This simply means that a hard disk, but in the cloud and provide the function to be stronger than the hard disk

The official cited the concept: Ali cloud object storage service (Object Storage Service, referred to as OSS), is to provide Ali cloud mass, secure, low-cost, highly reliable cloud storage service. Design data persistence which is not less than 99.9999999999 percent (12 9), designed to service availability (or business continuity) is not less than 99.995%. OSS has a RESTful API interfaces and platform-independent, you can, any time, any place to store and access any type of data in any application. You can use the API provided by Ali cloud, SDK interface or OSS migration tool easily vast amounts of data into or out of Ali cloud OSS. Data stored in the cloud OSS Ali later, you can select the standard memory (Standard) as a mobile application, large sites, photo sharing or major audio and video storage hot spots, you can also choose a lower cost, longer-term storage of low-access memory ( infrequent access) and archival storage (archive) as a way to store infrequently accessed data.

OSS usage scenarios:

  • Communities, media-sharing site, e-commerce, and other forms of scale Webmaster
  • APP applications, software application developers
  • Game development companies
  • Hardware manufacturers supporting the application developer
  • Users of large-scale data storage requirements

OSS forum for storage sites and software applications accessories, high definition pictures, audio video, backup files, etc., and a variety of APP application, multi-terminal synchronization software, disk storage files downloaded station network

OSS purchase Resource Kit

bucket (storage space)

Bucket is a container for storing objects (Object) is. All objects must belong to a storage space. Storage properties have various configurations (including geographical, access, storage type, etc.). According to the actual needs of the user can create different types of storage space to store different data.

Simple to understand: bucket as space is similar to the hard disk, folder store some different types of files, etc.

Official documents:
1. The same internal storage space is flat, there is no concept of the file system and the like, all the objects directly under its corresponding storage space
2. Each user may have a plurality of storage space
3. Storage space the name can not be modified once created in the name of OSS within the range of
the number of objects internal storage space 4. There is no limit

object (storage file)

object is a bucket in the file. object from the meta-information, user data, file name components. object is identified by a unique internal bucket Key. meta information object is a key-value pair, showing some of the properties of the object, such as the last modified time, size information, and the user can store some customized information in the meta information.

Simple to understand: bucket to store different types of files, folders, etc.

region (region)

represents a region in which the physical position of the OSS. region specified when creating the bucket, once the specified change is not allowed. bucket all the object exists the region. And each region, has an external network access domain , ECS access intranet access domain.

tips: When we visit OSS, is used in the external network access domain name !

Example: When you create a bucket, chose Hangzhou (ie region), after a specified can not be changed. Hangzhou extranet access domain name oss-cn-hangzhou.aliyuncs.com, network access domain Hangzhou ECS access to oss-cn-hangzhou-internal.aliyuncs.com.

endpoint (access domain)

Access endpoint represent external access to the OSS domain. External network access domain name that is mentioned above and intranet access domain name ECS access. When accessing a different region, he requires a different domain name.

Example: in Hangzhou (ie region) to create a bucket named test. Users in Anhui, then accessing the OSS test, will be used to access external network domain; if the same region of the ECS to access the OSS test, will be used in the network access domain.

accesskey (access keys)

accesskey refers to the access authentication used in accesskey_id and accesskey_secret. We need to be presented by specifying accesskey_id and accesskey_secret to the OSS in the bucket as identity cards, in order to ensure OSS in the bucket agree that we visit one of the operations (including read, write, delete, etc.).

accesskey_id used to identify legitimate users
accesskey_secret used to identify the legitimate user's password

Two, OSS accounting principles

We use OSS, OSS will need to know what resources and capabilities required fee, to control the costs arising from OSS. Costs incurred I used the following accounting items, other expenses see OSS billing

Ali cloud billing OSS components:

  • Storage costs
  • Traffic costs
  • Request fee
  • Data processing costs

Storage costs

Before using the bucket, we need to buy in a region of storage resources. OSS storage costs can be according to the amount of monthly billing and packages. Which indicate how much charge according to the amount by deduction, the package refers to the monthly pre-purchased 40G, if more than 40G, more than by the amount of charge. After the measurement, I choose to buy a package of monthly storage resources.

tips: Be sure to select public read , otherwise it will create links in the bucket of the blog and not on the OSS, resulting in blog can upload pictures, but pictures can not be used. Need to use it, to authenticate string manipulation, a lot of trouble.

Traffic costs

Whether it is read from OSS, download, or delete operation, will generate traffic. So part of the flow for a fee. We have used two types of traffic:

  • Extranet outgoing traffic (fee): browse through the Internet or downloaded from the OSS to the local data traffic generated by end
  • External network traffic flow into the (free): Flow generated from the local side to upload data to the Internet via OSS

In which the external network traffic accounting outflow :

  • 00: 00-08: 00 (leisure): 0.25 yuan / GB
  • 8: 00-24: 00 (busy): 0.50 yuan / GB

Request fee

The operation of the OSS are ultimately a call to the OSS API. Request fee billing based on the number of times you call the OSS API interface. Because OSS console operation is achieved by OSS API calls, so using OSS console will also have the number of requests (0.01 yuan / million times)

Request cost is relatively cheap, the number of requests reached 10,000 times, charge 0.01 yuan, the number of requests each month my blog is currently estimated at less than 10,000, so the price is very cheap.

Data processing costs

I do not have to use image processing, but may be used, so that listed here. Data processing is mainly picture processing, OSS calculate the amount of data processing according to the actual size of the original file processing. A is for example, image cropping, image processing metrology data is the actual size of the image A.

Billing: a single account per month free deal with 10TB of image files, more than part by the amount of charge (0.025 yuan / GB), I think I can not handle more than a month 10TB of image files, so even if I use to the image processing, it will not incur additional costs, so it is assured.

Third, the binding domain and configure the CNAME

After we purchase standard storage bag, into the OSS console , pay attention to the operation of the OSS console is considered the number of requests!

About creating a bucket is very simple, see Create a bucket

When you create a bucket on the option, is the need to modify the bucket names , Region , read and write permissions (read public reading)

Binding a custom domain name and CNAME configuration

If we have our own second-level domain (such as my epiol.top), and has been in the Ministry for the record, you can bind custom domain name, and add a host record on the basis of second-level domain. For example, my host record oss.epiol.top

  1. Binding a custom domain name
    into the map interface, and select bind the user domain name , remember to check automatically add a CNAME record

This will automatically cloud resolution DNS to configure a CNAME record, you do not have to go manually add, very convenient!

  1. Verify CNAME configuration is to take effect
    calling cmd ( win+ r) the ping oss.epiol.top, if the external network to access the correct domain appears bucket

  2. SSL certificate application
    if OSS uploaded to the bucket, you need to use the HTTPS protocol, you need to configure the SSL certificate, we can go to Ali cloud SSL Certificate Management Platform Certificate of Free Application for oss.epiol.top

After downloading the certificate, copy of the SSL certificate to bind the user domain name in the certificate is hosted in

Fourth, rights management

OSS need to verify the identity of the user to decide whether to allow the user to access and manipulate any of a bucket OSS.

  1. Enter account - Access control - add a user

  2. Add permissions for the user

Five, halo blog set in the background

About extranet access domain ++ ++ (endpoint), viewed in the bucket

Transfer from EPIOL'S BLOG

Released five original articles · won praise 9 · views 7263

Guess you like

Origin blog.csdn.net/qq_42058062/article/details/104825121