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 -r
For more info check build instruction
Move to example directory
cd example
./0-setup.sh
Run the following command in a new tab:
./1-start_storage.sh
./2-init_storage.sh
Run the following command in a new tab:
./3-start_nbs.sh
./4-start_disk_agent.sh
Run the following command in a new tab to create new disk:
./5-create_disk.sh -k ssd
Storage 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/nbd0
For 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/nbd1
sudo 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
)