This service is introduced only on Alibaba Cloud Object Storage Service (OSS) V2.0. In V1.0, image resources are mainly stored in the specific directories of Alibaba Cloud ECS hosts.
During each system upgrade, data backup is required. A large part of the backup data is image resource files. Starting from the v2.0, Alibaba Cloud stores the image resources and web resources and other data used in applications on the OSS. Therefore, when data backup is required during each system upgrade, it is not necessary to backup image resource files, thus reducing the size of backup files and the backup time.
After OSS is used, image resource files generated by v1.0 need to be completely migrated to OSS. OSS provides SDKs for Python for operating OSS. Therefore, python is used as the development tool to migrate image resource files.
The development environment is CentOS 6.4.
1. Check python development environment
Run the command on the console: python
If the output content is: command not found, it indicates that python is not installed. Install python with the command: yum install python. After the command is executed, the installation starts.
2. Check whether pip and setuptools exist
pip and setuptools are python package management tool. Run pip. If the command does not exist, you must install it. In centos, currently the two tools cannot be directly installed with yum. You can download get-pip.py script in the following link:
https://pip.pypa.io/en/stable/installing/. Use the command: python get-pip.py to complete the installation of pip and setuptools.
3. Install oss2
The latest oss sdk is oss2 which is incompatible with previous versions. Run the command: pip install oss2 to complete the installation of oss2.
4. Check whether the oss2 environment is configured
Enter the command: python
Enter the following command: import oss2 and press Enter.
The preceding output content indicates that oss2 development environment is successfully created.