【问题标题】:How to compile s3fs on EC2?如何在 EC2 上编译 s3fs?
【发布时间】:2016-06-30 12:40:51
【问题描述】:

按照 -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

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

【问题讨论】:

    标签: amazon-web-services amazon-s3 amazon-ec2 s3fs


    【解决方案1】:

    相反,要遵循的正确步骤是在同一个 url(在 cmets 中)中提到的

    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 存储桶中的文件

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-10
      • 2016-11-30
      • 1970-01-01
      • 2021-11-05
      • 2013-08-08
      • 1970-01-01
      • 2013-03-22
      相关资源
      最近更新 更多