loading

Introduction

  • Cloud computing is a technology that attracts ICT service providers offering tremendous opportunities for online distribution of services. It offers computing as a utility, sharing resources of scalable data centers. End users can benefit from the convenience of accessing data and services globally, from centrally managed backups, high computational capacity and flexible billing strategies. Cloud computing is also ecologically friendly. It benefits from the efficient utilization of servers, data center power planning, large scale virtualization, and optimized software stacks.
  • Cloud computing is an emerging paradigm that provides computing, communication and storage resources as a service over a network. Communication resources often become a bottleneck in service provisioning for many cloud applications. Therefore, data replication which brings data (e.g., databases) closer to data consumers (e.g., cloud applications) is seen as a promising solution. It allows minimizing network delays and bandwidth usage.we consider both energy efficiency and bandwidth consumption of the system. This is in addition to the improved quality of service QoS obtained as a result of the reduced communication delays. The results obtained from the simulator might help to unveil performance and energy efficiency tradeoffs as well as guide the design of future data replication solutions.

Step 1: Vmware Workstation Installation

  • Components required

Physical machine with necessary hardware requirements.

  • Software required

Vmware workstation, Vmware Tools.

  • Process
  1. Download VMware Workstation from Vmware website.
  2. Double click on the downloaded VMware workstation executable file i.e VMware-workstation-full-12.0.0-1295980.exe.
  3. Click next on continue to start setup.
  4. Accept VMware license agreement & click next to continue.
  5. Click on “typical” setup type
  6. Click on next to continue setup.
  7. You can use VMware Workstation technology evalution key for VMware workstation 12.
  8. Click on finish to complete the setup.

Step 2: Virtual Machine Creation

  • Components required

Physical machine with necessary hardware requirements.

  • Software required

Vmware workstation, Vmware Tools, iso image of an operating ystem

  • Process
  1. Start VMware Workstation.
  2. Start the New Virtual Machine Wizard.
  3. Select the method you want to use for configuring your virtual machine. Select Typical
  4. Select a guest operating system.
  5. Select a name and folder for the virtual machine.
  6. Configure the networking capabilities of the virtual machine.
  7. Select the disk you want to use with the virtual machine.
  8. Specify the capacity of the virtual disk..
  9. Click Finish. The wizard sets up the files needed for your virtual machine.

Step 3: Installing Xampp

  • Components required

Physical machine and virtual machine with necessary hardware requirements.

  • Software required

Vmware workstation, Vmware Tools, Xampp

  • Process
  1. To install Xampp, right-click the file xampp-win32-5.6.30-0-VC11-installer.exe and select the install option from the pop-up menu, or simply double-click the file.
  2. XAMPP offers a variety of components that you can install, such as MySQL, phpMyAdmin, PHP, Apache, and more. For the most part, you will be using most of these components, as such it’s recommended to leave the default options and click Next.
  3. Leave the default install location settings or choose another folder to install the software, and click Next to begin the installation.
  4. During the installation Windows will prompt you to allow certain services to communicate through the firewall. Click Allow access through the firewall for private.
  5. Click Finish to complete the installation and to start using XAMPP Control Panel.Choose your language (English or German), and click Save to complete and open XAMPP Control Panel.
  6. Press the start Button at the mysql row. Now you've successfully started mysql.
  7. But at first you have to set/change the MySQL Root password. Start the Apache server and type localhost or 127.0.0.1 in your browser's address bar. If you haven't deleted anything from the htdocs folder the xampp status page appears. Navigate to security settings and change your mysql root password.now open localhost and start.

Step 4: Database Creation and Replication

  • Components required

Physical machine and virtual machine with necessary hardware requirements.

  • Software required

Vmware workstation, Vmware Tools, Xampp with MySQL running on it.

  • Process
  1. Get to our root mysql user by typing the following in the command prompt: mysql –u root
  2. Create users in both, Physical and Virtual Machines using following command: create user ‘name’@’%’ identified by ‘********’;
  3. To grant these user permission to replicate data: grant replication slave on *.* to ’name’@’%’ identified by ‘********’;
  4. To obtain the log-bin file and log-bin position use the command: show master status;
  5. Stop the slave using: stop slave;
  6. To give the details of the master, give all the deatails of the other machine with acts as master to the current machine i.e., master-host, master-user, master-password, master-port, master-log-file, master-log-pos, master-connect-retry;
  7. Now start the slave using: start slave;
  8. To check the slave status: show slave status \g; .This shows details of the slave like slave_io_state, etc.
  9. Now create database in any one of the machine and it will be replicated on the other machine.

Step 5: Configuration in XAMPP Control Panel

Select the config file of MySql from XAMPP Control

Panel and open my.ini file and do the following cofigurations in both the servers

Server 1:

Under [mysqld] type

log-bin=mysql-bin

server-id=1

Server 2:

Under [mysqld] type

log-bin=mysql-bin

server-id=1

Step 6: Creating User and Granting Permission for Replication

Now open command prompt in your machine and login to

your Mysql using the following command:

Server 1:

Run Command Prompt

cd c:/xampp/mysql/bin

mysql –u root

Server 2:

Run Command Prompt

cd c:/xampp/mysql/bin

mysql –u root

Step 7: To Create User and Grant Permission for Replication Process

Server 1:

create user ‘username1’@’%’ identified by ‘password1’;

grant replication slave on *.* to ‘username1’@’%’ identified by ‘password1’;

show master status;

Server 2:

create user ‘username2’@’%’ identified by ‘password2’;

grant replication slave on *.* to ‘username2’@’%’ identified by ‘password2’;

show master status;

Step 8: Configuring the Master and Slave Status

Server 1:

Show master status;

Stop slave;

CHANGE MASTER TO

MASTER_HOST = ‘2.2.2.2’,

MASTER_USER = ‘username2’,

MASTER_PASSWORD = ‘password2’,

MASTER_PORT = 3306,

MASTER_LOG_BIN = ‘mysql-bin.000002’,

MASTER_LOG-POS = 102,

MASTER_CONNECT_RETRY = 10;

start slave;

show slave status \g;

Server 2:

Show master status;

Stop slave;

CHANGE MASTER TO

MASTER_HOST = ‘1.1.1.1’,

MASTER_USER = ‘username1’,

MASTER_PASSWORD = ‘password1’,

MASTER_PORT = 3306,

MASTER_LOG_BIN = ‘mysql-bin.000001’,

MASTER_LOG-POS = 101,

MASTER_CONNECT_RETRY = 10;

start slave;

show slave status \g;

Step 9: To Create Database and Table

  • To display the available database:

show databases;

  • To create database:

Create database db_project;

  • To use the database:

Use db_project;

  • To create a table in the database:

Create table project(

project_id INT(10) NOT NULL AUTO_INCREMENT,

project_name Varchar(255) NOT NULL,

PRIMARY KEY(project_id)

)

ENGINE =INNODB;

To display the table:

Show tables;

  • To insert values into the table:

INSERT INTO project (project_name)

VALUES

(‘Cloud’)

(‘Big_Data’)

(‘Android’)

(‘IOT’)

(‘Java’);

  • To display the contents of the table:

SELECT * FROM project;

Step 10: Conclusion

The proposed replication solution provides a reliable system that provide data replication in a cloud virtualized environment. This simulator focuses on Multi Master data replication. The obtained results confirm that if one master fails, other masters can update the database and these master can be located in several datacenters, i.e., distributed across the network.

<p>Thanks for sharing :)</p>

About This Instructable

84views

8favorites

More by Alfred David Rajesh:Data Replication Technique in Cloud Computing Data Centres 
Add instructable to: