HomeCoinsSiacoin (SC)Sia as datastore for vSphere HA clusters via Arzen

Sia as datastore for vSphere HA clusters via Arzen

- Advertisement -

The following technical guide assumes that you already have a technical infrastructure including:
– 2x VMware ESXi servers (IP: 10.0.0.70/24 and 10.0.0.71/24)
– 1x vCenter server (IP: 10.0.0.72/24)
– 1x Debian 10 VM (IP: 10.0.0.73/24)
– 1x Arzen account and an active subscription (Any plan will do. In the guide, we used the ROC for IT experts plan)

vCenter « Hosts and Clusters » view with required servers

To make the configuration as simple as possible, all the servers have been integrated into the same subnet (10.0.0.0/24). Note: The Debian 10 VM must have a 50 GB virtual disk in addition to the system disk. In our example, this 50 GB disk is mounted on the /cache directory.

The first step is to create a bucket hosted on Sia decentralized storage. To do this, log into your Arzen account here. In the « buckets » menu, click on « New bucket », choose a name for your bucket and select the location « Filebase, World — Sia » and validate with « Create ».

Creation of the bucket on the Sia network

Then retrieve the API keys from the bucket by clicking on the « API keys » button. Keep them aside, we’ll need them a bit later.

Bucket API keys

Now that our bucket hosted on the Sia network is created, let’s mount it on our Debian VM using the s3backer tool. Here is a brief presentation of s3backer available in the s3backer manual (here):

« s3backer is a filesystem that contains a single file backed by the Amazon Simple Storage Service Amazon S3). As a filesystem, it is very simple: it provides a single normal file having a fixed size. Underneath, the file is divided up into blocks, and the content of each block is stored in a unique Amazon S3 object. In other words, what s3backer provides is really more like an S3-backed virtual hard disk device, rather than a filesystem. » — from github.com, archiecobbs/s3backer project

To install s3backer, use the following commands:

apt install s3backer
s3backer –version

Make sure the installed version is 1.5.0, during our testing we had errors with more recent versions. Then create a .s3b-creds file in the /etc directory:

nano /etc/s3b-creds

In this file, type the API keys of the bucket separated by « : ». Save the file with Ctrl + O and exit nano with Ctrl + X.

API keys for s3backer

Create a s3b-passwd in /etc directory and write your encryption key inside (It can be any password. Your data will be encrypted before being stored on Arzen, you remain in control of your data). Note: the actual key used is derived by hashing the password, the bucket name, the prefix name (if any), and the block number. Therefore, encrypted data cannot be ported to different buckets or prefixes.

nano /etc/s3b-passwd

Then create two folders that will be used to mount the bucket locally on the VM:

mkdir -p /mnt/s3b/mnt1
mkdir -p /mnt/s3b/mnt2

Create a new UNIX user that will be the owner of the mount and set a password. In our example, the user is « arzen ». Then add the user « arzen » to the group of the same name:

useradd arzen
passwd arzen
adduser arzen arzen

Then edit the /etc/fstab file to define the mounting options for the bucket on the Debian VM (Make sure to change « sia-datastore » by the name of your bucket) :

s3backer#sia-datastore /mnt/s3b/mnt1 fuse size=1t,blockSize=1m,accessFile=/etc/s3b-creds,baseURL=https://s3.arzen.tech/,listBlocks,blockCacheFile=/cache/s3b-cache,blockCacheSize=45000,blockCacheWriteDelay=60000,md5CacheSize=900000,md5CacheTime=60000,encrypt=aes-256-cbc,passwordFile=/etc/s3b-passwd,_netdev 0 0

/mnt/s3b/mnt1/file /mnt/s3b/mnt2 ext4 netdev,loop,discard,x-systemd.requires=mnt-s3b-mnt1.mount 0 0

Save the file with Ctrl + O and exit nano with Ctrl + X. For further information about the settings, you can read the s3backer manual here.

We can now proceed to mount the bucket on the VM with the command:

mount /mnt/s3b/mnt1

You should get an output that looks like this:

Output when mouting the bucket with s3backer

Format the filesystem to ext4 with the following command. Please be patient, this may take several minutes to several hours depending on the size of the configured volume:

