Alluxio
ProductsLanguageHome
AI-3.6 (stable)
AI-3.6 (stable)
  • Overview
    • Alluxio Namespace and Under File System
    • Worker Management and Consistent Hashing
    • Multi Tenancy and Unified Management
    • I/O Resiliency
  • Getting Started with K8s
    • Resource Prerequisites and Compatibility
    • Installation
      • Install on Kubernetes
      • Handling Images
      • Advanced Configuration
      • License
    • Monitoring and Metrics
    • Management Console
      • Deployment
      • Navigation
      • User Roles & Access Control
    • Cluster Administration
    • System Health Check & Quick Recovery
    • Diagnostic Snapshot
  • Storage Integrations
    • Amazon AWS S3
    • Google Cloud GCS
    • Azure Blob Store
    • Aliyun OSS
    • Tencent COS
    • Volcengine TOS
    • Baidu Object Storage
    • HDFS
    • Network Attached Storage (NAS)
  • Data Access
    • Access via FUSE (POSIX API)
      • Client Writeback
      • Client Virtual Path Mapping
    • Access via S3 API
    • Access via PythonSDK/FSSpec
    • Data Access High Availability
      • Multiple Replicas
      • Multiple Availability Zones (AZ)
    • Performance Optimizations
      • File Reading
      • File Writing
      • Metadata Listing
    • UFS Bandwidth Limiter
  • Cache Management
    • Cache Filter Policy
    • Cache Loading
    • Cache Eviction
      • Manual Eviction by Free Command
      • Auto Eviction by TTL Policy
      • Auto Eviction by Priority Policy
    • Stale Cache Cleaning
    • Cache Quota
  • Performance Benchmarks
    • Fio (POSIX) Benchmark
    • COSBench (S3) Benchmark
    • MLPerf Storage Benchmark
  • Security
    • TLS Support
  • Reference
    • User CLI
    • Metrics
    • S3 API Usage
    • Third Party Licenses
  • Release Notes
Powered by GitBook
On this page
  • Prerequisites
  • Basic Setup
  • Advanced Setup
  • Enabling HTTPS
  • BOS multipart upload
  • Setting Request Retry Policy
  • High Concurrency Tuning
  1. Storage Integrations

Baidu Object Storage

Last updated 2 days ago

This guide describes how to configure as Alluxio's under storage system. Baidu Object Storage (BOS) provides stable, secure, efficient and highly scalable storage services.

Prerequisites

Before using BOS with Alluxio, follow the to sign up for BOS and create a BOS bucket.

Before you get started, please ensure you have the required information listed below:

<BOS_BUCKET>

Create a new BOS bucket or use an existing bucket

<BOS_DIRECTORY>

The directory you want to use in the bucket, either by creating a new directory or using an existing one

<BOS_ACCESS_KEY_ID>

<BOS_ACCESS_KEY_SECRET>

<BOS_ENDPOINT>

<BOS_REGION>

Basic Setup

Use the to add a new mount point, specifying the Alluxio path to create the mount on and the BOS path as the UFS URI. Credentials and configuration options can also be specified as part of the mount operation as described by.

An example ufs.yaml to create a mount point with the operator:

apiVersion: k8s-operator.alluxio.com/v1
kind: UnderFileSystem
metadata:
  name: alluxio-bos
  namespace: alx-ns
spec:
  alluxioCluster: alluxio-cluster
  path: bos://<BOS_BUCKET>/<BOS_DIRECTORY>
  mountPath: /bos
  mountOptions:
    fs.bos.accessKeyId: <BOS_ACCESS_KEY>
    fs.bos.accessKeySecret: <BOS_ACCESS_KEY_SECRET>
    fs.bos.endpoint: <BOS_ENDPOINT>

An example command to mount bos://<BOS_BUCKET>/<BOS_DIRECTORY> to /bos if not using the operator:

bin/alluxio mount add --path /bos/ --ufs-uri bos://<BOS_BUCKET>/<BOS_DIRECTORY> \
  --option fs.bos.accessKeyId=<BOS_ACCESS_KEY> --option fs.bos.accessKeySecret=<BOS_ACCESS_KEY_SECRET> \
  --option fs.bos.endpoint=<BOS_ENDPOINT>

