Category Archives: How-to

Simple GlusterFS log rotation

Category : How-to

Get Social!

gluster-orange-ant

You’ll be glad to know that GlusterFS has built in log rotation! This means that you can use a simple gluster command to rotate the log for a specific volume. This is very helpful when troubleshooting where it can be easiest to truncate logs before regenerating the issue.

For enduring log rotation I recommend using logrotate which I will cover in a future blog post.

Logs are rotated per volume, so you will need to know the volume name before issuing the command to rotate the log. Use the below command to list all the volumes available on your server:

gluster volume info all | grep "Volume Name"

Use the gluster command, replacing [VOL_NAME] with the volume name of the log file you would like to rotate.

gluster volume log rotate [VOL_NAME]

In the below example, the logs for volume datastore will be rotated.

gluster volume log rotate datastore

Below is the result on the file system displayed with the ls command.

ls -l /var/log/glusterfs/bricks/
total 28
-rw------- 1 root root 119 Nov 1 19:06 mnt-gfs_block.log
-rw------- 1 root root 9085 Nov 1 13:46 mnt-gfs_block.log.1383313581
-rw------- 1 root root 236 Nov 1 13:48 mnt-gfs_block.log.1383313684
-rw------- 1 root root 236 Nov 1 13:49 mnt-gfs_block.log.1383313742
-rw------- 1 root root 236 Nov 1 19:06 mnt-gfs_block.log.1383332808

And that’s it! Your log file will be moved and have a time stamp appended, and a new log will be started for the volume.

See my other post on using logrotate for more advanced log rotation.


Update OpenNode OMS to the Latest Version

Tags :

Category : How-to

Get Social!

open-node

OpenNodes web management GUI (OMS) runs in it’s own OpenVZ container. To update the running OMS you must connect to the OMS server via SSH and run the update command.

Log into the OMS Server via SSH using the root account.

OpenNode OMS Login

Change your current directory to the location of the update script using the below commands.

cd /opt/oms

Run the update.sh script with the below command.

./update.sh

You will receive a message similar to the below output confirming that the update has completed.

[root@oms oms]# ./update.sh
which: invalid option -- 'S'
/usr/bin/python2.7
Downloading file:///opt/oms/download-cache/setuptools-0.6c11-py2.7.egg
Updating oms.
Getting distribution for 'opennode.oms.core'.
Got opennode.oms.core 0.0-1585-g0bce.
Getting distribution for 'opennode.wsproxy'.
Got opennode.wsproxy 1.0.
Getting distribution for 'opennode.oms.onc'.
Got opennode.oms.onc 0.0-1063-g2fd9.
Getting distribution for 'opennode.oms.knot'.
Got opennode.oms.knot 0.0-779-g78a8.
Generated script '/opt/oms/bin/omspy'.
Generated script '/opt/oms/bin/omsd'.
Generated script '/opt/oms/bin/obj_graph'.
Generated script '/opt/oms/bin/omspasswd'.
Generated script '/opt/oms/bin/plugin'.
Generated script '/opt/oms/bin/fstail'.
Generated script '/opt/oms/bin/zeopack'.
Generated script '/opt/oms/bin/runzeo'.
Generated script '/opt/oms/bin/zeopasswd'.
Generated script '/opt/oms/bin/zeoctl'.
Generated script '/opt/oms/bin/fsdump'.
Generated script '/opt/oms/bin/fsrefs'.
Generated script '/opt/oms/bin/repozo'.
Generated script '/opt/oms/bin/fsoids'.
Generated script '/opt/oms/bin/wsproxy'.

The final step is to restart the OMS service. Use the below command and reload the service .

systemctl restart oms

Install OpenNode web GUI (OMS)

Tags :

Category : How-to

Get Social!

open-nodeThe OpenNode Management service, or OMS, is used to administer OpenNode via a web based GUI. The OMS is not installed by default and has to be added after installation. The OMS is not installed as a package using yum, but instead is a hosted OpenVZ container. The container is then registered with the OpenNode system and can then be used to administer it.

You must have OpenNode installed Before installing the OMS.

OpenNode also has a TUI, this is a text based management utility which can be used to create and manage new virtual machines and help you install the OMS.

