"%VOSWARNING%\n\n---+ Using AWS Elastic Block Storage \n\n%TOC%\n\n---++ What is AWS Elastic Block Storage?\n\nAmazon Elastic Block Storage (Amazon EBS) is a new type of storage designed\nspecifically for Amazon EC2 instances. Amazon EBS allows you to create\nvolumes that can be mounted as devices by EC2 instances; your AMI sees an\nEBS volume as a raw unformatted hard drive device. These can then be\nmanaged through the AWS Management Console, with snapshots taken to\npreserve the state at a given point in time, etc.\n\n---++ Typical Usage Scenarios\n\n---+++ Preconfigured Databases\n\nWith EBS it is possible to ship whole instances (dump/restore images of\nvirtuoso.db database files) of databases. OpenLink currently provide a few\nsuch preconfigured databases. See specific installation instructions for:\n\n * [[VirtEC2AMIDBpediaInstall][DBpedia]]\n * [[VirtEC2AMINeuroCommonsInstall][NeuroCommons]]\n * [[VirtEC2AMIBio2rdfInstall][Bio2RDF]]\n * [[VirtEC2AMIMusicBrainzInstall][MusicBrainz]]\n\n---+++ Managing Virtuoso Storage\n\n---++++ Prerequisites\n\n * Ensure you have downloaded your ssh keypair, with which to access your AMI instance. \n * Some Unix/Linux knowledge is assumed.\n\n---++++ Creating larger databases\n\n 1 Start by logging into your [[https://console.aws.amazon.com/][Amazon AWS Management Console]]. \nFrom here you should see the dashboard overview with an instance running:\n%BR%%BR%%BR%%BR%\n 1 From the left menu, select *Volumes* to view any existing EBS volumes you\nmight have created. In this case, we have no pre-existing volumes:\n%BR%%BR%%BR%%BR%\n 1 Click *create* and fill in a size (here 1Gb) and an availability zone. Note\nthat this must match the availability zone of the instance to which you\nattach it:\n%BR%%BR%%BR%%BR%\n 1 After a short while, the new EBS volume will be created and appear in the\nmanagement console accordingly:\n%BR%%BR%%BR%%BR%\n 1 If you click *attach,* a dialog will pop-up asking to which instance the\nnew volume should be attached. Choose the relevant one and select a\ndevice-name for the volume to use within the AMI. Here we choose /dev/sdf\n(a pseudo-SCSI drive name):\n%BR%%BR%%BR%%BR%\n 1 If not already connected, ssh into the AMI as root using your key identity\nand check for the appearance of the new drive:\n\nzsh% ssh -i MyKeyPair.pem root@ec2-67-202-58-58.compute-1.amazonaws.com\n[root@domU-12-31-39-03-BE-04 ~]# ls -ltr /dev/[hs]d*\nbrw-r----- 1 root disk 8, 3 2009-01-09 07:48 /dev/sda3\nbrw-r----- 1 root disk 8, 1 2009-01-09 07:48 /dev/sda1\nbrw-r----- 1 root disk 8, 2 2009-01-09 07:48 /dev/sda2\nbrw-r----- 1 root disk 8, 80 2009-01-16 11:50 /dev/sdf\n\n 1 Should you wish, you may partition the new block-storage device at this\npoint using fdisk or cfdisk or similar.\nHere we create an ext3 filesystem using the whole device:\n\n[root@domU-12-31-39-03-BE-04 ~]# mkfs.ext3 -F /dev/sdf\nmke2fs 1.40.8 (13-Mar-2008)\nWarning: 256-byte inodes not usable on older systems\nFilesystem label=\nOS type: Linux\nBlock size=4096 (log=2)\nFragment size=4096 (log=2)\n65536 inodes, 262144 blocks\n13107 blocks (5.00%) reserved for the super user\nFirst data block=0\nMaximum filesystem blocks=268435456\n8 block groups\n32768 blocks per group, 32768 fragments per group\n8192 inodes per group\nSuperblock backups stored on blocks:\n 32768, 98304, 163840, 229376\n\nWriting inode tables: done\nCreating journal (8192 blocks): done\nWriting superblocks and filesystem accounting information: done\n\nThis filesystem will be automatically checked every 20 mounts or\n180 days, whichever comes first. Use tune2fs -c or -i to override.\n\n 1 For you to work with the new filesystem, the system has to \"mount\" it.\n * This can be done manually with the mount command, here \nbecoming visible as the directory /opt/virtuoso/data-store/:\n\n[root@domU-12-31-39-03-BE-04 ~]# mount -t ext3 /dev/sdf /opt/virtuoso/data-store\n\n * You can also add a line in /etc/fstab, to make the filesystem \ncome up and be automatically mounted when you reboot or restart the AMI. As above, \nwe are using the directory /opt/virtuoso/data-store/ as the mount point:\n\n[root@domU-12-31-39-03-BE-04 ~]# cat /etc/fstab\n/dev/sda1 / ext3 defaults 1 1\n/dev/sda2 /mnt ext3 defaults 1 1\n/dev/sda3 swap swap defaults 0 0\n/dev/sdf /opt/virtuoso/data-store ext3 defaults,noatime 0 0\n[root@domU-12-31-39-03-BE-04 ~]# mount\n\n 1 To migrate the Virtuoso database directory across to this new EBS volume,\nfirst, stop the running Virtuoso instance:\n\n[root@domU-12-31-39-03-BE-04 ~]# cd /opt/virtuoso/\n[root@domU-12-31-39-03-BE-04 virtuoso]# . ./virtuoso-environment.sh\n[root@domU-12-31-39-03-BE-04 virtuoso]# virtuoso-stop.sh\nShutting down Virtuoso instance in [database]\n\n 1 The Virtuoso installation is based on the Personal Edition layout so the\nvirtuoso-start.sh and virtuoso-stop.sh commands work on all subdirectories\ncontaining an ini-file by default.\n 1 Now that the data-store/ directory is mounted, copy the database files across:\n\n[root@domU-12-31-39-03-BE-04 virtuoso]# cp -v database/* data-store/\n'database/php.ini' -> 'data-store/php.ini'\n'database/virtuoso' -> 'data-store/virtuoso'\n'database/virtuoso.db' -> 'data-store/virtuoso.db'\n'database/virtuoso.ini' -> 'data-store/virtuoso.ini'\n'database/virtuoso.log' -> 'data-store/virtuoso.log'\n'database/virtuoso.pxa' -> 'data-store/virtuoso.pxa'\n'database/virtuoso-temp.db' -> 'data-store/virtuoso-temp.db'\n'database/virtuoso.trx' -> 'data-store/virtuoso.trx'\n[root@domU-12-31-39-03-BE-04 virtuoso]#\n\n 1 Then restart Virtuoso using the data-store directory:\n\n[root@domU-12-31-39-03-BE-04 virtuoso]# virtuoso-start.sh data-store/\nStarting Virtuoso instance in [data-store/]\n\n 1 You can tail the server log file to watch its progress:\n\n[root@domU-12-31-39-03-BE-04 virtuoso]# tail -f data-store/virtuoso.log\n12:00:51 Issued by OpenLink Software\n12:00:51 This license will expire on Fri Jan 1 00:00:00 2010 GMT\n12:00:51 Database version 3016\n12:00:51 SQL Optimizer enabled (max 1000 layouts)\n12:00:53 Compiler unit is timed at 0.001264 msec\n12:00:55 Roll forward started\n12:00:55 Roll forward complete\n12:00:56 Checkpoint made, log reused\n12:00:56 HTTP/WebDAV server online at 80\n12:00:56 Server online at 1111 (pid 14099)\n\n 1 The Virtuoso EC2 AMI instance is now ready for use, and accessible at\nhttp://your-ec2-instance-cname/.\n\n---++++ Striping\n\nIf your database instance is very large and/or you have a large number of\nconcurrent users causing access to random parts of the database\nsimultaneously, it makes sense to distribute the storage across files on\ntwo or more devices using [[http://docs.openlinksw.com/virtuoso/dbadm.html#ini_Striping][striping]].\n\n 1 Follow through the above, to create as many EBS storage volumes as\nyou need, and create a filesystem and mount each of them somewhere\nunder /opt/virtuoso/.\n 1 From your ssh login session, modify the database/virtuoso.ini file. First,\nin the [Database] section, enable Striping overall:\n\n[Database]\n...\nStriping = 1\nMaxCheckpointRemap = 2000000\n\n 1 Then, towards the bottom of the file, enter the files to use on EBS devices\nin the [Striping] section:\n\n[Striping]\n...\nSegment1 = 60000, /opt/virtuoso/data-space1>/virt-seg1.db = q1, /opt/virtuoso/data-space2>/virt-seg1-str2.db = q2, /opt/virtuoso/data-space3>/virt-seg1-str3.db = q3\n\n 1 Each database segment file is assigned a separate background IO thread (the\n=q clause). *Note:* All files on the same physical device\nshould have the same q value; i.e., multiple stripes\non a single EBS volume should have the same q value.\n\nFurther information on\n[[http://docs.openlinksw.com/virtuoso/ptune.html#IOQS][tuning Virtuoso]] is\navailable in our documentation.\n\n---+++ Creating a Database Snapshot\n\nIt is often helpful to be able to preserve the state of a filesystem at a\npoint in time, either in order to restore to it later or to run a backup or\nsimilar.\n\nWith the Amazon AWS Management Console, creating a new snapshot is a matter\nof two clicks.\n\n 1 Start at the console's *Volumes* view:\n%BR%%BR%%BR%%BR%\n 1 Click on *create snapshot* and select the volume of which you wish to make\na copy:\n%BR%%BR%%BR%%BR%\n 1 After a short delay, the Volumes view will show the snapshot completed:\n%BR%%BR%%BR%%BR%\n 1 If required, the snapshot permissions can be changed from the default of *private* to public by right clicking on the snapshot and selecting the *public* radio button option, enabling it to then be accessed by the public.\n 1 You restore a snapshot by using it as a source from which to create a new\nvolume:\n%BR%%BR%%BR%%BR%\n 1 Continue attaching it to an existing AMI instance as previously:\n%BR%%BR%%BR%%BR%\n\n---++ Related\n\n * [[VirtEBSBackedBYOLAMI][EBS-backed BYOL (\"Bring Your Own License\") Virtuoso EC2 AMI]]" . . . . . . . . . . "2017-06-13T05:37:58.730029"^^ . . . "2017-06-13T05:37:58.730029"^^ . . . . . . . . . . . . "VirtEC2AMIElasticBlockStorageConfig" . . . . . . . . . . . . "VirtEC2AMIElasticBlockStorageConfig" . . . . . . . . . . . "2017-06-13T05:37:58Z" . "72be235b16906e1cc696247c2a0674e5" . . . . . "2017-06-13T05:37:58Z" . . . "VirtEC2AMIElasticBlockStorageConfig" .