• Stars
    star
    718
  • Rank 61,016 (Top 2 %)
  • Language
    C++
  • License
    GNU General Publi...
  • Created over 8 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Export s3fs for aliyun oss.

OSSFS

Version Build Status

README of Chinese

Introduction

The OSSFS enables you to mount Alibaba Cloud OSS buckets to a local file in Linux/Mac OS X systems. In the system, you can conveniently operate on objects in OSS while using the local file system to maintain data sharing.

Features

The OSSFS is built based on S3FS and has all the features of S3FS. Main features:

  • Support a majority of the POSIX file system features, including file read/write, directory, link operation, permission, uid/gid, and extended attributes).
  • Support upload of large files through the OSS multipart feature.
  • Support MD5 verification to ensure data integrity.

Install OSSFS

Precompiled installer

We have prepared an installer package for common Linux releases:

  • Ubuntu-14.04
  • CentOS-7.0/6.5/5.11

Please select the corresponding installer on the Version Releases Page to download and install the tool. The latest version is recommended.

  • For Ubuntu systems, the installation command is:
sudo apt-get update
sudo apt-get install gdebi-core
sudo gdebi your_ossfs_package
  • For CentOS6.5 or above, the installation command is:
sudo yum localinstall your_ossfs_package
  • For CentOS5, the installation command is:
sudo yum localinstall your_ossfs_package --nogpgcheck

Install by source code

If you fail to find the corresponding installer package, you can also install the tool by compiling the code on your own. First install the following dependency libraries before compilation:

Ubuntu 14.04:

sudo apt-get install automake autotools-dev g++ git libcurl4-gnutls-dev \
                     libfuse-dev libssl-dev libxml2-dev make pkg-config

CentOS 7.0:

sudo yum install automake gcc-c++ git libcurl-devel libxml2-devel \
                 fuse-devel make openssl-devel

Then you can download the source code from GitHub and compile the code for installing the tool:

git clone https://github.com/aliyun/ossfs.git
cd ossfs
./autogen.sh
./configure
make
sudo make install

Run OSSFS

Set the bucket name, access key/ID information and save the information to the "/etc/passwd-ossfs" object. Note: The ACL of this object must be set correctly, and 640 is recommended. 600 is recommended if the password file is not the default path.

echo my-bucket:my-access-key-id:my-access-key-secret > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs

Mount the OSS bucket to the specified directory.

ossfs my-bucket my-mount-point -ourl=my-oss-endpoint

Example

Mount the 'my-bucket' bucket to the '/tmp/ossfs' directory and the AccessKeyId is 'faint', the AccessKeySecret is '123', and the OSS endpoint is 'http://oss-cn-hangzhou.aliyuncs.com'.

echo my-bucket:faint:123 > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
mkdir /tmp/ossfs
ossfs my-bucket /tmp/ossfs -ourl=http://oss-cn-hangzhou.aliyuncs.com

Unmount the bucket:

umount /tmp/ossfs # root user
fusermount -u /tmp/ossfs # non-root user

Common settings

  • You can use 'ossfs --version' to view the current version and 'ossfs -h' to view available parameters.

  • If you are using OSSFS on an Alibaba Cloud ECS instance, you can use the intranet domain name to save traffic charges and improve speed:

      ossfs my-bucket /tmp/ossfs -ourl=http://oss-cn-hangzhou-internal.aliyuncs.com
    
  • In a Linux system, updatedb will scan the file system on a regular basis. If you do not want the OSSFS-mounted directory to be scanned, refer to FAQ to configure skipping the mounted directory.

  • If eCryptFs or other systems that require XATTR are not used, you can improve performance by adding the '-o noxattr' parameter.

  • The OSSFS allows you to specify multiple sets of bucket/access_key_id/access_key_secret information. When multiple sets of information are in place, the format of the information written to passwd-ossfs is:

      bucket1:access_key_id1:access_key_secret1
      bucket2:access_key_id2:access_key_secret2
    
  • The Supervisor is recommended in a production environment to start and monitor the OSSFS process. For usage see FAQ.

