-
Notifications
You must be signed in to change notification settings - Fork 66
Jiva CLI
Kiran Mova edited this page Jan 31, 2020
·
1 revision
docker run -d -it --network="host" -P --expose 9502-9504 -v /mnt/stor1:/stor1 <openebs/jiva:ImageTag> launch replica --frontendIP <frontendIP> --listen <ReplicaIp>:9502 --size <size> /stor1
/mnt/stor1 -- Storage for replica
docker run -d --network="host" -P --expose 3260 --expose 9502-9504 --expose 9501 <openebs/jiva:ImageTag> launch controller --frontend gotgt --frontendIP <frontendIP> --replica tcp://<Replica IP>:9502 <vol-name>
docker run -d --network="host" -P --expose 3260 --expose 9502-9504 --expose 9501 <openebs/jiva:ImageTag> launch controller --frontend gotgt --frontendIP <frontendIP> --replica tcp://<Replica1 IP>:9502 --replica tcp://<Replica2 IP>:9502 <vol-name>
Add a replica from the controller (Not needed any more, replicas automatically register themselves at controller)
docker exec -it <Controller's Container ID> longhorn add-replica tcp://<Replica IP>:9502
docker exec -it <Controller's Container ID> longhorn replica ls
docker exec -it <Controller's Container ID> longhorn rm-replica tcp://<Replica IP>:9502
docker exec -it <Controller's Container ID> longhorn snapshot create <snapshot name>
docker exec -it <Controller's Container ID> longhorn snapshot ls
docker exec -it <Controller's Container ID> longhorn snapshot revert <snapshot name>
All the replica containers should be updated with aws credentials for the backup and restore to work.
https://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html
docker exec -it <Controller's Container ID> longhorn backup create <snapshot name> --dest s3://backup-bucket@us-west-2/
Keep a note of the destination URL returned while running the above command.
docker exec -it <Controller's Container ID> longhorn backup restore <S3 URL>
In the above command replace the '&' in S3 URL with its unicode equivalent '\u0026'
For Example, Destination Used
s3://backup-bucket@us-west-2/demonew/
URL Returned
s3://backup-bucket@s-west-2/demonew?backup=backup-32eb9a0de5624d1a&volume=demostore
S3 URL to be used for restore
s3://backup-bucket@s-west-2/demonew?backup=backup-32eb9a0de5624d1a\u0026volume=demostore