tencent cloud

Cloud File Storage

Releases Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Strengths
Storage Classes and Performance
Use Cases
Recommended Regions
Use Limits
Service Regions and Service Providers
Purchase Guide
Billing Overview
Pricing Overview
General Series Billing
Turbo Series Billing
High-Throughput CFS Billing
Billing Mode
IA ‍Storage Billing
Storage Resource Units
Resource Purchase
Viewing Bills
Arrears Reminder
Getting Started
Creating File Systems and Mount Targets
Using CFS File Systems on Linux Clients
Using CFS File Systems on Windows Clients
Using CFS Turbo on Linux Clients
Using the CFS Client Assistant to Mount File Systems
Operation Guide
Access Management
Managing File Systems
Permission Management
Using Tags
Snapshot Management
Guide for Cross-AZ and Cross-Network Access
Automatically Mounting File Systems
Data Migration Service
User Permission Management
User Quotas
Data Encryption
Data Lifecycle Management
Upgrading Standard File Systems
Practical Tutorial
Selecting Kernels for NFS Clients
Managing Turbo CFS Directories
Terminating Compute Instances
Using CFS on TKE
Using CFS on SCF
Using CFS Turbo on TKE
Using CFS Turbo on TKE Serverless Cluster
Selecting a Network for Turbo CFS
Copying Data
CFS Storage Performance Testing
API Documentation
History
Introduction
API Category
Snapshot APIs
File system APIs
Lifecycle APIs
Other APIs
Data Flow APIs
Making API Requests
Permission Group APIs
Service APIs
Scaling APIs
Data Migration APIs
Data Types
Error Codes
Troubleshooting
Client Use Bottleneck due to Large Number of Small Files or Parallel Requests
FAQs
CFS Service Level Agreement
Contact Us
Glossary

Using CFS on SCF

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-01-22 22:15:48

Overview

Tencent Cloud Serverless Cloud Function (SCF) is a serverless execution environment that enables you to build and run applications without having to purchase and manage servers. Simply code in a supported language and set the execution conditions, and your code can be run on the Tencent Cloud infrastructure elastically and securely. SCF is an ideal computing platform for use cases such as real-time file processing and data processing.
SCF is a service-level computing resource that features fast iteration and super-fast deployment. As a result, it requires the separation of storage and computing, which makes CFS, a high-performance shared storage service, the best storage solution for SCF. With only a few easy steps, your function can easily access files stored in CFS. The benefits of using CFS on SCF are as follows:
The execution space of functions is unlimited.
Multiple functions can share the same file system to share files.

Directions

Associating an authorization policy

Note:
To use the CFS service, SCF needs permission to operate on your CFS resources.
Follow the steps below to grant the permission to your account:
1. Associate the SCF_QcsRole role with the QcloudCFSReadOnlyAccess policy as instructed in Modifying Role. The result of a successful association is shown below: If you don't perform this operation for your currently used account, problems such as the failure to save functions and the unavailability of CFS features may occur.



2. If the currently used account is a sub-account, request the root account to associate the sub-account with the QcloudCFSReadOnlyAccess policy as instructed in Setting Sub-user Permissions. The result of a successful association is shown below: If you don't perform this operation for your currently used sub-account, problems such as the unavailability of CFS features may occur.




Creating a VPC

Build a VPC as instructed in Building Up an IPv4 VPC.

Creating CFS resources

Create a CFS file system as instructed in Creating File Systems and Mount Targets.
Note:
Currently, SCF allows only CFS file systems with network type being VPC to be added as mount targets. When creating a CFS file system, select the same VPC as that of the target function to enable communication.

Mounting and using a CFS file system

1. Log in to the SCF console and select Functions on the left sidebar.
2. On the Function Service page, select the name of the function to be configured.
3. On the Function configuration tab of the Function management page, click Edit in the top-right corner.
4. Check Enable for VPC and select the VPC where your CFS file system resides.
5. Check Enable for File system and enter the following information to mount the file system.
User ID and User group ID: IDs of the user and user group in CFS file system. SCF uses "10000" for both the user ID and user group ID by default to manipulate your CFS file system. Set the file owner and corresponding group permission as needed and ensure that your CFS file system has the required permission. For more information, see Managing Permissions.
Remote directory: The remote directory in the CFS file system to be accessed by the function, which consists of a file system and a remote directory.
Local directory: Mount target of the local file system. You can use a subdirectory in the /mnt/ directory to mount the CFS file system.
File System ID: Select the file system to be mounted in the drop-down list.
Mount point ID: Select the ID of the mount target corresponding to the file system in the drop-down list.
6. Click Save at the bottom of the page. You can run the following function code to start using the CFS file system.
'use strict';
var fs = require('fs');
exports.main_handler = async (event, context) => {
await fs.promises.writeFile('/mnt/myfolder/filel.txt', JSON.stringify(event));
return event;
};

Performance test for using a CFS file system on SCF

You can use this demo to test how well CFS performs on SCF.


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백