Blog

What is LVM and how to create it on CentOs?

What is Logical Volume Management?

LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes. With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes.

How to create it on CentOs?

The physical volumes are combined into logical volumes, with the exception of the /boot/ partition.

The /boot/partition cannot be on a logical volume group because the boot loader cannot read it.

If the root (/) partition is on a logical volume, create a separate /boot/ partition which is not a part of a volume group.

Since a physical volume cannot span over multiple drives, to span over more than one drive, create one or more physical volumes per drive.

The volume groups can be divided into logical volumes, which are assigned mount points. When “partitions” reach their full capacity, free space from the volume group can be added to the logical volume to increase the size of the partition. When a new hard drive is added to the system, it can be added to the volume group, and partitions that are logical volumes can be increased in size.

If a system is partitioned with the ext3 file system, the hard drive is divided into partitions of defined sizes. If a partition becomes full, it is not easy to expand the size of the partition. Even if the partition is moved to another hard drive, the original hard drive space has to be reallocated as a different partition or not used.

Conclusion

Still confused how to create LVM on CentOs? Contact Ideastack now.

Frequently Asked Questions

Q1. What is logical volume?

On physical volumes, logical volumes are collections of data. Management of disk storage involves a hierarchy of structures. Physical volumes (PVs), often known as separate disk drives, are given names like /dev/hdisk0. Each physical volume that is in use is a member of a volume group.

Q2. What is the benefit of LVM?

The primary benefits of LVM are enhanced abstraction, flexibility, and control. Logical volumes can be given meaningful names such as “databases” or “root-backup”. Additionally, volumes can be dynamically resized as storage needs change, moved between physical devices in the pool on a running system, or exported.

Q3. Why is LVM used?

LVM is used for the following purposes: creating single logical volumes from several physical volumes or complete hard disks (similar to RAID 0, but more like JBOD), and allowing for dynamic volume resizing.

How to configure cPanel backup

Imagine if you are in hurry to reach for a very important meeting with your client and as soon as you open your bag to look for the pen drive in which you have stored the presentation is suddenly lost.

What a nightmare that would be!! You’re worried & wish you would have a backup file for this situation. Maybe a cloud file or you could have mailed it to someone.

Likewise, your website may also be lost due to many reasons such as server failure, nulled plugin, virus, or hacking & without a backup plan in such case your entire data & hard work will get lost and nulled.

In this blog, we’ll teach you how to take a backup of your website from Cpanel also how to automate the backup process weekly in case you forgot to take the backup because of any reason. If you have any doubts or confusion about the steps feel free to chat with our support team.

Step 1:

Login to cPanel/WHM->Go to Backup Configuration.

Step 1

Step 2:

Under the Backup Settings section.

Backup Status->Tick on Enable Backups.

Global Settings->Under Backup Type->Tick on Incremental.

Step 2.1

Tick on check the Available Disk Space->2048MB (set as per your requirement).

Maximum Backup Restoration Timeout->21600(default).

Step 2.2

Scheduling and Retention->Tick on Weekly Backup->Saturday (Set as per your requirement).

Retention->2 and Tick on Strictly enforce retention, regardless of backup success.

Step 2.3

Files->Back up User Accounts and Tick on Back up System Files.

Step 2.4

Databases->Back up SQL Databases->Tick on Per Account Only.

Under Configure the Backup Directory

Default Backup Directory->/home/rabalebackup (Your cPanel/WHM Server directory where the backup will generate and store).

Backup Staging Directory->/cpanelbackup/rabalebackup (This is your remote backup location directory).

Tick on Retain Backups in the Default Backup Directory and click on Save Configuration.

Step 2.6

Step 3:

Under Additional Destinations section.

Step 3.1

Select Rsync and click on Create New Destination.

Step 3.2

Under Rsync Destination

Enter Destination Name->cpanelbackup.

Tick on Transfer System Backups to this Destination.

Step 3.3

Backup Directory->backup (It is optional).

Remote Host->192.168.1.52 (Your Rsync server ip, where you want to store your cPanel backup).

Port->22.

Step 3.4

Remote Account Username-> root (Your Rsync server username).

Authentication Type->Password Authentication.

Remote Password->*******(Enter your Rsync server password).

Timeout->300 (Set as 300) and Click on Save Destination.

Step 3.5

Step 4:

After completion of your backup settings, now we have to validate our Rsync settings. So, click on Validate Button.

Step 4

Conclusion

Still confused how to configure cPanel backup. To know more visit Ideastack.

Frequently Asked Questions

Q1. What is cPanel used for?