Login to your OpenNode ssh session and run the opennode command to start the TUI.

opennode

Select OMS (beta) on the right to be given a set of options for getting the OMS up and running.OpenNode TUI main screen

Select Download OMS image and press ENTER.OpenNode TUI OMS main screen

Select Yes to start downloading the OMS virtual machine archive.OpenNode TUI OMS download

The download may take a while. If you quit the download and restart it, it will resume where it left off and not download the same part of the file twice.OpenNode TUI OMS downloading

Press OK when the download completes. OpenNode TUI OMS downloading finished

Back in the main menu, select Install OMS image to open the settings for the new virtual machine. You will need to enter the following settings

  •  VSwap size (GB): set to 1GB
  • Number of CPUs: set to two. The OMS can be quite CPU hungry when performing certain tasks.
  • CPU usage limit (%): set to 100% to allow all of the assigned CPU to be used.
  • Disk size (GB): as very little is stored on the OMS root device you will not need to assign it much space. 5GB should be sufficient.
  • IO Priority: although very little IO will occur on the OMS container, it is best to give it the priority over other containers.
  • Hostnameset this to the hostname you would like to use for the OMS container.
  • IP-address: set this to the IP address for the container to use.
  • Nameserver: set this to the IP address of your networks DNS server.
  • Root password: enter a password which the OMS container will use for it’s root account. This is not the password which will be used to access the web GUI.
  • Root password x2: Repeat your password to confirm it.
  • Start VM select this and press SPACE to start the container after it has been created.
  • Start on boot select this and press SPACE to enable the container to start up after your OpenNode server starts up after a reboot.

Click Create VM once you have entered all the required settings.OpenNode TUI OMS create VM

You will be taken back to the OpenNode Management Service (OMS) operations menu when your container has been created and started. The final step is to register the OMS with the OpenNode server. Select Register with OMS and enter the OMS server address – this is the IP you just created in the above step. Make sure the OMS server port remains on the default of 4506.OpenNode TUI OMS register

You can now log into your OMS web administration with the below username and password. The URL to use is the IP address you created when creating the container for the OMS. You must also access the page over HTTPS, for example https://10.10.10.8

  • Username: opennode
  • Password: changeme

opennode-login-screen

See my blog post on changing the password to help secure your OMS install.


Installing OpenNode 6

Category : How-to

Get Social!

open-nodeInstalling OpenNode is much like installing any other modern Linux distribution. You start with a text based installer to configure some of the basic options, such as netwokring, then you are presented with a GUI to complete the install.

Download the ISO from the OpenNode website and burn it to a CD, or mount the ISO on your virtual machine.

ISO: http://opennodecloud.com/downloads/

OpenNode system requirements

Recommended

  • Dual or Quad Socket Server (Quad/Six/Hexa Core CPUs)
  • CPU: 64bit (Intel EMT64 or AMD64)
  • Intel VT/AMD-V capable CPU/Mainboard (for KVM Full Virtualization support)
  • 8 GB RAM is good, more is better (grab as much as possible)
  • Hardware RAID with batteries protected write cache (BBU) or flash protection
  • Fast hard drives, best results with 15k rpm SAS, Raid10
  • Two Gbit NIC (for bonding), additional NIC´s depending on the preferred storage technology and cluster setup

Minimum (for testing)

  • CPU: 64bit (Intel EMT64 or AMD64)
  • Intel VT/AMD-V capable CPU/Mainboard (for KVM Full Virtualization support)
  • Minimum 4 GB RAM
  • Hard drive 25 GB
  • One NIC

The first screen you wil see when you boot the install CD is the boot menu. Press ENTER to start the install with default settings. You can use advanced boot options which are coved on my other blog post.

OpenNode Install Screen 1

You will now need to specify your network settings. Move around this screen using the arrow keys and pressing SPACE on the item to enable. You will notice an asterix (*) next to each item which is enabled. Select Manual Configuration for IPv4 and disable Enable IPv6 supportOpenNode Install Screen 2

Now enter your IPv4 address, submask, Gateway and Name Server (DNS server) for your network and press TAB to select OK.OpenNode Install Screen 3

Press 1 and ENTER to use the default file system layout. OpenNode Install Screen 4

