Difference between revisions of "CEDEUS Server Setup"

From stgo
Jump to: navigation, search
m (Assigning VM parameters)
(Enabling serial port access from VM (for APC UPS))
Line 88: Line 88:
  
 
=== Assigning VM parameters ===
 
=== Assigning VM parameters ===
* some short official info can be found here, for a different purpose: http://www.virtualbox.org/wiki/Serial_redirect
+
* official info can be found here: https://www.virtualbox.org/manual/ch03.html#serialports , and for a different purpose: http://www.virtualbox.org/wiki/Serial_redirect
 
* Having the VirtualBox GUI setting the serial port routing could be done as describe here: http://askubuntu.com/questions/16586/how-to-access-serial-ubuntu-host-serial-port-on-virtualbox-guest-os and here: http://techtooltip.wordpress.com/2008/09/12/using-host-serial-port-from-guest-in-virtual-box/
 
* Having the VirtualBox GUI setting the serial port routing could be done as describe here: http://askubuntu.com/questions/16586/how-to-access-serial-ubuntu-host-serial-port-on-virtualbox-guest-os and here: http://techtooltip.wordpress.com/2008/09/12/using-host-serial-port-from-guest-in-virtual-box/
 
* however, I am using command line... :(
 
* however, I am using command line... :(

Revision as of 12:59, 15 December 2014

>> return to Cedeus Technical Architecture


general info

  • both machines have 12 cores and 32GB RAM
  • cedeusdb has 4 TB as Raid10 (4 HDs with 2TB)
  • cedeusgeonode has 2 TB as Raid 1 (2 HDs with 2TB)

install log

  1. network installation was done the following way
    • sudo vim /etc/network/interfaces
    • interfaces content:
      auto auth
      iface em1 inet static (used here em1 instead of eth0)
      address 146.155.x.x (replace x by appropriate numbers)
      gateway 146.155.x.1
      netmask 255.255.255.0
      network 146.155.x.0
      broadcast 146.155.x.255
      dns-nameservers 146.155.x.x
      dns-search ing.puc.cl
    • sudo /etc/hosts
    • hosts content:
      127.0.0.1 localhost
      146.155.x.x cedeusdb.ing.puc.cl cedeusddb
    • check (physical) connection using ip a aside from ifconfig -a
  2. installing Ubuntu 14.04 TLS (Trusty Tahr) on cedeusdb (.18) and cedeusgeonode (.19)
  3. installing Postgres 9.3 with PostGIS 2.1
    • adding postgresqls own repo to list of repos
    • sudo apt-get install postgresql-9.3-postgis-2.1 pgadmin3 postgresql-contrib
    • changing pg_hba.conf and postgresql.conf in /etc/postgresql/9.3/main/
    • user: geonode93
    • db: geonodegisdb93
    => psql -U geonode93 -d geonodegisdb93 -h localhost
  4. installation of VirtualBox on both machines as well, according to the description here:
    http://help.ubuntu.com/community/VirtualBox (including the procedure for USB + RDC). That is I simply used
    sudo apt-get install virtualbox
  5. htop and mc are installed as well

Setup of VMs

VMs should primary run on cedeusgeonode server (e.g. GeoNode, OTP, WYP, test stuff), except perhaps for the TileServer VM

  1. creation of VM basicubuntu1404 to be used later for tests
    • 4 CPUs, 8GB Ram, 100GB, nat-ing (behind firewall)
    • Ubuntu 14.04 with openssh, LAMPS, XFCE and XRDP is installed (admin ss...g, pw for mySQL is admin pw)
    • VM creation commands:
      VBoxManage createvm --name basicubuntu1404 --ostype Ubuntu_64 --register
      VBoxManage modifyvm basicubuntu1404 --memory 8192
      VBoxManage modifyvm basicubuntu1404 --cpus 4
      VBoxManage modifyvm basicubuntu1404 --nic1 nat
      VBoxManage createhd --filename basicubuntu1404.vdi --size 100000
      VBoxManage storagectl basicubuntu1404 --name "SATA Controller" --add sata --controller IntelAhci
      VBoxManage storageattach "basicubuntu1404" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium basicubuntu1404.vdi
      VBoxManage storagectl basicubuntu1404 --name "IDE Controller" --add ide --controller PIIX4
      VBoxManage storageattach basicubuntu1404 --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /home/ssteinig/ubuntu-14.04-server-amd64.iso
    • starting the VM with remote desktop connection to install ubuntu:
      VBoxHeadless -s basicubuntu1404 --vrde on &
      => Note: the option --vrdeproperty port=7777 does not seem to have an effect, but the console tells me the connection port for VNC (e.g. 3389). However, VBoxManage modifyvm wikicedeus --vrdeport 7777 can be used to set the VRDE port.
    • starting the VM and wanting to install Ubuntu I actually got the following message
      "This kernel requires an x86-64 CPU, but only detected an i686 CPU. Unable to boot – please use a kernel appropriate for your CPU"
      => Turns out that it should be resolved via enabling the virtualization option the computers boot menu, according to this blog post: http://hereirestinremorse.wordpress.com/virtualbox/this-kernel-requires-an-x86-64-cpu-but-only-detected-an-i686-cpu-unable-to-boot-please-use-a-kernel-appropriate-for-your-cpu/
      However, my virtualization option was switched on, but: I forgot to specify in createvm the ostype as "Ubuntu_64" (not just "Ubuntu"). So then I tried correcting this with modifyvm, but this did not work. Hence, I deleted the VM via "VBoxManage unregistervm basicubuntu1404 --delete" and then created a new one...
  2. after rebooting: modify the repository location for update (don't want to use cl) in /etc/apt/sources.list
  3. shut down the VM
  4. removed the disk image:
    "VBoxManage storageattach basicubuntu1404 --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium none"
  5. enable ssh connection to the VM:
    VBoxManage modifyvm basicubuntu1404 --natpf1 "ssh,tcp,,10022,,22"
    (and perhaps other connections, e.g. apache 80, tomcat 8080)
  6. restart the VM, do a software update and install XFCE. (I think XRDP does not need to be installed because the VirtualBox has is already included: default port as above: 3389)

To change the VMs-Machine name for 14.04 modify "/etc/hostname" and "/etc/hosts".

Enabling serial port access from VM (for APC UPS)

I needed access to the serial port of the server via the VM so I can control the UPS, which is connected via a serial cable.

Testing the serial connection on host computer

  • to check what serial ports are available use: dmesg | grep ttyS
    on CedeusGeoNode I got the following output:
[    0.924355] 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[    0.946110] 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A

  • in earlier test we could also connect (unfortunately only once) to the UPS with minicom -s -c on . and then doing the appropriate settings (9600bps, 8N1, no flow control)
  • in theory (using a modem or so) on can also do echo "id" > /dev/ttyS0

Assigning VM parameters