Archiv der Kategorie: Uncategorized

How To analyze Performance Issues under Linux

Here I just would like to give an overview over standard Linux Tools, with which you can analyze performance Issues, from memory over IO-Waits and so on …

HowTo_analyze_performance_issues
How to analyze on different levels Performance issues under Linux

I found a similar drawing some weeks ago, a colleague pointet out, that it initialy comes from Brendan Gregg, I extended it a little bit for documentation purposes, so enjoy.

PowerDNS + PowerAdmin with Master/Slave replication

I think it is self explaining, what we want to do, Bind is a little bit monolitic and has no api for flexible and dynamic
creation of machines (okay there are some aproaches, but anyhow), Designate was not working well for me … so I started with PowerDNS.
Here are my install notes:

sudo su

Install Epel repository:

yum install epel-release.noarch

Update the system (if not already done)

yum -y update

PowerDNS + PowerAdmin with Master/Slave replication weiterlesen

Build a multi Node Openstack Environment with Openvswitch

Since I have some time to write again I would like to share a small HowTo, how to Install a multi Node Openstack install with Openvswitch (ovs) and provider Networks as vlans for mixed Environments. At the end I will also add a subsection how to add a second vlan and a script how to add tenants, users and internal Networks for the tenants.

The whole Setup is made with Devstack, some bash-scripts. What you should look at, is for sure multi homing (iproute2) and a general documentation about
openvswitch and HowTo operate Openstack with provider networks. Over all this Documentation should be doable also without this (hopefully) and hopefully I have no typos 😉

Lets assume we have 3 networks / vlans
1. Network is the Management Network (for the communication between the nodes and for the webinterface -> Horizon)
The network is: 192.168.29.0/24 lets say vlan 29 this must be tagged (access port) on the switch / bladecenter –> as vlan 29 HINT: this is the „Segmentation ID“ the gateway is at the end: 192.168.29.254
Build a multi Node Openstack Environment with Openvswitch weiterlesen

Opencontainer runc on Ubuntu 14.04

Prerequesits:

running golang with golang path set and golang-bin path set … okay refresh here, if not yet done

## create a working directory

mkdir -pv ~/gocode/github.com/

vim ~/.profile

## add this two lines

export GOPATH=/home/tbade/gocode

export PATH=$PATH:$GOPATH/bin

## check out also FIX 2 down below (to install latest Golang)

The normal way of using runC …

# create a ‚github.com/opencontainers‘ in your GOPATH
cd github.com/opencontainers
git clone https://github.com/opencontainers/runc
cd runc
make
sudo make install

I had some Issues with Linux Mint17 and Ubuntu 14.04, while building runc … and a small workaround fo fix it:
1. ISSUE

tbade@torbuntu:~/gocode/github.com/opencontainers/runc$ make
go build -o runc .
checkpoint.go:11:2: cannot find package „github.com/opencontainers/runc/libcontainer“ in any of:
/usr/lib/go/src/pkg/github.com/opencontainers/runc/libcontainer (from $GOROOT)
/home/tbade/gocode/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer (from $GOPATH)
/home/tbade/gocode/src/github.com/opencontainers/runc/libcontainer
spec_linux.go:13:2: cannot find package „github.com/opencontainers/runc/libcontainer/cgroups“ in any of:
/usr/lib/go/src/pkg/github.com/opencontainers/runc/libcontainer/cgroups (from $GOROOT)
/home/tbade/gocode/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/cgroups (from $GOPATH)
/home/tbade/gocode/src/github.com/opencontainers/runc/libcontainer/cgroups
restore.go:13:2: cannot find package „github.com/opencontainers/runc/libcontainer/configs“ in any of:
/usr/lib/go/src/pkg/github.com/opencontainers/runc/libcontainer/configs (from $GOROOT)
/home/tbade/gocode/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/configs (from $GOPATH)
/home/tbade/gocode/src/github.com/opencontainers/runc/libcontainer/configs
spec_linux.go:15:2: cannot find package „github.com/opencontainers/runc/libcontainer/devices“ in any of:
/usr/lib/go/src/pkg/github.com/opencontainers/runc/libcontainer/devices (from $GOROOT)
/home/tbade/gocode/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/devices (from $GOPATH)
/home/tbade/gocode/src/github.com/opencontainers/runc/libcontainer/devices
main_unix.go:5:8: cannot find package „github.com/opencontainers/runc/libcontainer/nsenter“ in any of:
/usr/lib/go/src/pkg/github.com/opencontainers/runc/libcontainer/nsenter (from $GOROOT)
/home/tbade/gocode/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/nsenter (from $GOPATH)
/home/tbade/gocode/src/github.com/opencontainers/runc/libcontainer/nsenter
restore.go:14:2: cannot find package „github.com/opencontainers/runc/libcontainer/utils“ in any of:
/usr/lib/go/src/pkg/github.com/opencontainers/runc/libcontainer/utils (from $GOROOT)
/home/tbade/gocode/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/utils (from $GOPATH)
/home/tbade/gocode/src/github.com/opencontainers/runc/libcontainer/utils
make: *** [all] Error 1

FIX Issue 1

tbade@torbuntu:~/gocode/github.com/opencontainers/runc$ cd Godeps/_workspace/src/github.com/
tbade@torbuntu:~/gocode/github.com/opencontainers/runc/Godeps/_workspace/src/github.com$ ls
Sirupsen codegangsta coreos docker godbus golang syndtr
tbade@torbuntu:~/gocode/github.com/opencontainers/runc/Godeps/_workspace/src/github.com$ mkdir opencontainers
tbade@torbuntu:~/gocode/github.com/opencontainers/runc/Godeps/_workspace/src/github.com$ cd opencontainers/
tbade@torbuntu:~/gocode/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers$ git clone https://github.com/opencontainers/runc
Cloning into ‚runc’…
done
cd $GOPATH/github.com/opencontainers/runc/
make

