ceph rgw S3转文件系统

一、 Goofys
1, 安装go
1)tar xf  go1.8.linux-amd64.tar.gz
2)mv go /
3)vim /etc/profile
加入
export GOROOT=/go                              
export PATH=$GOROOT/bin:$PATH  
export GOPATH=~/workspace
source /etc/profile
 2, 安装goofy
1) 下载
go get github.com/kahing/goofys
一般情况下,在执行go get github.com/kahing/goofys的时候会报错,这个是由于网络问题,需要VPN翻墙才能下载github的库,可以采用如下方法解决: 
A, 在GOPATH下面,创建golang.org/x/目录 mkdir -p golang.org/x 
B, 下载如下几份分代码
git clone https://github.com/goland/sys.git
git clone https://github.com/goland/net.git
git clone https://github.com/goland/crypto.git

2)安装
go install github.com/kahing/goofys
 在GOPATH/bin下生成一个goofys可执文件
3, 运行
1) 修改配置文件
[root@host150 home]# cat ~/.aws/credentials
[default]
aws_access_key_id = DJHFOZLACALJDH6DO3AW
aws_secret_access_key = tABvDfsSZqR1MmPB6ou22irkQ9d6IzMn5PFxra7W
 
  2)运行
/root/workspace/bin/goofys --endpoint http://10.192.52.166:7480 -debug_s3 --debug_fuse -f bucket /home/bucket
可以再挂载目录/home/bucket 对桶bucket进行操作

二、 Riofs
1, 安装Riofs
yum install glib2-devel fuse-devel libevent-devel libxml2-devel openssl-devel
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable && ./configure && make && make install
echo "/usr/local/lib/" > /etc/ld.so.conf.d/riofs.conf
ldconfig
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
cd ..
wget https://github.com/skoobe/riofs/archive/master.zip
unzip master.zip
cd riofs-master && ./autogen.sh && ./configure &&make && make install
 2, 运行
1) 修改配置文件
vim /usr/local/etc/riofs/riofs.conf.xml(修改s3部分)
 

创建挂载点
mkdir /s3mnt && chmod 777 /s3mnt
 
2) 运行
riofs -v -o "allow_other" bucket /s3mnt
将桶bucket挂载到/s3mnt上

三、 s3fs
1, s3fs安装
 yum install fuse.x86_64 fuse-devel.x86_64 fuse-libs.x86_64 libconfuse-devel.x86_64 libconfuse.x86_64
yum install gcc-c++.noarch
yum install curl.x86_64 libcurl-devel.x86_64 libcurl.x86_64
yum install libxml2.x86_64 libxml2-devel.x86_64
yum install openssl-devel.x86_64
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs;
./configure --prefix=/usr/local
make && make install
 
 2, 运行
  1)修改配置文件
  echo AWS_ACCESS_KEY_ID:AWS_SECRET_ACCESS_KEY > ~/.passwd-s3fs
chmod 600 ~/.passwd-s3fs

2)运行
s3fs bucket /home/bucket  -o url=http://10.192.40.51:7480  -o use_path_request_style   -f –d
把桶buckt挂载/home/bucket的挂载点上

四、 nfs-ganesha
1, nfs-ganesha安装
yum install -y gcc cmake autoconf gcc-c++ krb5-libs krb5-devel libtool bison flex doxygen gcc-c++ libuuid-devel nfs-utils 
git clone -b V2.5-stable https://github.com/nfs-ganesha/nfs-ganesha.git --recursive
cd nfs-ganesha && mkdir build && cd build
cmake -DUSE_FSAL_RGW=ON -DUSE_FSAL_CEPH=ON ../src/
make && make install

扫描二维码关注公众号,回复: 5576939 查看本文章

2, 运行
1) 修改配置文件
 

2) 运行
ganesha.nfsd -f /etc/ganesha/ganesha.conf -L /var/log/nfs-ganesha.log -N NIV_DEBUG
挂载
mount -t nfs4 10.192.52.166:/  test/
将对象存储的根目录挂载到了test上
 
bucket, bucket1为桶名
另外也可以只挂载一个桶
mount -t nfs4 10.192.52.166:/bucket  test/

猜你喜欢

转载自blog.csdn.net/b779789251/article/details/88311105