-
Notifications
You must be signed in to change notification settings - Fork 2
Google Cloud Storage
Google offers a mostly S3-compatible API to its Cloud Storage offering. However you must explicitly configure interoperable storage access to enable this for a given project. Further you should run s3fs as follows:
s3fs ${YOUR_BUCKET_NAME} ${YOUR_MOUNT_POINT} \
-o nomultipart \
-o passwd_file=${YOUR_PASSWORD_FILE} \
-o sigv2 \
-o url=https://storage.googleapis.com
You have to have fpm (https://github.com/jordansissel/fpm) installed: apt-get install ruby ruby-dev gem install fpm
Install s3fs:
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs-fuse
./autogen.sh
./configure
make
mkdir /tmp/destdir/
make install DESTDIR=/tmp/destdir
fpm -s dir -t deb -n s3fs-fuse -v `date +%Y%m%d`-git -C /tmp/installdir -p s3fs-fuse_VERSION_ARCH.deb
dpkg -i *.deb
rm -fr /tmp/destdir
If you don't want to create the Debian package, just omit the above command from DESTDIR directive until the end (meaning just run make install), and of course do not install ruby + fpm.
To generate a developer key:
- Go to the Google Developers Console.
- Click the name of the project for which you would like to generate a developer key.
- In the left sidebar, go to Storage > Cloud Storage > Storage settings.
- Select Interoperability.
- If you have not set up interoperability before, click Enable interoperability access.
- Click Create a new key.
echo ACCESSKEY:SECRET > /etc/gcs-auth.txt
chmod 600 /etc/gcs-auth.txt
Source: https://cloud.google.com/storage/docs/migrating#migration-simple
s3fs gs-bucket-name /mnt/gs-bucket-name -o passwd_file=/etc/gcs-auth.txt -o url=https://storage.googleapis.com -o sigv2 -o nomultipart
- If you fail mounting the bucket for any reason, you still probably have to do
umount /mnt/gs-bucket-name
before you try again, otherwise you would getls: cannot access /mnt/gs-bucket-name: Transport endpoint is not connected
- If you want to see debug messages use:
s3fs -d -d ...
- If you need even more debug messages, use
s3fs -d -d -f ...
(runs the program in foreground)