2016-06-30 46 views
0

隨後給出的以下步驟: - https://forums.aws.amazon.com/thread.jspa?messageID=475840摩S3上EC2錯誤 - S3FS錯誤

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 

錯誤發生在的「使安裝」

# 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時被破壞。

回答

0

相反,應遵循正確的步驟爲(在評論)中相同的URL提到

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

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

創建用於訪問S3桶的憑證和存儲注 - AccessKey和SecretKey是與EC2相關的AWS賬戶的關鍵,S3

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

注 - 到/ mnt/- 爲其中1要安裝S3存儲目錄 鄰S3 IS的S3存儲

的名稱要檢查S3的成功安裝在EC2上

grep s3fs /etc/mtab 

預期輸出 - s3fs/MNT fuse.s3fs RW,爲nosuid,nodev 0 0

cd /mnt/ 
ls 

加載存儲在S3存儲桶中的文件