Resources, Articles, Tricks, and Solutions in connection to Server Management Service

Configure software RAID on Linux using MDADM - Do it now

This article covers how to Configure software RAID on Linux using MDADM.


To Install a Software Raid Management Tool:

To install mdadm, run the installation command:

1. For CentOS/Red Hat (yum/dnf is used): $ yum install mdadm

2. For Ubuntu/Debian: $ apt-get install mdadm

3. SUSE: $ sudo zypper install mdadm

4. Arch Linux: $ sudo pacman -S mdadm


Terms related to Integrity of a RAID Array:

1. Version – the metadata version

2. Creation Time – the date and time of RAID creation

3. Raid Level – the level of a RAID array

4. Array Size – the size of the RAID disk space

5. Used Dev Size – the space size used by devices

6. Raid Device – the number of disks in the RAID

7. Total Devices – is the number of disks added to the RAID

8. State – is the current state (clean — it is OK)

9. Active Devices – number of active disks in the RAID

10. Working Devises – number of working disks in the RAID

11. Failed Devices – number of failed devices in the RAID

12. Spare Devices – number of spare disks in the RAID

13. Consistency Policy – is the parameter that sets the synchronization type after a failure, rsync is a full synchronization after RAID array recovery (bitmap, journal, ppl modes are available)

14. UUID – raid array identifier


To Recovering from a Disk Failure in RAID, Disk Replacement:

If one of the disks in a RAID failed or damaged, you may replace it with another one. First of all, find out if the disc is damaged and needs to be replaced.

# cat /proc/mdstat


To Add or Remove Disks to Software RAID on Linux:

1. If you need to remove the previously created mdadm RAID device, unmount it:

# umount /backup

2. Then run this command:

# mdadm -S /dev/md0

mdadm: stopped /dev/md0

3. After destroying the RAID array, it won’t detected as a separate disk device:

# mdadm -S /dev/md0

mdadm: error opening /dev/md0: No such file or directory

4. You can scan all connected drives and re-create a previously removed (failed) RAID device according to the metadata on physical drives. Run the following command:

# mdadm --assemble —scan


About Mdmonitor: RAID State Monitoring & Email Notifications:

The mdmonitor daemon can be used to monitor the status of the RAID. 

1. First, you must create the /etc/mdadm.conf file containing the current array configuration:

# mdadm –detail –scan > /etc/mdadm.conf

The mdadm.conf file is not created automatically. You must create and update it manually.

2. Add to the end of /etc/mdadm.conf the administrator email address to which you want to send notifications in case of any RAID problems:

MAILADDR raidadmin@woshub.com

3. Then restart mdmonitor service using systemctl:

# systemctl restart mdmonitor

Then the system will notify you by e-mail if there are any mdadm errors or faulty disks.

Read More


Prometheus Distributed Monitoring System - A brief review

This article covers an overview of what Prometheus Distributed Monitoring System is and how it works.

Prometheus is an open-source systems monitoring and alerting toolkit with an active ecosystem.


Why is Prometheus used?

Prometheus is an open-source monitoring software that is very popular in the industry. Prometheus is easy to customize, and produces metrics without impacting application performance.

Along with this, Prometheus monitoring can be used to provide clarity into systems and how to run them.


What is Prometheus monitoring used for?

Prometheus is a free software application used for event monitoring and alerting. It records real-time metrics in a time series database (allowing for high dimensionality) built using a HTTP pull model, with flexible queries and real-time alerting.


What is AWS Prometheus?

Amazon Managed Service for Prometheus (AMP) is a Prometheus-compatible monitoring service that makes it easy to monitor containerized applications at scale.

AMP automatically scales as your workloads grow or shrink, and is integrated with AWS security services to enable fast and secure access to data.


What metrics does Prometheus collect?

At this moment, for Prometheus, all metrics are time-series data. The Prometheus client libraries are the ones in charge of aggregating metrics data, like count or sum. Usually, these client libraries—like the Go library from the graphic above—have four types of metrics: counter, gauge, history, and summary.


