HOWTO: Install SAP Sybase ASE 15.x and Linux Containers (LXC) – Ubuntu Server 13.04

Requirements:

Host OS:

  • Ubuntu Server 13.04 x86-64 (64bit)
  • At least 4GB RAM
  • 300GB available disk space

Sybase Patches:

  • If you’re going to run 32bit SQL Anywhere (or an embedded RSSD with Replication Server), you need to apply a SQL Anywhere patch: http://search.sybase.com/kbx/changerequests?bug_id=694479

Install LXC and the bridge-utils to support a network bridge:

aptitude install lxc debootstrap bridge-utils

Create the network bridge br0:

cd /etc/network

Edit interfaces:
replace:

  auto eth0
  iface eth0 inet dhcp

with:

  # LXC bridge
  auto br0
  iface br0 inet dhcp
      bridge_ports eth0
      bridge_stp off
      bridge_fd 0
      bridge_maxwait 0

  auto eth0
  iface eth0 inet manual

Restart networking:

service networking restart

Create lxc-default-sybase Apparmor profile:

cd /etc/apparmor.d/lxc
cp lxc-default lxc-default-sybase

Edit lxc-default-sybase:
replace:

  profile lxc-container-default flags=(attach_disconnected,mediate_deleted) {

with:

  profile lxc-container-default-sybase flags=(attach_disconnected,mediate_deleted) {

replace/add only if using you’re using LXC version LOWER than 0.7.5-3ubuntu60 – see LXC bug 1021411:

   deny @{PROC}/sys/kernel/** wklx,

with:

   deny @{PROC}/sys/kernel/(^shm)** wklx,

Update the kernel with the new lxc-default-sybase profile

apparmor_parser -r /etc/apparmor.d/lxc-containers

Replace /etc/lxc/lxc.conf with:

lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up

# cap the memory available to the container
lxc.cgroup.memory.limit_in_bytes = 2G

Assuming that volume group VG02 exists, let’s create the container with the name of “sybase”, and a logical volume of 100G using the xfs file system:

lxc-create -n sybase -t ubuntu -B lvm --lvname sybase --vgname VG02 --fstype xfs --fssize 100G

Before we start the ‘sybase’ container, we need to update the container configuration to use the lxc-container-default-sybase container:

cd /var/lib/lxc/sybase

Edit config:
replace:

  #lxc.aa_profile = unconfined

with:

  lxc.aa_profile = lxc-container-default-sybase

We’re ready to start the container in console mode (to start it as a daemon add -d):

lxc-start -n sybase

The default login credentials are ubuntu / ubuntu

Let’s switch to root so we can install the packages to support Sybase ASE 15.7:

sudo su - root

Enable up to 512MB of shared memory:

echo "kernel.shmmax = 536870912" >> /etc/sysctl.conf
sysctl -p

Install the packages (nmon is a great os monitoring tool but if you don’t want it, don’t include it):

dpkg --add-architecture i386
apt-get update
apt-get install ia32-libs
apt-get install aptitude libaio1 xauth ia32-libs libstdc++5 nmon ncompress

If you want to install PPA repositories:

apt-get install python-software-properties

We need to set up the locale:

locale-gen en_US.UTF-8
echo 'LANG="en_US.UTF-8"' > /etc/default/locale

Copy the sybase software to your new Linux Container and extract it into a temporary directory.

Because Ubuntu seems to think that gzip can uncompress files compressed with the ‘compress’ command (it really can’t btw), you need to alias the uncompress with /usr/bin/uncompress.real:

alias uncompress='/usr/bin/uncompress.real'

From here, you would install and configure Sybase ASE 15.x as you normally would.

Determine ip address for eth0:

ifconfig|grep "inet addr"

In my case, the eth0 ip address is 192.168.0.115. You will either want to reserve this address with your DHCP server or setup a static ip in /etc/interfaces.

Assuming we want to keep the 192.168.0.115 address for this container, we need to modify the /etc/hosts file:
Replace:

  127.0.0.1 localhost sybase

with:

  127.0.0.1 localhost
  192.168.0.115 sybase
Share Button

KVM: Virtual Bridge (virbr0) is NOT needed! I show you how to remove it :)

for KVM, using an actual network bridge is desired for performance over NAT. There is a virtual bridge used by XEN (virbr0) that you won’t need.
To disable it:

virsh net-destroy default
virsh net-undefine default

If Redhat based distro:

service libvirt-bin stop

If Debian/Ubuntu based distro:

service libvirtd restart
Share Button

OpenVPN really really slow? This performance tip might help

I use the virtual private network software, known as OpenVPN, to connect from my laptops to my home every day.  There are several things I’ve noticed:

  • Most offices and many coffee shops will block the default port 1194 (UDP).  It is also a very popular port for naughty people trying to see what you have on your network.  If you’re not running a web server, set it to port 80 or 443 (TCP) as these ports are normally accessible.  If these don’t work, try other ones like 21 (TCP) which is normally used for a FTP server.  You will likely see better throughput on some ports than on others due to ‘traffic shaping’, aka giving network priority to certain applications.
    • Comcast blocks ports 21,80,443 for UDP and but not for TCP
  • The network packets that are sent through the vpn tunnel can become fragmented, split into two or more packets to make them fit into the vpn network packet.  Let’s increase the size of the vpn network packet to reduce the network packet fragmentation
    • tun-mtu 1500
    • mssfix 1400
  • Compression.  This is a little more subjective than you would think.  If most of your activity is based on data streams (e.g. watching video, listening to music), then the compression may cause delays (think extra buffering / stuttering).   My advice is to try with it on and try with it off..  which seems to be more responsive to you?
Share Button

VMware – copied the Ubuntu vm but now the networking doesn’t work?

You’ve probably seen it, you copied an Ubuntu Linux virtual machine under VMware and tried starting it up with a new VMware UUID and the networking doesn’t work.  When you use a new VMware UUID, it will change the mac address on any virtual network device you have configured in the virtual machine.

A very simple ‘fix’:

In /etc/udev/rules.d/70-persistent-net.rule, delete the entry for your network device(s) so the new mac address is recognized on reboot.  It will look something like so:

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:aa:4c:75", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Your network devices will now be working.  Don’t forget to reboot your virtual machine.

Share Button