Skip to content

FakeS3 on a Raspberry Pi 3 with Raspbian (Debian Jessie 8.0)

Christian Baun edited this page Apr 20, 2017 · 4 revisions

Fake S3 on a Raspberry Pi 3 with Raspbian (Debian Jessie 8.0)

The Raspberry Pi 3 single board computer from the Raspberry Pi Foundation has a 1.2 GHz quad-core ARMv8 processor, 1 GByte main memory and a 10/100 Mbps Ethernet interface.

Front of the Raspberry Pi 3 single board computer Back of the Raspberry Pi 3 single board computer

This installation tutorial explains the installation of a Raspberry Pi 3 device from scratch and the configuration of s3cmd on your computer.

This implies that you have already an installation of s3cmd on the system you want to use for the interaction with the Fake S3 storage service.

Fetch and decompress the operating system image

$ wget https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2017-03-03/2017-03-02-raspbian-jessie-lite.zip
$ unzip 2017-03-02-raspbian-jessie-lite.zip 

Write the image on a local micro SD card

Check which one is the correct device! If you use an internal card reader, it is often /dev/mmcblk0.

# dd bs=1M if=2017-03-02-raspbian-jessie-lite.img of=/dev/sdb && sync

Default login of this image is pi/raspberry. To become user root, execute sudo su.

Older Raspian versions started the SSH server by default. Because of security reasons (as explained here), all Raspian versions since version 2016-11-25 (see the release notes) have the SSH server disabled by default. To get the SSH server automativally activated during boot time, create a file ssh with any content (or just an empty file) inside the boot partition (it is the first partition) of the micro SD card.

# mount /dev/sdb1 /media/
# touch /media/ssh
# umount /media/

Start the Raspberry Pi Computer

Insert the micro SD card into the Raspberry Pi computer, connect it with the ethernet cable and the micro USB cable for power suppy and switch on the power supply. The operating system will try to fetch network configuration by using DHCP on the Ethernet interface per default. If you activated the SSH server, you can now log in via SSH.

The system used with this tutorial had these characteristics

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 8.0 (jessie)
Release:	8.0
Codename:	jessie
$ uname -a
Linux raspberrypi 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux

Expand the File System to make use of the entire Capacity of the micro SD Card

$ sudo raspi-config

Expand the file system with raspi-config Expand the file system with raspi-config

Reduce the Amount of Memory for the GPU

This is not required for running the Scality S3 Server, but the Raspberry Pi 3 has just 1 GB of main memory which is not much at all and there is no need to waste 48 MB.

A part of the main memory (just 1 GB) is assigned to the GPU. A pure server does not need a GPU at all. The share can me specified via the raspi-config tool. The minimum value is 16 MB, which is more useful compared with the dafault value (64 MB).

Specify the memory split with raspi-config Specify the memory split with raspi-config

After the new value is specified and after a reboot, the new value should be visible:

# vcgencmd get_mem gpu
gpu=16M

Configure the Time Zone

This is not required for running Fake S3, but it is always useful to configure the operating system properly

$ sudo dpkg-reconfigure tzdata
$ cat /etc/timezone
Europe/Berlin

It is also possible to specify the time zone via the raspi-config tool.

Configure NTP to have the correct Time on the Raspberry Pi Computer

This is not required for running Fake S3, but it is always useful to have the correct time on a computer

$ sudo apt-get update && sudo apt-get install -y ntp ntpdate

Now the time sould be synchronized with several NTP servers.

$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*time3.hs-augsbu 129.69.1.153     2 u    -  128  377   31.891    7.194   1.053
-hotel.zq1.de    235.106.237.243  3 u  113  128  377   38.442    0.272   0.896
+bandersnatch.ro 213.239.154.12   3 u   75  128  377   28.497    6.777   3.761
-ntp.janetzki.eu 46.4.77.168      3 u   90  128  377   35.747   -0.316  27.235
+fritz.box       194.25.134.196   3 u   62  128  377    0.368    4.667   0.674

Check the time and date:

# date -R
Sat, 01 Apr 2017 14:57:33 +0200

Install some packages

Some of them are not required for the installation of Fake S3, but just nice to have.

$ sudo apt-get install -y curl htop joe nmap git

Install the Fake S3

Fake S3 revision v0.2.4 is the last one, which is free software (MIT-LICENSE)

$ cd ~ && wget https://github.com/jubos/fake-s3/archive/v0.2.4.zip
$ unzip v0.2.4.zip

Install Ruby

$ sudo apt-get install ruby rubygems

Intall some gems

$ sudo gem install thor
Fetching: thor-0.19.4.gem (100%)
Successfully installed thor-0.19.4
1 gem installed
Installing ri documentation for thor-0.19.4...
Installing RDoc documentation for thor-0.19.4...

Create a storage path for objects and buckets

$ mkdir ~/s3folder

Start Fake S3 $ cd ~/fake-s3-0.2.4/bin $ ./fakes3 -r ~/s3folder -p 8080

The default access key is 123, with the default secret access key is abc

Some important Stuff

Deploy Storage Services

Performance

Clone this wiki locally