Installing and Initializing obsutil
obsutil is used to upload software packages to OBS.
Prerequisites
- You have obtained AK/SK. For details, see Access Keys.
- You have obtained the endpoint of the region where ServiceStage is deployed. For details, see Regions and Endpoints.
- You have created a bucket in OBS in the same region as ServiceStage where the component is deployed to store software packages. For details, see Creating a Bucket.
Procedure
- Log in to the Linux VM where Jenkins is installed and install obsutil. For details, see Download and Installation.
Before installing obsutil, run the following command on the Linux VM where Jenkins is located to check the VM OS type:
echo $HOSTTYPE
- If the command output is x86_64, download the obsutil software package for the AMD 64-bit OS.
- If the command output is aarch64, download the obsutil software package for the Arm 64-bit OS.
- Initialize obsutil.
{path}/obsutil config -i=ak -k=sk -e={endpoint}
Where,
- {path} is the obsutil installation path, for example, /root/tools/obsutil/obsutil_linux_amd64_5.4.6.
- {endpoint} is the obtained endpoint of the region where ServiceStage is deployed.
- Check whether obsutil can be used to upload files to OBS.
- Create a test file.
touch test.txt
- Use obsutil to upload the file.
/root/tools/obsutil/obsutil_linux_amd64_5.4.6/obsutil cp test.txt obs://{OBS bucket name}
Replace {OBS bucket name} with the name of the OBS bucket to be used. In this example, the bucket name is obs-mzc. Upload the test.txt file created in the current directory to the obs-mzc bucket. If the "Upload successfully" is displayed, the upload is successful.
[root@ecs-jenkins jar]# /root/tools/obsutil/obsutil_linux_amd64_5.4.6/obsutil cp test1.txt obs://obs-mzc Start at 2023-07-24 06:09:53.49127587 +0000 UTC Parallel: 5 Jobs: 5 Threshold: 50.00MB PartSize: auto VerifyLength: false VerifyMd5: false CheckpointDir: /root/.obsutil_checkpoint [-----------------------------------------------------------------------------------------] 100.00% 138B/s 58B/58B 622ms Upload successfully, 58B, n/a, /root/jar/test1.txt --> obs://obs-mzc/test1.txt, cost [621], status [200], request id [000001898684BD614014A659111ABF74]
- Create a test file.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot