yum remove fuse fuse-s3fs
yum install automake fuse-devel gcc-c++ git libcurl-devel libxml2-devel make openssl-devel
cd s3fs-fuse
cd /opt/
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs-fuse
./autogen.sh
./configure
make
make install
echo MYIDENTITY:MYCREDENTIAL > ~/.passwd-s3fs
chmod 600 ~/.passwd-s3fs
mkdir /tmp/cache
mkdir -p /s3localfolder
chmod 777 /tmp/cache /s3localfolder
s3fs -o use_cache=/tmp/cache s3bucket /s3localfolder
create script:
vi /usr/bin/mounts3.sh
#!/bin/bash
sleep 60
s3fs -o use_cache=/tmp/cache s3bucket /s3localfolder
echo "Amazon S3 bucket connected!"
save and exit
Create systemd service for S3FS
create new file:
/etc/systemd/system/mounts3.service
and put below data :
[Unit]
Description=Mounts Amazon S3 bucket
After=syslog.target
After=network.target
[Service]
User=root
WorkingDirectory=/usr/bin
ExecStart=/bin/bash mounts3.sh start
Type=forking
KillMode=process
# Time for the shell script to start up
TimeoutSec=120
[Install]
WantedBy=multi-user.target
save and exit
Check service :
systemctl start/stop mounts3
Enable service on system boot:
systemctl enable mounts3
Thats it.....
yum install automake fuse-devel gcc-c++ git libcurl-devel libxml2-devel make openssl-devel
cd s3fs-fuse
cd /opt/
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs-fuse
./autogen.sh
./configure
make
make install
echo MYIDENTITY:MYCREDENTIAL > ~/.passwd-s3fs
chmod 600 ~/.passwd-s3fs
mkdir /tmp/cache
mkdir -p /s3localfolder
chmod 777 /tmp/cache /s3localfolder
s3fs -o use_cache=/tmp/cache s3bucket /s3localfolder
create script:
vi /usr/bin/mounts3.sh
#!/bin/bash
sleep 60
s3fs -o use_cache=/tmp/cache s3bucket /s3localfolder
echo "Amazon S3 bucket connected!"
save and exit
Create systemd service for S3FS
create new file:
/etc/systemd/system/mounts3.service
and put below data :
[Unit]
Description=Mounts Amazon S3 bucket
After=syslog.target
After=network.target
[Service]
User=root
WorkingDirectory=/usr/bin
ExecStart=/bin/bash mounts3.sh start
Type=forking
KillMode=process
# Time for the shell script to start up
TimeoutSec=120
[Install]
WantedBy=multi-user.target
save and exit
Check service :
systemctl start/stop mounts3
Enable service on system boot:
systemctl enable mounts3
Thats it.....
No comments:
Post a Comment