What is the difference between Grafana and Prometheus?

Grafana and Prometheus, both help us in tackling issues related to complex data in a simplified manner. 

Grafana is an open-source visualization software, which helps the users to understand the complex data with the help of data metrics.

Prometheus is an open-source event monitoring and alerting tool.


How does Prometheus monitoring work?

Prometheus scrapes metrics from instrumented jobs, either directly or via an intermediary push gateway for short-lived jobs. 

It stores all scraped samples locally and runs rules over this data to either aggregate and record new time series from existing data or generate alerts.

Read More


Linux vs Windows file systems - Which do you prefer

This article covers difference between Linux and Windows file system. Basically, both Windows and Linux use file systems to store data in an organized manner. 


Advantages of using Linux:

1. Linux facilitates with powerful support for networking. 

2. The client-server systems can be easily set to a Linux system. 

3. It provides various command-line tools such as ssh, ip, mail, telnet, and more for connectivity with the other systems and servers. 

4. Tasks such as network backup are much faster than others.


Disadvantages of Linux OS:

1. No single way of packaging software.

2. No standard desktop environment.

3. Poor support for games.

4. Desktop software is still rare.


Why Linux is not popular as Windows?

The main reason why Linux is not popular on the desktop is that it doesn't have “the one” OS for the desktop as does Microsoft with its Windows and Apple with its macOS. 

If Linux had only one operating system, then the scenario would be totally different today. Linux kernel has some 27.8 million lines of code.


Linux a good operating system and widely considered one of the most reliable, stable, and secure operating systems too. In fact, many software developers choose Linux as their preferred OS for their projects. 

It is important, however, to point out that the term "Linux" only really applies to the core kernel of the OS.


Most Stable Linux Distros:

1. Debian. Suitable for: Beginners.

2. Fedora. Suitable for: Software Developers, Students.

3. Linux Mint. Suitable for: Professionals, Developers, Students.

4. Manjaro. Suitable for: Beginners.

5. openSUSE. Suitable for: Beginners and advanced users.

6. Tails. Suitable for: Security and privacy.

7. Ubuntu.

8. Zorin OS.


Reasons Why Linux Is Better Than Windows:

1. Total cost of ownership. The most obvious advantage is that Linux is free whereas Windows is not.

2. Beginner friendly and easy to use. Windows OS is one of the simplest desktop OS available today.

3. Reliability. Linux is more reliable when compared to Windows.

4. Hardware.

5. Software.

6. Security.

7. Freedom.

8. Annoying crashes and reboots.


Can Linux and Windows share files?

The easiest and most reliable way to share files between a Linux and Windows computer on the same local area network is to use the Samba file sharing protocol. 

All modern versions of Windows come with Samba installed, and Samba is installed by default on most distributions of Linux.


Can Linux read NTFS drives?

Linux can read NTFS drives using the old NTFS filesystem that comes with the kernel, assuming that the person that compiled the kernel didn't choose to disable it. 

To add write access, it's more reliable to use the FUSE ntfs-3g driver, which is included in most distributions.


For typical everyday Linux use, there's absolutely nothing tricky or technical you need to learn. Running a Linux server, of course, is another matter just as running a Windows server is. 

But for typical use on the desktop, if you've already learned one operating system, Linux should not be difficult.


Is Linux a good career choice?

A Linux Administrator job can definitely be something you can start your career with. 

It is basically the first step to start working in the Linux industry. 

Literally every company nowadays works on Linux. So yes, you are good to go.

Read More


Set custom php.ini in FastCGI - How to set it up

This article covers how to set custom php.ini in FastCGI. Basically, FastCGI is the best to manage resources for a high traffic site in shared servers.


To create Custom php.ini with PHP5 under FastCGI:

1. First open .htaccess for the account in question and add the following lines to the bottom of the file:

