Difference between revisions of "Installing CartoDB for CEDEUS"

From stgo
Jump to: navigation, search
(Resize the CartoDB VM)
m (Resize the CartoDB VM)
Line 46: Line 46:
 
** create a zip-copy of the vdi file,  
 
** create a zip-copy of the vdi file,  
 
** download & start the VM with Ubuntu Desktop(!) 14.04 iso
 
** download & start the VM with Ubuntu Desktop(!) 14.04 iso
** <code>VBoxManage storageattach cartodb --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium ubuntu-14.04.2-desktop-amd64.iso</code>  
+
*: <code>VBoxManage storageattach cartodb --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium ubuntu-14.04.2-desktop-amd64.iso</code>  
 
** choose the "Try Ubuntu" mode  
 
** choose the "Try Ubuntu" mode  
 
** use the program "gparted" to adjust/extend the partition's size
 
** use the program "gparted" to adjust/extend the partition's size
Line 52: Line 52:
 
** on 12.04 when extending GeoNode1204 VM: one may also need to extend /dev/sda2 (cyan color) first before extending /dev/sda5 (brownish color)
 
** on 12.04 when extending GeoNode1204 VM: one may also need to extend /dev/sda2 (cyan color) first before extending /dev/sda5 (brownish color)
 
** remove the "iso" and restart the Vm; check size if the disks is really 200GB now
 
** remove the "iso" and restart the Vm; check size if the disks is really 200GB now
** <code>VBoxManage storageattach cartodb --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium none</code>  
+
*: <code>VBoxManage storageattach cartodb --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium none</code>  
 
** => Well it turned out that I used ''LVM'' (Logical Volume Manager) so the new space is not taken into account. Some more stuff needs to be adjusted!
 
** => Well it turned out that I used ''LVM'' (Logical Volume Manager) so the new space is not taken into account. Some more stuff needs to be adjusted!
 
*** after a bit of reading here: http://www.rootusers.com/how-to-increase-the-size-of-a-linux-lvm-by-expanding-the-virtual-machine-disk/ and here: http://www.thegeekstuff.com/2010/08/how-to-create-lvm/ and checking the status with commands such as ''pvscan'', ''pvdisplay'' and ''lvdisplay''; I figured that I simply need to extend the size of the logical volume (see also http://serverfault.com/questions/501895/used-vgextend-lvextend-to-add-addtional-8gb-space-but-it-is-not-reflected-in-df ) This is done with ''lvextend'' - so I used:
 
*** after a bit of reading here: http://www.rootusers.com/how-to-increase-the-size-of-a-linux-lvm-by-expanding-the-virtual-machine-disk/ and here: http://www.thegeekstuff.com/2010/08/how-to-create-lvm/ and checking the status with commands such as ''pvscan'', ''pvdisplay'' and ''lvdisplay''; I figured that I simply need to extend the size of the logical volume (see also http://serverfault.com/questions/501895/used-vgextend-lvextend-to-add-addtional-8gb-space-but-it-is-not-reflected-in-df ) This is done with ''lvextend'' - so I used:

Revision as of 16:50, 12 August 2015

Setup of CartoDB VM

Setup of VM based on Basic Ubuntu1404 VM

  1. copying basicubunutu1404.vdi file and renaming to cartodb.vdi
  2. creating the cartodb VM on CedeusDB (ip.18):
    • VBoxManage createvm --name cartodb --ostype Ubuntu_64 --register
    • VBoxManage modifyvm cartodb --memory 8096
    • VBoxManage modifyvm cartodb --cpus 6
    • VBoxManage modifyvm cartodb --nic1 nat
    • VBoxManage storagectl cartodb --name "SATA Controller" --add sata --controller IntelAhci
    • assign the (old) disk image a new uuid
      VBoxManage internalcommands sethduuid cartodb.vdi
    • attach the (old) disk image:
      VBoxManage storageattach "cartodb" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium cartodb.vdi
    • VBoxManage storagectl cartodb --name "IDE Controller" --add ide --controller PIIX4
    • set the nat rules (ports):
      VBoxManage modifyvm cartodb --natpf1 "ssh,tcp,,19022,,22"
      VBoxManage modifyvm cartodb --natpf1 "apache,tcp,,19080,,80"
      VBoxManage modifyvm cartodb --natpf1 "pgsql,tcp,,19432,,5432"
  3. optional - set VRDE port:
    • VBoxManage modifyvm cartodb --vrdeport 7763 (Note: 3389 is the default port anyway)
  4. check all settings with VBoxManage showvminfo cartodb
  5. start the VM
    • VBoxHeadless -s cartodb --vrde on &
    the VM will listen on port 7763 - connect with GTKvncViewer to check
    • check if ssh connection works
  6. change the computers name in /etc/hosts and /etc/hostname
  7. restarting Apache gives the error message: "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 ..."
    => solve this by adding ServerName cartodb as the last line in /etc/apache2/apache2.conf file

Resize the CartoDB VM

  • shut the VM down to resize the HDD if necessary
  • check the HDD size: VBoxManage showhdinfo cartodb.vdi returns:
UUID:           e148d758-00ac-4b60-a067-d5c97316069d
Parent UUID:    base</br>
State:          created
Type:           normal (base)
Location:       /home/ssteinig/cartodb.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       100000 MBytes
Size on disk:   6224 MBytes
In use by VMs:  nominatim (UUID: be795392-3786-4f3b-9714-a9445f91855d)
  • so I resized the disk to 200GB as, according to Nominatim infos the disk size for a full planet is 700GB
    VBoxManage modifyhd cartodb.vdi --resize 200000
  • to make this resizing effective I actually have to change the partitions:
    • create a zip-copy of the vdi file,
    • download & start the VM with Ubuntu Desktop(!) 14.04 iso
    VBoxManage storageattach cartodb --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium ubuntu-14.04.2-desktop-amd64.iso
    • choose the "Try Ubuntu" mode
    • use the program "gparted" to adjust/extend the partition's size
    • to be able to enlarge "extended" partition, on needs to click on the key symbol and chose "deactivate", as described for instance here: http://www.howtogeek.com/114503/how-to-resize-your-ubuntu-partitions/
    • on 12.04 when extending GeoNode1204 VM: one may also need to extend /dev/sda2 (cyan color) first before extending /dev/sda5 (brownish color)
    • remove the "iso" and restart the Vm; check size if the disks is really 200GB now
    VBoxManage storageattach cartodb --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium none