GlusterFS distributed storage configuration

Configuration of High-Availability Storage Server Using GlusterFS

March 12, 2013
by Lubos Rendek

Introduction

Whether you are administrating a small home network or an enterprise network for a large company the data storage is always a concern. It can be in terms of lack of disk space or inefficient backup solution. In both cases GlusterFS can be the right tool to fix your problem as it allows you to scale your resources horizontally as well as vertically. In this guide we will configure the distributed and replicated/mirror data storage. As the name suggests a GlusterFS’s distributed storage mode will allow you to evenly redistribute your data across multiple network nodes, while a replicated mode will make sure that all your data are mirrored across all network nodes.

What is GlusterFS

After reading the introduction you should have already a fair idea what GlusterFS is. You can think of it as an aggregation service for all your empty disk space across your whole network. It connects all nodes with GlusterFS installation over TCP or RDMA creating a single storage resource combining all available disk space into a single storage volume ( distributed mode ) or uses the maximum of available disk space on all notes to mirror your data ( replicated mode ). Therefore, each volume consist of multiple nodes, which in GlusterFS terminology are called bricks.

Preliminary Assumptions

Although GlusterFS can by installed and used on any Linux distribution, this article will primarily use Ubuntu Linux. However, you should be able to use this guide on any Linux Distribution like RedHat, Fedora, SuSe, etc. The only part which will be different will be the GlusterFS installation process.

Furthermore, this guide will use 3 example hostnames:

  • storage.server1 – GlusterFS storage server
  • storage.server2 – GlusterFS storage server
  • storage.client – GlusterFS storage client

Use DNS server or /etc/hosts file to define your hostnames and adjust your scenario to this guide.

Read more

I2P – Anonymity for the Masses

Introduction

For many years people have wanted to protect their right to privacy. As technology changes, it seems that privacy evolves away more and more. I2P is a protocol used for an encrypted multi-proxy on the Internet. While, this sounds simple, there is actually a lot of work going on with I2P to achieve this. Unlike some multi-proxies, I2P will allow you to tunnel many more applications through it than just web browsing, making it a very robust protocol.

I2P is available for all platforms, not just Linux. For this example I have used Debian Sid to perform the installation. With the exception of ‘apt-get’, these instructions should work fine with any Linux distribution. But if you experience problems, please seek documentation for your distro.

Legal Disclaimer

As I explain this to help you maintain priviacy, there will always be a few bad apples in the crowd. I do not condone this use of this article for anything illegal. Even if you are not passing illegal information on I2P, please check your country’s laws on encryption and it’s exportation before you begin.

The Problem with Tor

One would probably see I2P as an overkill without knowing the downfalls of its predecessor. Tor was once a wonderful multi-proxy used for hiding ip addresses and bouncing off servers all over the world. At one time, it was even trusted by most governments for strong anonymity. All of that seemed to change after an article was posted in 2600 Hacker Quartley. One author exposed how becoming an exit node for Tor allowed all the traffic on the Tor network to pass right through your machine. Becoming an exit node was the same as performing a Man-In-The-Middle attack. All one had to do was open up a packet sniffer and see all the traffic going through encrypted. Tor is still used by people trying to protect their privacy. But at the same time it has become a playground for hackers and governments monitoring what they consider suspicious. I2P has secured this problem while adding more functionality.

Read more

introduction to wine on linux

Introduction to WINE

Introduction

One of the main concerns for people making the switch to Linux is how to run the programs that they’ve become accustomed to on other operating systems, mainly Windows. For most, there are one or two programs of games that aren’t available on Linux, and that puts a major hold on adopting Linux full time. Thankfully, WINE can help to solve this problem. introduction to wine on linux

WINE is a piece of software for Unix-like systems, including Linux, OSX, and the BSDs, that allows you to run native Windows applications. WINE stands for, WINE Is Not an Emulator. That’s because it isn’t. WINE isn’t a full Windows install or some kind of VM. It is a compatibility layer that essentially translates Windows binaries. This extends to graphics libraries like DirectX 9, which is converted to OpenGL. WINE allows Linux users to run many popular Windows applications and games at similar performance to if they were running on Windows itself.

Read more

How to rename VDI/Virtual disk on XenServer Linux

Objective

The Virtual Machine creation using template provisioner may spawn unnamed VDI disks. Usually, the VID description states Created by template provisioner at most.
Example:

