0

按照给出的步骤 - https://forums.aws.amazon.com/thread.jspa?messageID=475840

wget http://s3fs.googlecode.com/files/s3fs-r177-source.tar.gz
tar zxf s3fs-r177-source.tar.gz
apt-get install build-essential libxml2-dev libfuse-dev libcurl4-openssl-dev

'make install' 这一步发生错误

# cd s3fs; make install
g++ -ggdb -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse  -pthread -lfuse    -lcurl   -I/usr/include/libxml2 -lxml2 -lcrypto s3fs.cpp -o s3fs
s3fs.cpp: In function ‘std::string calc_signature(std::string, std::string, std::string, curl_slist*, std::string)’:
s3fs.cpp:426:18: warning: value computed is not used [-Wunused-value]
    BIO_flush(b64);
                  ^
s3fs.cpp: In function ‘int put_local_fd(const char*, headers_t, int)’:
s3fs.cpp:759:63: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘__off_t {aka long int}’ [-Wformat=]
  syslog(LOG_INFO, "upload path=%s size=%llu", path, st.st_size);
                                                               ^
s3fs.cpp: In function ‘int s3fs_readlink(const char*, char*, size_t)’:
s3fs.cpp:852:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (st.st_size < size)
                      ^
s3fs.cpp: At global scope:
s3fs.cpp:440:1: warning: ‘size_t readCallback(void*, size_t, size_t, void*)’ defined but not used [-Wunused-function]
 readCallback(void *data, size_t blockSize, size_t numBlocks, void *userPtr) {
 ^
/tmp/ccv8Wi6L.o: In function `alloc_curl_handle':
/s3fs/s3fs.cpp:159: undefined reference to `curl_easy_init'
/s3fs/s3fs.cpp:164: undefined reference to `curl_easy_reset'
std::string, curl_slist*, std::string)':
/tmp/ccv8Wi6L.o:/s3fs/s3fs.cpp:660: more undefined references to `curl_easy_setopt' follow
/tmp/ccv8Wi6L.o: In function `s3fs_getattr':
/s3fs/s3fs.cpp:814: undefined reference to `curl_easy_getinfo'
/tmp/ccv8Wi6L.o:/s3fs/s3fs.cpp:919: more undefined references to `curl_easy_setopt' follow
/tmp/ccv8Wi6L.o: In function `s3fs_readdir':
/s3fs/s3fs.cpp:1351: undefined reference to `curl_multi_perform'
/tmp/ccv8Wi6L.o: In function `s3fs_init':
/s3fs/s3fs.cpp:1467: undefined reference to `CRYPTO_num_locks'
/tmp/ccv8Wi6L.o: In function `main':
/s3fs/s3fs.cpp:1588: undefined reference to `fuse_opt_parse'
/tmp/ccv8Wi6L.o: In function `__static_initialization_and_destruction_0':
/s3fs/s3fs.cpp:370: undefined reference to `EVP_sha1'
stuff_t>)':
/s3fs/s3fs.cpp:1209: undefined reference to `curl_slist_free_all'
collect2: error: ld returned 1 exit status
make: *** [all] Error 1

它抛出错误 - 表明 tar 文件已损坏,无法在 EC2 上安装 S3FS。

4

1 回答 1

0

取而代之的是,在同一网址中提到的正确步骤(在评论中)

wget http://s3fs.googlecode.com/files/s3fs-1.71.tar.gz
tar xvzf s3fs-1.71.tar.gz
cd s3fs-1.71/
./configure --prefix=/usr
make
make install (as root)

安装后,创建用于通过 EC2 访问 S3 存储桶的凭据和存储

touch /etc/passwd-s3fs && chmod 640 /etc/passwd-s3fs && echo 'AccessKey:SecretKey' > /etc/passwd-s3fs

注 - AccessKey 和 SecretKey 是与 EC2、S3 关联的 AWS 账户的密钥

/usr/bin/s3fs o-s3 /mnt/

注意-/mnt/-是1要挂载S3桶的目录o-s3是s3桶的名字

检查 ec2 上 S3 是否成功挂载

grep s3fs /etc/mtab

预期输出 - s3fs /mnt fuse.s3fs rw,nosuid,nodev 0 0

cd /mnt/
ls

加载存储在 S3 存储桶中的文件

于 2016-06-30T12:40:51.997 回答