This project aims to develop an elastic distributed database using mysql replication to guarantee high availability and dynamic scalability and use it to serve as the backend for a multi-tier web application running TPC-W benchmark.

Configuration on single ec2
Config on AWS and install necessary tools on ec2(master node). password for mysql is : TigerBit!2016(default)
sudo apt-get update
sudo apt-get install -y openjdk-7-jdk ant gcc links git make
sudo apt-get install mysql-server
sudo apt-get install tomcat7

on slave nodes and candidate node, only mysql and java needs to be installed.

Clone repository
git clone https://github.com/jopereira/java-tpcw.git
git clone https://github.com/peterbittiger/elasticDB.git
Initialize Database
mysql -uroot -p < /home/ubuntu/elasticDB/tpcw/mysql.sql
Deployment
cd java-tpcw
patch -p1 < /home/ubuntu/elasticDB/tpcw/tpcw.patch // apply patch
ant dist
sudo rm -rf /var/lib/tomcat7/webapps/tpcw* // not necessary for the first time
sudo cp /home/ubuntu/java-tpcw/dist/tpcw.war /var/lib/tomcat7/webapps
ant gendb // populate database
sudo ant genimg // presentation tier
Log in the web page
http://:8080/tpcw/TPCW_home_interaction
Configuration on multiple ec2

Use our own laptop as client emulator, which is respond for sending different request.

Set root password to: 0307
sudo su
passwd
Change config to allow access from outside
vi /etc/ssh/sshd_config

change PermitRootLogin to yes and PasswordAuthentication to yes

service ssh restart
Copy key-pairs
sudo su
cd ~
ssh-keygen -t rsa
ssh-copy-id root@

my computer copy to 4 ec2 instances, master copy to 4 ec2 instances(including itself), slaves should copy to the other 3 ec2 instances. Copying key of a to c means that c grants access to a

Clone repo
git clone https://github.com/peterbittiger/elasticDB.git

change the corresponding ip address in set_env.sh and run testConnection.sh to test communications

MySQL Replication

Run prepareMasterSlaves.sh and then log in to master node and run mysql

mysql -uroot -p
#pwd: TigerBit!2016

inside mysql enter the following commands:

mysql> use canvasjs_db;
mysql> select * from datapoints;

download related dependency for this project:

mvn dependency:resolve
mvn eclipse:eclipse

and then change ipaddress in tpcw.properties in our project:

writeQueue =
readQueue = ,,
candidateQueur =

本文数据库(综合)相关术语:系统安全软件

主题: 数据MySQLSQL数据库
分页:12
转载请注明
本文标题:ElasticDistributedDatabase 数据库 数据库学习 数据库知识 ElasticDistributedDataba ...
本站链接:http://www.codesec.net/view/524257.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(综合) | 评论(0) | 阅读(54)