cPanel is a control panel that is based on Linux and is used to manage the web hosting. The system functions much like a desktop application. cPanel allows you to do actions from a user-friendly interface rather than running difficult instructions.

Q2. What is the difference between web hosting and cPanel?

cPanel is the name of the control panel used by customers of a hosting company who are resellers. It is used by users to control their own hosting accounts. WHM grants root-level access to resellers. The web hosting accounts on the server are only accessible to cPanel users.

Q3. Do all websites use cPanel?

Despite cPanel’s popularity, not every host uses it to give clients a way to manage their websites.

How to create VPS on KVM Virtualizor

Create Storage

Before creating any VMs, it’s necessary to define your storage.

Navigate to Virtualizor Admin Panel -> Storage -> Add Storage.

Create Storage

Create IP pool

Before creating any VMs, it’s necessary to define your IP Pool.

Navigate to Virtualizor Admin Panel -> IP pool -> Create IP pool.

Create IP pool

Step for create new VPS

Prerequisite:

Check the SPACE, Memory, Load (should be less than 9) of the server where you need to create new VPS.

Steps are given below:

Step 1:

Login into the virtualizer.

Step 2:

Create or select a user account.

Step 3:

Select Operating system.

Step 4:

Give the hostname of the server. ( eg:- server.ABC.com).

Step 5:

Set the VPS root password. (optional).

Step 6:

Assign the free IP address.

Step 7:

Enter server specification amount (As per customer plan).

Step 8:

Tick the option VNC (Must).

Step 9:

Under network setting.

Step 10:

Under the advanced option.

Step 11:

Select add a virtual server.

Coclusion

Still confused about how to create VPS on KVM Virtualizor? Contact Ideastack now!

Frequently Asked Questions

Q1. What is KVM Virtualizor?

KVM (Kernel-based Virtual Machine) is a complete virtualization solution for Linux running on x86 hardware that includes virtualization extensions (Intel VT or AMD-V). It is made up of a loadable kernel module called KVM.

Q2. What are KVMS used for?

KVM, which stands for “keyboard, video, mouse,” enables you to manage several computers using just one keyboard, mouse, and monitor. These switches are frequently used to handle racked servers, which contain multiple servers in a single rack.

Q3. Are KVMs worth it?

If you have multiple systems running, a software KVM switch is an efficient method to increase productivity. Using a single keyboard and mouse to handle several computers will save you time and money.

How to install KVM Virtualizor

1. CentOS 5.x / 6.x / 7.x or Red Hat Enterprise Linux 5.x / 6.x or Scientific Linux 5.x / 6.x or Ubuntu 12.04 or Ubuntu 14.04 or Ubuntu 16.04(x86_64).

2. yum / apt-get.

3. Storage to create the VPS disks.

Step 1: Take putty of the hardware server.

Step 2: Download and Install virtualizor.

1. wget – http://files.virtualizor.com/install.sh

3. ./install.sh [email protected] kernel=kvm //put any email address

