To build nbsd, blockstore-client, diskagentd, blockstore-nbd and ydbd binaries run the following command from the repository root folder:
./ya make cloud/blockstore/buildall -rFor more info check build instruction
Move to example directory
cd example./0-setup.shRun the following command in a new tab:
./1-start_storage.shOR skip this step if you already have a configured ydbd instance - e.g. after going through the filestore manual.
./2-init_storage.shOR if you already have a configured ydbd instance you should run another command which omits some of the initialization steps:
./2-init_nbs_storage_tenant.shRun the following command in a new tab:
./3-start_nbs.sh./4-start_disk_agent.shRun the following command in a new tab to create new disk:
./5-create_disk.sh -k ssdStorage kind may by overridden by -k option, following values are supported:
- ssd (default) - replicated network disk,
id=vol0 - nonreplicated - nonreplicated disk,
id=nbr0 - mirror2 - x2 mirror (based on nonreplicated disks),
id=mrr0 - mirror3 - x3 mirror (based on nonreplicated disks),
id=mrr1
Run the following command to attach created disk to your machine via nbd:
./6-attach_disk.sh --disk-id vol0 -d /dev/nbd0For example, nonreplicated disk could be created and attached with the following commands:
./5-create_disk.sh -k nonreplicated --disk-id nrd10
./6-attach_disk.sh --disk-id nrd10 -d /dev/nbd1sudo dd oflag=direct if=/dev/urandom of=/dev/nbd0 count=5 bs=4096
sudo dd iflag=direct if=/dev/nbd0 of=./result.bin count=5 bs=4096
Go to http://localhost:8766/blockstore/service and check a particular volume (eg vol0)
If the blockstore server is running on a virtual machine, you must first configure port forwarding:
ssh -L 8766:localhost:8766 <vm_ip>