mkfs.ext4 -b 4096 -F /mnt/s3b/mnt1/file

Output when formatting the volume

Mount the ext4 filesystem:

mount /mnt/s3b/mnt2

Assign the user and group « arzen » as owners on the mount point:

chown -R arzen:arzen /mnt/s3b/mnt2
chmod -R 755 /mnt/s3b/mnt2

Install the nfs-kernel-server package:

apt install nfs-kernel-server

Retrieve the IDs of the arzen user and group:

cat /etc/passwd | grep arzen | awk -F ‘:’ ‘{print $3}’
cat /etc/group | grep arzen | awk -F ‘:’ ‘{print $3}’

Modify the /etc/exports file to indicate the mount point to use for the NFS service by adding the following line at the end (Be sure to modify the subnet address (10.0.0.0/24) and the anonuid / anongid parameters according to the values retrieved during the previous step):

/mnt/s3b/mnt2 10.0.0.0/24(rw,fsid=1,no_subtree_check,all_squash,anonuid=1001,anongid=1001)

Apply the new export:

exportfs -a
showmounts -e

You should see the export appear in the output:

Check that the NFS export exists

Connect to vCenter, go to the « Host and Clusters » view, right-click on your cluster, « Storage », « New datastore »:

Add a new datastore

Select « NFS », then « Next »:

Select NFS datastore

Select « NFS 3 », we had some issues using NFS 4.1:

Select NFS v3

Enter the datastore name of your choice then the path specified in the NFS export on the Debian VM and the IP of the Debian VM:

Enter information about the NFS server

Select all hosts on which you want to add the NFS datastore, then click on « Finish »

Select hosts

Finally, check that the datastore is succesfully connected to all hosts in the « Storage » view of the vCenter:

Check datastore status

And voilà. We just created a distributed datastore between your ESXi servers. The VMs that you deploy on this datastore will benefit from HA and DRS functionalities as if you had a physical NAS or a storage bay. Be careful though, this NFS datastore will not be as fast as SAN or local disks. We recommend that you use it for applications that don’t have an intensive disk usage (web servers, mail, DNS, printing, file servers, proxy, supervision, etc.) and to use faster storage for applications that require a lot of disk IO like databases.

Source link

- Advertisement -
Mr Bitcointehttps://www.bitcointe.com/
“Fact You Need To Know About Cryptocurrency - The first Bitcoin purchase was for pizza.” ― Mohsin Jameel
462FansLike
76FollowersFollow
4,567FollowersFollow
5,261FollowersFollow
1,546FollowersFollow
2,230SubscribersSubscribe

Most Popular

bitcoin
Bitcoin (BTC) $ 55,495.00
ethereum
Ethereum (ETH) $ 4,397.22
tether
Tether (USDT) $ 0.994208
bitcoin-cash
Bitcoin Cash (BCH) $ 552.92
litecoin
Litecoin (LTC) $ 195.48
eos
EOS (EOS) $ 3.94
okb
OKB (OKB) $ 26.68
tezos
Tezos (XTZ) $ 5.10
leo-token
LEO Token (LEO) $ 3.57
cardano
Cardano (ADA) $ 1.59
monero
Monero (XMR) $ 231.36
stellar
Stellar (XLM) $ 0.343082
chainlink
Chainlink (LINK) $ 24.50
huobi-token
Huobi Token (HT) $ 9.57
tron
TRON (TRX) $ 0.097971
usd-coin
USD Coin (USDC) $ 0.995514
dash
Dash (DASH) $ 174.56
neo
NEO (NEO) $ 36.36
iota
IOTA (MIOTA) $ 1.43
nem
NEM (XEM) $ 0.166509
zcash
Zcash (ZEC) $ 222.90
maker
Maker (MKR) $ 2,831.51
paxos-standard
Pax Dollar (USDP) $ 0.993183
ethereum-classic
Ethereum Classic (ETC) $ 45.50
vechain
VeChain (VET) $ 0.113087
true-usd
TrueUSD (TUSD) $ 0.994166
ftx-token
FTX Token (FTT) $ 47.88
kucoin-shares
KuCoin Token (KCS) $ 24.66
waves
Waves (WAVES) $ 20.69