Advanced settings

  • You can add the '-f -d' parameters to run the OSSFS in the foreground and output the debug log.
  • You can use the '-o kernel_cache' parameter to enable the OSSFS to use the page cache of the file system. If you have multiple servers mounted to the same bucket and require strong consistency, do not use this option.

Errors

Do not panic in case of errors. Troubleshoot the problem following the steps below:

  1. If a printing error occurs, read and understand the error message.

  2. View '/var/log/syslog' or '/var/log/messages' to check for any related information.

     grep 's3fs' /var/log/syslog
     grep 'ossfs' /var/log/syslog
    
  3. Retry OSSFS mounting and open the debug log:

     ossfs ... -o dbglevel=debug -f -d > /tmp/fs.log 2>&1
    

    Repeat the operation and save the '/tmp/fs.log' to check or send the file to me.

Restrictions

Compared with local file systems, OSSFS has some restrictions in provided functionality and performance. Specifically speaking:

  • Random or append writes to files may lead to rewrite of the entire file.
  • Metadata operations, such as list directory perform poorly because of the remote access to the OSS server.
  • The rename operations on files/folders are not atomic.
  • When multiple clients are mounted to the same OSS bucket, you have to coordinate actions of various clients on your own. For example, keep multiple clients from writing data to the same file.
  • Hard link is not supported.
  • The tool is not suitable for scenarios with highly concurrent reads/writes as it will increase the system load.

Get involved in development

  1. For the development procedure, refer to: https://github.com/rockuw/oss-sdk-status#development-oss-members-only.
  2. After the code is submitted, ensure the travis CI is in the PASS status.
  3. Every time a new version is released:
  • Run 'scripts/build-pkg.py' to generate the corresponding installer package.
  • Release a version on the Release Page.
  • Upload the generated installer package to the corresponding Release directory.

FAQs

FAQ

Related

  • OSSFS Wiki
  • S3FS- Mount the s3 bucket to the local file system through the fuse interface.

Contact us

License

Copyright (C) 2010 Randy Rizun [email protected]

Copyright (C) 2015 Haoran Yang [email protected]

Licensed under the GNU GPL version 2

More Repositories

1

oss-browser

OSS Browser 提供类似windows资源管理器功能。用户可以很方便的浏览文件,上传下载文件,支持断点续传等。
JavaScript
3,111
star
2

aliyun-openapi-java-sdk

Alibaba Cloud SDK for Java
Java
1,379
star
3

aliyun-oss-java-sdk

Aliyun OSS SDK for Java
Java
1,195
star
4

alibaba-cloud-sdk-go

Alibaba Cloud SDK for Go
Go
1,104
star
5

alicloud-android-demo

Java
982
star
6

aliyun-openapi-python-sdk

Alibaba Cloud SDK for Python
Python
980
star
7

aliyun-oss-php-sdk

Aliyun OSS SDK for PHP
PHP
975
star
8

aliyun-oss-go-sdk

Aliyun OSS SDK for Go
Go
933
star
9

aliyun-oss-python-sdk

Aliyun OSS SDK for Python
Python
907
star
10

darabonba

Darabonba 是一种用于 OpenAPI 的 DSL 语言,可以用来生成多语言的 SDK、Code Sample、Test Case 等代码
JavaScript
894
star
11

alibabacloud-alfa

阿里云微前端解决方案
TypeScript
838
star
12

aliyun-oss-android-sdk

Android SDK for aliyun object storage service
Java
793
star
13

aliyun-cli

Alibaba Cloud CLI
Go
770
star
14

aliyun-openapi-php-sdk

[Abandoned] Open API SDK for PHP developers
PHP
605
star
15

terraform-provider-alicloud

Terraform AliCloud provider
Go
573
star
16

aliyun-openapi-net-sdk

Alibaba Cloud SDK for .NET
C#
534
star
17

rds_dbsync

围绕 PostgreSQL Greenplum ,实现易用的数据的互迁功能项目
C
528
star
18