Note that if you want to mount the root of the BOS bucket, add a trailing slash after the bucket name (e.g. bos://BOS_BUCKET/).

Advanced Setup

Note that configuration options can be specified as mount options or as configuration properties in conf/alluxio-site.properties. The following sections will describe how to set configurations as properties, but they can also be set as mount options via --option <key>=<value>.

Enabling HTTPS

To enable the use of the HTTPS protocol for secure communication with BOS with an additional layer of security for data transfers, configure the following setting in conf/alluxio-site.properties:

fs.bos.endpoint=<BOS_ENDPOINT>
alluxio.underfs.bos.secure.http.enabled=true

BOS multipart upload

The default upload method uploads one file completely from start to end in one go. We use multipart-upload method to upload one file by multiple parts, every part will be uploaded in one thread. It won't generate any temporary files while uploading.

To enable BOS multipart upload, you need to modify conf/alluxio-site.properties to include:

alluxio.underfs.bos.multipart.upload.enabled=true

There are other parameters you can specify in conf/alluxio-site.properties to potentially speed up the upload.

# Timeout for uploading part when using multipart upload.
alluxio.underfs.object.store.multipart.upload.timeout
# Thread pool size for BOS multipart upload.
alluxio.underfs.bos.multipart.upload.threads
# Multipart upload partition size for BOS. The default partition size is 64MB. 
alluxio.underfs.bos.multipart.upload.partition.size

Setting Request Retry Policy

Sometimes there may be an error in accessing UFS because the server is temporarily unable to respond. You can configure a retry policy for UFS requests.

Each I/O request sent to UnderFS like getObject, putObject, MultipartUpload, Alluxio will check the response. If the response is an error, and the error code suggests it may be retryable, the request will be resubmitted according to the retry policy in configuration. Alluxio will keep trying until the request is successful or reaches the maximum number of retries. The wait interval between successive retries will gradually increase from the configured base sleep time to the maximum sleep time.

The following error codes are categorized as retryable: 500 HTTP_INTERNAL_ERROR, 502 HTTP_BAD_GATEWAY, 503 HTTP_UNAVAILABLE, 503 Slow Down, and 504 HTTP_GATEWAY_TIMEOUT.

Note:

  • 4xx status code usually represents client errors, such as NOT_FOUND, PERMISSION_DENIED, UNAUTHENTICATED, etc. Such errors should never be retried since the issue is on the client side.

  • 5xx status code usually represents server errors, but not all 5xx error should be retried. For example, 501 HTTP_NOT_IMPLEMENTED should not be retried.

If you want to set the retry policy for the UFS accessing request, you need to modify conf/alluxio-site.properties to include:

# the max number of retry in one UnderFS accessing request.
alluxio.underfs.business.retry.max.num=10

# the sleep time between the two retries after the initial failure
alluxio.underfs.business.retry.base.sleep=30ms

# the max sleep time between two retries
alluxio.underfs.business.retry.max.sleep=30s

High Concurrency Tuning

When integrating Alluxio with BOS, you can optimize performance by adjusting the following configurations:

  • alluxio.underfs.bos.connection.max: Controls the max connection number with BOS. Default value is 1024.

  • alluxio.underfs.bos.io.threads.num: Controls the IO thread with BOS. Default value is 256.

  • alluxio.underfs.bos.socket.timeout: Controls the socket timeout with BOS. Default value is 50 seconds.

  • alluxio.underfs.bos.connect.timeout: Controls the connection timeout with BOS. Default value is 50 seconds.

The for BOS, which are created and managed in the

The for BOS, which are created and managed in the

The internet endpoint of the bucket, which can be found in the bucket overview page with values like bj.bcebos.com and gz.bcebos.com. Available endpoints are listed in the .

The region where the bucket is located, such as cn-beijing or cn-guangzhou. Available regions are listed in the .

Access Key ID
BOS AccessKey management console
Secret Access Key
BOS AccessKey management console
Region与Endpoint
Region与Endpoint
Baidu Object Storage (BOS)
BOS Process for Getting Started
mount table operations
configuring mount points