Skip to content

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

christianbaun edited this page Oct 5, 2019 · 10 revisions

Minio 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 Minio 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 Raspbian 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 supply 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.

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 Minio, 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 Minio, 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 Minio, 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

They are not required for the installation of Minio, but just nice to have.

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

Install Minio

All required steps are described in the Minio Quickstart Guide here: https://github.com/minio/minio/blob/master/README.md

This tutorial has been tested with Minio revision 2017-03-16T21:50:32Z. Later revisions may or may not work.

$ wget https://dl.minio.io/server/minio/release/linux-arm/minio
$ chmod +x minio 
$ ./minio server --address ":8080"  s3-storage-folder 

Endpoint:  http://10.0.0.250:8080  http://127.0.0.1:8080
AccessKey: J0KSZGB55XZZX3X8NYFY 
SecretKey: fA7IfKLS1nV3Y5vZVP9N5M9BtOZ2ZCJKnHhCSMTb 
Region:    us-east-1
SQS ARNs:  <none>

Browser Access:
   http://10.0.0.250:8080  http://127.0.0.1:8080

Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide
   $ mc config host add myminio http://10.0.0.250:8080 J0KSZGB55XZZX3X8NYFY fA7IfKLS1nV3Y5vZVP9N5M9BtOZ2ZCJKnHhCSMTb

Object API (Amazon S3 compatible):
   Go:         https://docs.minio.io/docs/golang-client-quickstart-guide
   Java:       https://docs.minio.io/docs/java-client-quickstart-guide
   Python:     https://docs.minio.io/docs/python-client-quickstart-guide
   JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide

Drive Capacity: 13 GiB Free, 14 GiB Total

Configure the ~/.s3cfg file to make s3cmd working with Minio

All required steps are described here: https://docs.minio.io/docs/s3cmd-with-minio

Just these lines need to be modified:

access_key = J0KSZGB55XZZX3X8NYFY
host_base = <the_ip_of_your_raspberry>:8080
host_bucket = <the_ip_of_your_raspberry>:8080
secret_key = fA7IfKLS1nV3Y5vZVP9N5M9BtOZ2ZCJKnHhCSMTb
bucket_location = us-east-1
use_https = False
signature_v2 = False

Now s3cmd should work properly with the Minio service.

$ s3cmd mb s3://testbucket
Bucket 's3://testbucket/' created
$ s3cmd ls
2017-04-10 20:31  s3://testbucket

Important !!! When using s3cmd together with Minio, the buckets names must not contain capital letters. Otherwise you will just get this error message:

$ s3cmd mb s3://TESTBUCKET
ERROR: S3 error: 400 (InvalidBucketName): The specified bucket is not valid.

Some important Stuff

The user access key and secret access key can be specified via the environment variables MINIO_ACCESS_KEY and MINIO_SECRET_KEY.

Minio provides internal replication of the object data via multiple local folders.

$ minio server /mnt/folder1 /mnt/folder2/ /mnt/folder3/ /mnt/folder4/ 

The config file of Minio is here:

~/.minio/config.json

Inside this file, it is among others specified...

  • the user access key and secret access key. This is important in order to keep your credentials- after a restart of the Minio service.
  • several further credentials and endpoint information (e.g. to AWS-S3 or Google CS) if desired.
  • if the web user interface shall be used.
  • if the server shall print out messages on command line and the logging level.
  • if the server shall write messages in a logfile and the file name as well as the logging level.

If the port number is not specified with option --address ":<number>", the default port number of Minio (9000) will be used.

Minio provides a handy web user interface.

Minio web user interface

Deploy Storage Services

Performance

Clone this wiki locally