物件儲存服務OBS obsfs掛載

kongshuo發表於2024-04-01

一、下載obsfs

下載原始碼

下載地址:https://github.com/huaweicloud/huaweicloud-obs-obsfs

git clone https://github.com/huaweicloud/huaweicloud-obs-obsfs.git
# 下載所需包
yum install -y gcc libstdc++-devel gcc-c++ fuse fuse-devel curl-devel libxml2-devel mailcap git automake make openssl-devel

檢視libfuse版本 find / -name libfuse.so*

obsfs支援使用的libfuse版本為2.9.7,2.9.8或2.9.9。

下載libfuse2.9.7

下載地址:https://github.com/libfuse/libfuse/releases/tag/fuse-2.9.7

wget https://github.com/libfuse/libfuse/releases/tag/fuse-2.9.7
tar -zxvf fuse-2.9.7.tar.gz
cd fuse-2.9.7/ && ./configure && make && make install
echo -e '\n/usr/local/lib' >> /etc/ld.so.conf
ldconfig
find / -name libfuse.so*
cp /usr/local/lib/libfuse.so.2.9.7 /usr/lib64/
rm -f /usr/lib64/libfuse.so
rm -f /usr/lib64/libfuse.so.2
ln -s /usr/lib64/libfuse.so.2.9.7 /usr/lib64/libfuse.so
ln -s /usr/lib64/libfuse.so.2.9.7 /usr/lib64/libfuse.so.2

生成obsfs

cd huaweicloud-obs-obsfs-master/
sh build.sh

安裝obsfs

cd huaweicloud-obs-obsfs-master/
sh install_obsfs.sh

檢視版本

obsfs --version
Huawei Simple Storage Service File System V1.83(commit:unknown) with OpenSSL

檢視openssl版本 openssl version

obsfs軟體包僅支援openssl1.0.0及以下版本。

下載地址:https://www.openssl.org/source/old/1.0.0/openssl-1.0.0s.tar.gz

wget https://www.openssl.org/source/old/1.0.0/openssl-1.0.0s.tar.gz
tar -zxvf openssl-1.0.0s.tar.gz
cd openssl-1.0.0s
./config shared --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
make
sudo make install
sudo mv /usr/bin/openssl /usr/bin/openssl.backup
sudo ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
openssl version

二、初始化obsfs

echo AK:SK > /etc/passwd-obsfs
cat /etc/passwd-obsfs
chmod 600 /etc/passwd-obsfs

三、掛載obsfs

obsfs 並行檔案系統名 本地掛載目錄 -o url=區域終端節點地址 -o passwd_file=/etc/passwd-obsfs -o big_writes -o max_write=131072 -o use_ino
df -hT

區域終端節點地址:https://developer.huaweicloud.com/endpoint?OBS

相關文章