######run with root permissions####### ############################################################# #optional. create a zfs storage pool zpool create \ -o ashift=12 \ -O acltype=posixacl -O canmount=on -O compression=lz4 \ -O xattr=sa -f storage mirror \ /dev/vdb \ /dev/vdc zfs set atime=off storage zfs set recordsize=4k storage zfs set redundant_metadata=most storage zpool set autotrim=on storage ############################################################# #download minio wget -c https://dl.min.io/server/minio/release/linux-amd64/minio -O /usr/local/bin/minio chmod +x /usr/local/bin/minio #create the minio service cat > /etc/systemd/system/minio.service << SERVICE [Unit] Description=MinIO Documentation=https://min.io/docs/minio/linux/index.html Wants=network-online.target After=network-online.target AssertFileIsExecutable=/usr/local/bin/minio [Service] WorkingDirectory=/usr/local User=minio-user Group=minio-user ProtectProc=invisible EnvironmentFile=-/etc/default/minio ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\"; exit 1; fi" ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES # Let systemd restart this service always Restart=always # Specifies the maximum file descriptor number that can be opened by this process LimitNOFILE=65536 # Specifies the maximum number of threads this process can create TasksMax=infinity # Disable timeout logic and wait until process is stopped TimeoutStopSec=infinity SendSIGKILL=no [Install] WantedBy=multi-user.target # Built for ${project.name}-${project.version} (${project.name}) SERVICE #add servers to hosts file cat >> /etc/hosts << HOST 10.0.2.81 minio1 10.0.2.77 minio2 10.0.2.82 minio3 10.0.2.83 minio4 HOST #create minio config #here an example how to build 4 single node multi disk cluster. #"http://minio{1...4}:9000/storage/minio{1...4}" #this is a config for a 4 single node single disk cluster cat > /etc/default/minio << MULTINODE MINIO_VOLUMES="http://minio{1...4}:9000/storage/minio" MINIO_OPTS="--console-address :9001" MINIO_ROOT_USER=serveradmin MINIO_ROOT_PASSWORD=p@ssw0rd #here put your CLUSTERED ip. if dont have... put the node MINIO_SERVER_URL="http://minio1:9000" MULTINODE #starting the cluster #run this commands on every node at the same time systemctl enable minio #if it not run by itself... systemctl start minio #run this for check the service is running systemctl status minio