AddHandler php5-fastcgi .php

Action php5-fastcgi /cgi-bin/php5.fcgi

2. Next, you'll need to source your main server php.ini which is located in /usr/local/lib/. Also note that it needs to have the correct ownership so we'll take care of that too:

cd /home/user/public_html/cgi-bin/

cp -a /usr/local/lib/php.ini .

chown user:user php.ini

3. Next we need to create the wrapper script. Create a file in your current directory (cgi-bin) called php5.fcgi as defined above and add the following:

#!/bin/sh

export PHP_FCGI_CHILDREN=1

export PHP_FCGI_MAX_REQUESTS=10

exec /usr/local/cpanel/cgi-sys/php5

4. Finally, make sure the ownership and permissions are correct on this file:

chown user:user php5.fcgi && chmod 0755 php5.fcgi

Read More


Troubleshoot server down issues - How to do it

This article covers how to troubleshoot server down issues. Basically, network issues might cause the Datacenter to go down. This can lead us into some unlucky instances. Troubleshooting server down issues is never an easy task. Whether you have a small home network, or a super connection of thousands of computers, there are meticulous steps you need to take to get your server back up running.


Steps to take when troubleshooting server down issues:

1. ANALYZE YOUR NETWORK INFRASTRUCTURE

You will have a better chance at troubleshooting network problems if you first figure out where everything is connected in the infrastructure.

2. STUDY YOUR NETWORK

If you don't have an infrastructure design to go by, you will have to learn your network’s layout when analyzing your connectivity. Several tools can help you to map out the entire network infrastructure. Tools such as IPCONFIG can aid in finding the problem.

3. CONNECTION IS DOWN

From the network troubleshooting application, find out from the OSI model if all the seven layers are working correctly. Usually, if the first layer doesn’t work the whole connection will be down. Check whether the network cable is plugged in.

4. NO IP ADDRESS

Your server could be down just because of unknown IP address settings. Anon IP address such as 0.0.0.0 or an automatic one that starts with 169.254 will typically result in server down problems. You will need to obtain a valid IP address before you can get your server back up. 

5. NO DNS SERVERS

Without DNS servers configured on your network, all communication will only be possible through an IP address. A server down issue, in this case, might be a broken a line between the router and the internet. 

6. NO DEFAULT GATEWAY

Your servers could be down because there is no default gateway IP address. This breaks the communication between the subnet and the local area network. You will still be able to work as usual on your local servers. 

7. MISCONFIGURED IP SUBNET MASK

A misconfigured subnet mask IP can impede server communication. You can manually configure this IP subnet mask or work with the DHCP server to identify the source if there is a misconfiguration.

Read More


Create custom php ini in Litespeed Webserver - How to do it

This article covers how to Create custom php.ini in Litespeed Webserver. Basically, compared to the Apache web server, the Litespeed web server configuration may feel a bit complicated. In hosting environment with cPanel servers, it is necessary to edit the PHP variables for each domain or customer and this can be done using by creating a custom php.ini for each user's home directory. So the clients can change the PHP values according to their requirements.  

There should some steps need to be done on Litespeed admin panel on cPanel/WHM to enable custom php.ini and you can follow the below steps to enable it.


To Create Custom Php.Ini In A Litespeed Webserver:

1. Login into WHM.

2. Select Litespeed Web Server

3. Litespeed Configuration > Admin Console > Configuration > Server > External App > lsphp5

4. Under Environment section >> add “PHPRC=$VH_ROOT”

5. Under “suEXEC User ” section >> add the account username for which custom php.ini has to be enabled.

6. Under “suEXEC Group ” section >> add the group name of the same account.

7. Click save and return to Main >> Litespeed Web server

8. Under Quick Configuration of PHP suEXEC settings,>> Set Enable PHP suExec to yes.

9. After that put custom php.ini in the user’s home directory and check it using a phpinfo page.

Read More







Focus on your business, not your servers.

Click Here to Learn More