uuid ( RO)                : 093e128a-2632-43bd-bb45-8f864bc69d6f
          name-label ( RW): 0
    name-description ( RW): Created by template provisioner
             sr-uuid ( RO): 3ef7b35b-5d39-7414-0c91-bbb281b9a521
        virtual-size ( RO): 21474836480
            sharable ( RO): false
           read-only ( RO): false

The objective is to set a proper name and description to VDI disk.

Read more

How to rename VM ( virtual machine ) name label on XenServer

Objective

The objective is to set a new name label on a existing XenServer’s VM ( virtual machine ).

Requirements

Privileged access to XenServer’s command line as well as configured ISO image storage containing an ISO image of the Linux distribution you wish to install.

Difficulty

EASY

Instructions

Identify VM’s UUID

In order to set/rename VM’s name label we fisrt need to identify its UUID. List all VM’s and take a note of a relevant UUID. Example:

# xe vm-list
uuid ( RO)           : bad8e456-df88-435d-ba12-3f0f6e54b2c6
     name-label ( RW): Control domain on host: xenserver
    power-state ( RO): running


uuid ( RO)           : 699dcb0c-e897-5bd4-30c1-ab1dd9a3ca4e
     name-label ( RW): Debian Jessie 8.0
    power-state ( RO): halted

Read more

WINE Installation and Configuration Tutorial on Linux

WINE Installation and Configuration Tutorial on Linux

About

There is a gap between Windows and Linux. That’s obviously an unpopular thing to say, but it’s undeniable, especially when concerning third party support. Games and professional applications like Photoshop and 3D modeling tools are either woefully under-supported or unsupported altogether. Things have improved over time, but there is still need for a bridge. That bridge comes in the form of WINE.

WINE Installation and Configuration Tutorial on LinuxWINE is not an emulator or a virtual machine. Rather, it is a lightweight compatibility layer that “translates” Windows applications into a language that Linux can work with. For years, WINE has been an invaluable tool for Linux users who just needed that one unsupported application to work. It has also been the answer for gamers looking for their favorite games on Linux, long before Steam was an option.

WINE isn’t perfect. It’s actually far from it. DirectX 10 support is spotty at best and DirectX 11 support is nearly non-existent. It is, however, in constant development, and the developers are always working to improve it. The WINE of today is miles beyond what it was just a few short years ago.

This series of guides will walk you through the tools that WINE provides for getting your Windows programs working on Linux. It does no rely on wrappers and scripts like PlayOnLinux because they aren’t all that reliable. Learning the way WINE actually works may be more difficult and time consuming in the short term, but in the long term, you will not be reliant on external sources to get your applications running. These guides start off with the basics and installation of WINE and progress through configuration tools like winecfg and winetricks. You will be able to create application specific configurations and use different WINE prefixes as well as being able to install Windows dlls and components to add functionality to your applications.

Read more

Installation of latest Go language binaries on Ubuntu 16.04 Xenial Xerus Linux

Objective

Go is an open source programming language developed by Google. The objective is to install latest Go language pre-compiled binaries on Ubuntu 16.04 Linux.

Requirements

Privileged access to your Ubuntu System as root or via sudo command is required.

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Instructions

Download Go language binaries

First, we need to download Go language binaries. Visit https://golang.org/dl/ page and either download your relevant Golang Linux libraries directly using your browser or simply use wget command as shown below:

$ wget -q https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz

Once downloaded, you should be able to see the Go tarball with ls command:

$ ls go*
go1.7.4.linux-amd64.tar.gz

Read more

How to store all shell commands immediately after execution into .bash_history file

When using a bash shell all your entered commands are remembered by history library. The history library will keep track of every command you have entered. This is a default for most if not all Linux systems. However, the commands you enter are first temporarily stored into an internal memory and are written to your ~/.bash_history  only after you properly exit your shell session.

Depending on your shell usage this may cause some undesired results. For example, if your connection to a remote host gets disconnected, your history file will not get updated and thus you will lose all you previously entered commands. Furthermore, while your commands for one session are temporarily stored within system’s internal memory you would not be able to access it from another shell session.

Use the following linux command to force your shell to append every command entered during a current shell session into ~/.bash_history file:

shell 1: $ history -a

Read more

How to count occurrence of a specific character in a string or file using bash

Below you can find some hints on how to count an occurrence of specific character in a file or in a string. Le’s say we have a string “Hello Bash”:

$ STRING="Hello Bash"
$ echo $STRING
Hello Bash

Using bash shell we can now count an occurrence of any given character. For example let’s count number of occurrences of a character l:

$ echo $STRING | sed -e 's/\(.\)/\1\n/g' | grep l | wc -l
2

Read more