openapi-sdk-php

Alibaba Cloud SDK for PHP
PHP
501
star
19

iotkit-embedded

高速镜像: https://code.aliyun.com/linkkit/c-sdk
C
492
star
20

aliyun-oss-ios-sdk

iOS SDK for aliyun object storage service
Objective-C
450
star
21

alicloud-ios-demo

Demos for AMS iOS SDKs
Objective-C
427
star
22

ossutil

A user friendly command line tool to access AliCloud OSS.
Go
427
star
23

aliyun-odps-python-sdk

ODPS Python SDK and data analysis framework
Python
407
star
24

api-gateway-demo-sign-java

aliyun api gateway request signature demo by java
Java
371
star
25

alibabacloud-microservice-demo

An Alibaba Cloud native microservice demo powered by Apache Dubbo and Spring Cloud Alibaba
Java
368
star
26

aliyun-oss-csharp-sdk

Aliyun OSS SDK for C#
C#
360
star
27

NeWCRFs

Python
344
star
28

surftrace

surftrace is a tool that allows you to surf the linux kernel
Python
332
star
29

conditional-lane-detection

Python
328
star
30

aliyun-log-jaeger

Go
294
star
31

tablestore-examples

Example code for aliyun tablestore.
Java
236
star
32

tablestore-timeline

TableStore-Timeline Model for Social scene
Java
236
star
33

coolbpf

C
222
star
34

openapi-sdk-php-client

Official repository of the Alibaba Cloud Client for PHP
PHP
214
star
35

aliyun-log-c-sdk

Aliyun LOG Producer for C/C++
C
212
star
36

aliyun-log-logback-appender

Java
176
star
37

openapi-core-nodejs-sdk

OpenAPI POP core SDK for Node.js
JavaScript
175
star
38

aliyun-log-android-sdk

Java
174
star
39

alibabacloud-jindodata

alibabacloud-jindodata
170
star
40

aliyun-emapreduce-datasources

Extended datasource support for Spark/Hadoop on Aliyun E-MapReduce.
Scala
168
star
41

aliyun-log-python-sdk

Use python to manage, produce and consume data with Aliyun Log Service.
Python
161
star
42

aliyun-oss-react-native

Objective-C
148
star
43

aliyun-apsaradb-hbase-demo

C++
147
star
44

data-mapping-component

A React Component which focus on Data-Mapping & Table-Field-Mapping.(基于React的数据/表字段映射组件)
JavaScript
146
star
45

aliyun-oss-c-sdk

Aliyun OSS SDK for C
C
144
star
46

django-oss-storage

Django storage backends for AliCloud OSS.
Python
142
star
47

aliyun-oss-ruby-sdk

Aliyun OSS SDK for Ruby
Ruby
138
star
48

ram-policy-editor

AliCloud RAM Policy Editor for OSS
JavaScript
135
star
49

serverless-aliyun-function-compute

Serverless Alibaba Cloud Function Compute Plugin – Add Alibaba Cloud Function Compute support to the Serverless Framework
JavaScript
133
star
50

react-visual-modeling

A DAG React Component for visualization modeling, suitable for UML, database modeling, data warehouse construction.(一个基于React的数据可视化建模的DAG图,适用于UML,数据库建模,数据仓库建设等业务)
JavaScript
132
star
51

alibabacloud-console-components

阿里云企业云管理平台 UI 组件库
TypeScript
131
star
52

fc-nodejs-sdk

The Node.js SDK of FunctionCompute.
JavaScript
130
star
53

aliyun-log-java-sdk

Java
130
star
54

aliyun-cms-grafana

JavaScript
127
star
55

aliyun-log-java-producer

Aliyun LOG Java Producer
Java
124
star
56

alibabacloud-quantization-networks

alibabacloud-quantization-networks
Python
122
star
57

aliyun-emapreduce-demo

Java
121
star
58

aliyun-odps-jdbc

JDBC Driver for ODPS
Java
118
star
59

alicloud-ams-demo