2. ISSUE

tbade@torbuntu:~/gocode/github.com/opencontainers/runc$ make
go build -o runc .
# github.com/opencontainers/runc/libcontainer/seccomp
Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/seccomp/seccomp.go:71: internal compiler error: unknown etype 0/STRUCT
make: *** [all] Error 2

PROBLEM is go version 1.2 / 1.2.1 which is the default in Mint 17/Ubuntu 14.04 (tested on both)
FIX Issue 2

sudo apt-get remove golang golang-tools
sudo su
cd /usr/local/
wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.4.2.linux-amd64.tar.g
rm go1.4.2.linux-amd64.tar.gz
vim /etc/profile
# put inside:
export PATH=$PATH:/usr/local/go/bin

—- Logout / Login … its working afterwards … —-

But now Docker is to old …
Upgrade to latest Docker

sudo apt-get update -y && sudo apt-get upgrade -y

sudo sh -c „echo deb https://get.docker.io/ubuntu docker main >/etc/apt/sources.list.d/docker.list“

sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

sudo apt-get -y update

sudo apt-get install -y lxc-docker

# now you can check the docker version, it should be more actual version than 1.0.2
Start first runC

docker version

docker pull ubuntu:latest

docker export $(docker create ubuntu) > ubuntu_latest.tar

mkdir rootfs

tar -C rootfs -xf ubuntu_latest.tar

vim config.json

{
„version“: „0.1.1“,
„platform“: {
„os“: „linux“,
„arch“: „amd64“
},
„process“: {
„terminal“: true,
„user“: „daemon“,
„args“: [
„sh“
],
„env“: [
„PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin“,
„TERM=xterm“
],
„cwd“: „“
},
„root“: {
„path“: „rootfs“,
„readonly“: true
},
„hostname“: „shell“,
„mounts“: [
{
„type“: „proc“,
„source“: „proc“,
„destination“: „/proc“,
„options“: „“
},
{
„type“: „tmpfs“,
„source“: „tmpfs“,
„destination“: „/dev“,
„options“: „nosuid,strictatime,mode=755,size=65536k“
},
{
„type“: „devpts“,
„source“: „devpts“,
„destination“: „/dev/pts“,
„options“: „nosuid,noexec,newinstance,ptmxmode=0666,mode=0620,gid=5“
},
{
„type“: „tmpfs“,
„source“: „shm“,
„destination“: „/dev/shm“,
„options“: „nosuid,noexec,nodev,mode=1777,size=65536k“
},
{
„type“: „mqueue“,
„source“: „mqueue“,
„destination“: „/dev/mqueue“,
„options“: „nosuid,noexec,nodev“
},
{
„type“: „sysfs“,
„source“: „sysfs“,
„destination“: „/sys“,
„options“: „nosuid,noexec,nodev“
}
],
„linux“: {
„namespaces“: [
{
„type“: „process“
},
{
„type“: „network“
},
{
„type“: „mount“
},
{
„type“: „ipc“
},
{
„type“: „uts“
}
],
„capabilities“: [
„AUDIT_WRITE“,
„KILL“,
„NET_BIND_SERVICE“
],
„devices“: [
„null“,
„random“,
„full“,
„tty“,
„zero“,
„urandom“
]
}
}

sudo runc

# now you can check if you are inside of runc … with ps

Build with packer qcow2 images (e.g. for OpenStack)

First of all, what is Packer?

Packer is an opensource tool for automated creation of identical machine images
for multiple platforms from a single source configuration. That means OpenStack, Vagrant, VirtualBox, Amazon E2 or even docker container.

Packer handles the different virtualization platforms with the integration of plugins, which are then called by the build scripts for the desired virtualization platform .

So here I use the kvm build environment to build a qcow2 image for my OpenStack environment. Think about it, you can easily build up a Jenkins or Go job for automated builds, integrate a checked out source code and deploy a complete … e.g. Test environment for performance Tests … that’s quite cool … or behind LBaaS … start a new instance in OpenStack from latest stable Release … let’s start …
Build with packer qcow2 images (e.g. for OpenStack) weiterlesen

IRCD inside Docker HowTo

This HowTo is to explain how to install an IRC Server inside of a Docker Container,
for testing purposes I also installed vim (just take a look at the Dockerfile …) but it was
for testing only, you can leave it out.

1. Become root
2. Type in:
docker info (just to see if docker is installed)
if „command not found“ shows up, you have to install docker-io
3. create a new folder to store config files (to copy inside the container) and the Dockerfile
(config file for docker to build images)
mkdir -pv ~/Dockerfiles/ircd
cd ~/Dockerfiles/ircd
create an ircd.conf
(a lot of examples can be found on net, this HowTo should not show,
how to configure ircd, it should show, how to create own Docker Container)

IRCD inside Docker HowTo weiterlesen

sms client/server first try

I tried now my first version of server/client system to deliver
sms from one Host to another, I spend now 2 hours, to build a first test Version, and it is
in basic running, will move it to an external git, when I have a first Beta, this is in general running but more or less a case study, have to be finished, then cleaned and secured (auth+crypt):
If you have hints/comments … fell free to post. sms client/server first try weiterlesen

sms python3 script client/server

I’ll try to build a client/server environment using python3.
At the end, this script should do the following, take an incomming email, parse it
so that we just have the Bodytext + Subject, and send it trough python socket server to the
„smsserver“ which sends it to a bunch of different telephone numbers, depending on the
mailsender. sms python3 script client/server weiterlesen