Step 3: Reboot the server (# init 6).

Step 4: Once rebooted. Restart the virtualizor service on the server.

# /etc/init.d/virtnetwork restart ——> in centos 6
# service libvirtd restart            ——> in centos 7

Step 5: Check and put the network interface for the server.

1. Open Virtualizor in the browser.

2. Go to Configuration -> Master setting -> network interface -> network_interface_name.

3. Save the configuration.

Step 6: Done.

Step 7: Check firewall service and enable the virtualizor port.

Conclusion

Still confused about how to install KVM Virtualizor. Contact Ideastack now.

Frequently Asked Questions

Q1. What is KVM Virtualizor?

KVM (Kernel-based Virtual Machine) is a complete virtualization solution for Linux running on x86 hardware that includes virtualization extensions. It comprises of a loadable kernel module called KVM.

Q2. How do I add a server to Virtualizor?

Go to the Virtualizor Admin Panel on the Master, then select Servers >> Add Server. On that page, click “Add Server” after filling out the “Server Name, IP Address, And Server Password (Key Pass)” fields. The master will talk to the server and gather the relevant information.

Step for MySQL master to master replication

First, install MariaDB on both the CentOS 7 based servers.

Command:

#sudo yum install mariadb-server
#sudo systemctl start mariadb
#sudo systemctl enable mariadb
#sudo systemctl status mariadb
#sudo mysql_secure_installation (press enter for the root password for the first time when it asks and then provide your own password to MySQL)

Machines to explain the procedure.

Master1 IP: 192.168.1.25
Master2 IP: 192.168.1.26

Configuration Procedure:

Master1

In the master1 terminal, check the status of MariaDB.

#sudo systemctl status mariadb

Open my.cnf file and add the following statement to the file. Save and exit from the file.

#vi /etc/my.cnf
server-id=10
log-bin=mysql-bin

Restart the MariaDB service by running the following command.

#sudo systemctl restart mariadb

After login to MySQL we are going to create a user.

#mysql –u root –p
#MariaDB [Linux]> create user ‘reply’@’%’ identified by ‘12345’;(here reply is a user and 12345 is password)
#MariaDB [Linux]> grant replication slave on *.* to ‘reply’@’%’ identified by ‘12345’;
#MariaDB [Linux]> flush privileges;
#MariaDB [Linux]> flush tables with read lock;
#MariaDB [Linux]> show master status; (it will show you the master log file and master position)
#MariaDB [Linux]>exit

Take the MySQL dump from master1 terminal and execute the following command.

#mysqldump mysql –u root -p> mysql-db.sql
#rsync -Pavzxl mysql-db.sql [email protected]:/root/

Master2

In the master 2 terminal, check the status of MariaDB.

#sudo systemctl status mariadb

Open my.cnf file and add the following statement to the file. Save and exit from the file.

#vi /etc/my.cnf
server-id=20
log-bin=mysql-bin

Restart the MariaDB service by running the following command.

#systemctl restart mariadb.service

Now inject the MySQL dump file into the master2 database.

#mysql mysql -u root -p < mysql-db.sql

After dumping, open the MySQL shell and do the replication configuration as shown below.

#mysql –u root –p
#MariaDB [Linux]> stop slave;
#MariaDB [Linux]> change master to master_host=’192.168.1.25′, master_user=’reply’, master_password=’12345′, master_log_file=’mysql-bin.000002′, master_log_pos=566; (check the master log file and master log position of master1)
#MariaDB [Linux]> start slave;
#MariaDB [Linux]> show process list;

Check the slave status by using the command as shown below.

#MariaDB [Linux]> show slave status;
#MariaDB [Linux]> exit

Restart the MariaDB service by running the following command.

#systemctl restart mariadb.service

Go to the master and check the master status using the command as shown below.

# mysql –u root –p
#MariaDB [Linux]> show master status; (it will show you the master log file and master position)

Master1

In the master terminal, check the established connection using the netstat command.

# netstat -natp | egrep -i established.*mysql

Open MySQL and check the process list and also configure the replication settings.

#mysql –u root –p
#MariaDB [Linux]> unlock tables;
#MariaDB [Linux]> show processlist;
#MariaDB [Linux]> stop slave;
#MariaDB [Linux]> change master to master_host=’192.168.1.26′,
master_user=’reply’,master_password=’12345′, master_log_file=’mysql-bin.000004′, master_log_pos=245;
#MariaDB [Linux]> start slave;
#MariaDB [Linux]> show slave status;

Replication configuration is done. Now checking the Replication process.

Master1

I have created one database named Linux.

#MariaDB [(none)]> create database Linux;
#MariaDB [(none)]> use Linux;

Create a table for the newly created database.

# MariaDB [Linux]> create table Distribution (Distro varchar(25) NOT NULL);

Insert some values into the newly created table.

# MariaDB [Linux]> insert into Distribution values(‘REDHAT’);

The table and the database has been created successfully. List the table from the database.

# MariaDB [Linux]> select * from Distribution;

Master2

In master 2, login to MySQL and list the databases.

# MariaDB [(none)]> show databases;

Now the database which is created in master1 is replicated in master2. Use the database and list the table.

# MariaDB [(none)]> use Linux ;
# MariaDB [Linux]> show tables;

Select and list the table from the selected database.

# MariaDB [Linux]> select * from Distribution;

Insert some values into that table and list the table’s values the updated values are shown. Now the replication between master-master is working successfully.

# MariaDB [Linux]> insert into Distribution values (‘Ubuntu’);
# MariaDB [Linux]> select * from Distribution;

Master1

Again go to the master1 terminal, now select and list the tables to check the replication process. If the updated value from master 2 is shown, then the replication process is done.

#mysql –u root –p
# MariaDB [Linux]> select * from Distribution;

Conclusion

Still confused how to step for MySQL master to master replication. Contact Ideastack now.

Frequently Asked Questions

Q1. How does master master replication work in MySQL?

Replication relies on three threads per master/slave connection: one on the master and two on the slaves. The slave server begins this thread when you issue START SLAVE, and it connects to the master and requests a copy of the master’s binary log.

Q2. What are the three replication strategies?

Q3. What are the two types of replications?

There are two types of replication exist: direct and conceptual.