×

Blog

How To Create VPS on KVM Virtualizor

Create Storage

——————————————————————————————————————

Before creating any VMs, its necessary to define your storage.

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

Linux vps

Create IP pool

——————————————————————————————————————

Before creating any VMs, its necessary to define your IP Pool..

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

Windows vps

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 given Below :

Step1: Log in into virtualizor

Step2:  Create or select user account

1. If new user then Fill the user Email, Password, first name  and last name in user details

2. If already exist then select user_name in user field.

Step3:  Select Operating system

1. If you want to create linux then select OS under  Operating_system option.

2. If you want to create windows  then select OS under ISO option.

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

Step5: Set the vps root password. (optional)

Step6: Assign the free ip address

Step7: Enter server specification amount (As per customer plan)

  1. Disk Space (eg. 20gb) and select appropriate HDD .
  2. Guaranteed RAM (eg. 4000 mb)
  3. Swap RAM (as per requirement but we are set to Zero)
  4. Bandwidth ( eg. 1000 GB)
  5. Network Speed ( 0 for unlimited)
  6. CPU Units ( eg. 1024 units)
  7. CPU Cores ( eg. 4)
  8. CPU % ( eg. 40%)

Step8:  Tick the option VNC ( Must )

Step 9:  Under network setting

  1. Tick the option Bandwidth suspend
  2. Virtual Network Interface Type ( Intel E1000 for Rabale and realtek 8139 for rest of all)
  3. DNS Nameservers ( 4.2.2.1 && 4.2.2.2 )

Step 10: Under Advanced option

  1. Disk Caching ( writeback )
  2. OS Reinstall Limit  ( 0 for unlimited)

Step 11: Select add virtual server

Last Edited: 06/05/2020

 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

Step1: –> Take putty of the hardware server

Step2:–> Download and Install virtualizor

  1. wget  http://files.virtualizor.com/install.sh
  2. chmod 0755 install.sh
  3. ./install.sh [email protected] kernel=kvm           //put any email address

Step3: –> Reboot the server (# init 6)

Step4: –> Once rebooted.  Restart the virtualizor service on server

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

# service libvirtd restart                      ——> in centos 7

Step5–> Check and put network interface for the server

  1. Open Virtualizor in browser
  2. Go to

Configuration-> Master setting -> network interface -> network_interface_name

  1. Save the configuration

Step6: –> Done

Step7: –>  Check firewall service and enable virtualizor port.

# service iptables stop ( For centos 6)

# Systemctl stop firewalld.service   (For centos7)

To know more visit Ideastack.

Last Edited: 06/05/2020

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 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 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 master 2 terminal, check the status of MariaDB

#sudo systemctl status mariadb

Open the 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 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 processlist;

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 netstat command.

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

Open the 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 as 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 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 the master 2, login to MySQL and list the databases. 

# MariaDB [(none)]> show databases;

Now the database which is created in master1 is replicated into 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 is shown. Now the replication between master-master is working successfully. 

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

# MariaDB [Linux]> select * from Distribution;

Master1

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

#mysql –u root –p

# MariaDB [Linux]> select * from Distribution;

To know more visit Ideastack.

Last Edited: 06/05/2020