2014년 10월 21일 화요일

Thoughts on working in an Enterprise Linux environment coming from a Desktop Linux background

Linux for me started out as a hobby and only recently has it become my vocation. This means that I am naturally more familiar with desktop Linux environments and this is the background which I carry with me while learning the ropes of the Enterprise Linux (EL) world. I will discuss several of the biggest differences I have encountered between the Desktop and Enterprise domains.

I. Kernels

So far all of the production servers I have worked with are running kernels < linux 3.0
In fact, the most up-to-date kernel I have seen in a production environment is 2.6.32... which is the same version used in Debian Squeeze 6.0 (which I used as my desktop distro in 2010). Kernel 2.6.32... is used in the RHEL/CentOS 6.X series. I also regularly encounter kernel 2.6.18... used in the RHEL/CentOS 5.X series.

II. Packages

Since our customers' production servers use relatively old kernels (compared to the most recent kernel 3.17 which is currently in testing), many of the packages I am used to using in the desktop world are unavailable when I access servers over SSH or the built-in server console.

For example, Python3 is not available from the stock repos for RHEL 5.X/6.X
Also the handy tool lsblk (which lists block devices as well as filesystem info) is only available for kernels 2.6.27 and above, which means this package is not available in RHEL/CentOS 5, which uses kernel 2.6.18... There are countless of other examples.

III. net-tools vs. iproute2

In the EL world, almost all networking tasks are accomplished with utilities from the net-tools package which is becoming deprecated in the desktop Linux world. For example, bleeding-edge distros like Archlinux stopped using net-tools in 2011 in favor of the iproute2 package. Some common syntax differences between similar tasks using utils from net-tools vs. iproute2:

Put up a network interface:

ifup eth0

ip link set eth0 up

Specify an IP for a network interface:

ifconfig eth0 192.168.10.100/24 up

ip addr add 192.168.10.100/24 dev eth0

Note that the ifconfig command above will replace any existing IP addresses assigned to eth0. However the iproute2 command above will add the specified IP address to eth0 in addition to any other IP addresses already assigned to the interface. If you wish to remove any existing addresses before adding a new address using iproute2, you must do the following:

ip addr flush dev eth0

ip addr add 192.168.10.100/24 dev eth0

Of course there are many more examples like netstat being replaced by ss and other utils, etc.

IV. Systemd

In the desktop world, most distros have moved to systemd from init scripts (SysVinit) and upstart. I am now more comfortable with the systemctl action serviceName (i.e. systemctl restart dnsmasq) syntax than with the old service daemonName action (i.e. service dhcpd stop) syntax. In the Enterprise world, servers on kernels < 3.0 do not use systemd.

Many common tasks such as querying the system log are totally different in servers which do not use systemd. The first example shows the non-systemd way of checking the system log, while the second example shows how it's done in systemd:

tail -f /var/log/messages

journalctl -f


I personally think that being exposed to both the Desktop and Enterprise worlds is good for me as a Linux engineer, because I am forced to learn multiple ways of accomplishing the same tasks. When I was just administering a few machines at home, I never used tools like scp, sftp, and other networking-related utils. As a matter of necessity I have also started to write Bash scripts to automate the repetitive and mundane aspects of my job, particularly generating system reports after new Linux installations. Now is an exciting time to be a Linux system engineer!