Press ENTER to confirm the changes and commit them to disk. OpenNode Install Screen 5

The GUI will now load and you can use either your mouse or keyboard to navigate the screen. Select your language and press Next.OpenNode Install Screen 6

Type in the Hostname for your machine to use and press Next.OpenNode Install Screen 7

Choose your timezone by clicking areas on the map and press Next.OpenNode Install Screen 8

Enter the Root Password for your installation to use. This is the password you will use later to log into the system.OpenNode Install Screen 9

Press Next and the install will start. OpenNode Install Screen 10

Once the installation completes, click Reboot to reboot your machine and boot from your new installation. OpenNode Install Screen 11

You will be presented with the login screen when your machine restarts. Log in with root as the username and the password you set in the earlier install step. OpenNode Login Screen

Now your install is complete and your OpenNode system is ready to be used. Before creating any VMs, it’s best to update your system using yum to make sure you have the latest bug fixes and security patches installed. Run the yum command to download and install the latest updates of all your installed packages. 

yum update

OpenNode Loged in Screen

The yum application is downloading the latest list of available software and will update them once you have confirmed that you would like to proceed. OpenNode yum update

Press y and ENTER to download and install the latest version and their dependencies of your installed packages. OpenNode yum update2

The first time you run yum update you will get warning about importing the GBG key. Press y and ENTER to accept.OpenNode yum update2 gpg key

Finally, you need to reboot to make sure all the new packages are used. Issue the command reboot at the prompt.

reboot

OpenNode Booting Screen

Wait for the operating system to load and you can start to use your new OpenNode installation. To get started, log back in and issue the command opennode to get started.

OpenNode does does not have a web based GUI installed by default. See my other blog post on setting up the web based GUI.


Mount NFS volume in a Proxmox OpenVZ container

Category : How-to

Get Social!

openvz-logo-150px_new_3There are various options for adding additional storage to an OpenVZ container. You can add additional storage to the containers root volume to simply increase the overall storage available to the container. For external storage, or storage on another disk to the root partition of the container there are bind mounts.

With some light work you can also use NFS mounts inside an OpenVZ container. Before NFS will work in a container a command needs to be ran on the host to enable NFS features in the container.

If you do not enable NFS on the container, you will get the following error:

mount: unknown filesystem type 'nfs'

Open a Terminal on the host machine and run the below command to check that the modules are loaded in the kernel:

modprobe nfs

Then run the below command to enable NFS on the container. Make sure container is turned off or restart the container after issuing the command.

vzctl set 998 --features "nfs:on" --save

This writes a change to the containers config file. To avoid using the command, you could simply edit the config file directly and add the below text to the bottom of the file:

FEATURES="nfs:on"

Start the container and make sure that the required packages are installed.

apt-get install nfs-common

If you do not have the required packages installed you may receive the following error

mount: wrong fs type, bad option, bad superblock on 192.168.50.252:/dspool/compressed,
 missing codepage or helper program, or other error
 (for several filesystems (e.g. nfs, cifs) you might
 need a /sbin/mount.<type> helper program)
 In some cases useful info is found in syslog - try
 dmesg | tail or so

Finally, run the mount command to mount your NFS directory.

mount -t nfs 10.10.10.5:/storage/compressed /mnt/testmount

NFS Mount Error on OEL

Category : How-to

Get Social!

oelI have been using an Oracle Enterprise Linux (OEL) OpenVZ container in Proxmox for installing some Oracle software. The easiest and least interfering way I have found is to mount an NFS share which contains the binaries directly to the container. See my NFS blog post for more information on setting up an OpenVZ container for NFS.

After the service and container was set up for NFS I tried to mount the NFS share. I received the below error after running the mount command.

[root@localhost ~]# mount -a
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

This was because the rpcbind daemon was not running. Run the below command to start the rpcbind daemon.

service rpcbind start

The service will display that the daemon is now running.

Starting rpcbind: [ OK ]

You can set rpcbind to start automatically by adding it to the startup group.

chkconfig rpcbind on

Retry the mount command and your NFS share should be mounted.

mount -a

You may need to check that you have the NFS client packages installed.

yum install nfs-utils

Visit our advertisers

Quick Poll

How many Proxmox servers do you work with?

Visit our advertisers