C#
117
star
60

aliyun-maxcompute-data-collectors

Java
113
star
61

alibabacloud-iot-device-sdk

alibaba cloud for iot device javascript SDK , connect with linkplatform , run at node/broswer/winxin min program /ali min program. 阿里云IoT物联网平台javascript版本sdk,可以运行在node/broswer/winxin min program /ali min program. 阿里云IoT物联网平台javascript版本sdk,可以运行在node/broswer/winxin min program /ali min program
JavaScript
110
star
62

api-gateway-nodejs-sdk

The API Gateway SDK for Node.js
JavaScript
104
star
63

MaxCompute-Spark

MaxCompute spark demo for building a runnable application.
Scala
104
star
64

gm-jsse

开源国密通信纯 Java JSSE 实现
Java
95
star
65

cloud-design

阿里云前端组件库,由专有云&公有云前端团队共建
CSS
95
star
66

aliyun-openapi-cpp-sdk

Alibaba Cloud SDK for C++
C++
90
star
67

aliyun-odps-console

ODPS Console Source Code.
Java
90
star
68

aliyun-tablestore-nodejs-sdk

Aliyun TableStore(原OTS) SDK for Node.js
JavaScript
88
star
69

aliyun-odps-java-sdk

ODPS SDK for Java Developers
Java
85
star
70

iotx-api-demo

PHP
83
star
71

aliyun-log-ios-sdk

Aliyun LOG iOS SDK
Swift
82
star
72

algorithm-base

让算法工程化更简单
Python
81
star
73

aliyun-openapi-nodejs-sdk

Alibaba Cloud SDK for Node.js
JavaScript
80
star
74

plugsched

Live upgrade Linux kernel scheduler subsystem
Python
77
star
75

DCT-Mask

Python
76
star
76

alibabacloud-redis-training-demo

Java
76
star
77

aliyun-oss-php-sdk-laravel

A Laravel service provider for the AliCloud OSS SDK for PHP
PHP
75
star
78

aliyun-tablestore-go-sdk

TableStore SDK for Golang
Go
75
star
79

fc-docker

Dockerfiles for local building or running function of FC
Dockerfile
74
star
80

aliyun-specs

Aliyun Mobile Service CocoaPods specs.
Ruby
74
star
81

dro-sfm

Python
74
star
82

packagist-mirror

Alibaba Cloud Packagist Mirror
Go
73
star
83

alibabacloud-console-design

阿里云管平台研发解决方案
TypeScript
73
star
84

elasticsearch-repository-oss

Java
72
star
85

alibabacloud-sdk

Tea
72
star
86

react-monitor-dag

A React-based operation/monitoring DAG diagram.(基于React的运维/监控DAG图)
JavaScript
68
star
87

aliyun-log-php-sdk

PHP
66
star
88

aliyun-tsdb-java-sdk

Aliyun TSDB SDK for Java
Java
64
star
89

aliyun-log-log4j-appender

aliyun-log-log4j-appender
Java
63
star
90

aliyun_assist_client

Aliyun Assist Client 阿里云 云助手
Go
62
star
91

fc-java-sdk

The Java SDK of FunctionCompute.
Java
61
star
92

alibabacloud-hologres-connectors

alibabacloud-hologres-connectors
Java
61
star
93

oss-ftp

The ftp proxy for Aliyun OSS.
Python
61
star
94

aliyun-log-cli

Command Line Interface for Aliyun Log Service
Python
59
star
95

csb-sdk

The CSB-SDK is a client-side invocation SDK for HTTP or Web Service API opened by the CSB (Cloud Service Bus) product. It is responsible for invoking the open API and signing the request information.
Java
58
star
96

aliyun-log-flink-connector

flink log connector
Java
58
star
97

ossimport

Data migration tool
57
star
98

oss-emulator

OSS Emulator
Ruby
57
star
99

fc-python-sdk

The python sdk of Aliyun FunctionCompute
Python
55
star
100

aliyun-log-dotnetcore-sdk

C#
54
star