1). A 64 bit linux system. 2). Oracle java 8.
To follow this guide, you'd better use a system with apt-get like ubuntu. In center OS and Redhat, commands are different, especially when installing java8. (See this for more information on installing oracle jdk 8.)sudo apt-get install git
After installation, we can begin to clone our project into the server machine. By default, we place the project into /opt/project folder.cd /opt sudo mkdir project cd project sudo git clone https://github.com/infsci2711/MultiDBs-Query-Server.git
When installing MySQL, please use 'proot' as password of root user. Later you may change it.
cd MultiDBs-Query-Server sudo chmod +x ./setup.sh ./setup.sh
Follow all setup guides in the console.What does the script do?
First, it installed java 8.
Second, it installed maven, mysql, and nginx.
Third, it made a directory for presto logs.
Finally, it initialized the database.
1). Configure Java Environment Variables
sudo nano /etc/profile
use down arrow to go to the end of the file, press enter
Add the following lines:
Path=$PATH:/usr/lib/jvm/java-8-oracle/bin
export JAVA_Home=/usr/lib/jvm/java-8-oracle
export CLASSPATH=$JAVA_HOME/lib:.
close the file by ctrl+x, follow the guide to save the file.
Then run the following command in terminal:
source /etc/profile
2). Configure MySQL
sudo nano /etc/mysql/my.cnf
use down arrow to search for [client]
Add the following line under [client]:
default-character-set = utf8
use down arrow to search for [mysqld]. And just somw lines below, find "bind-address"
Change to the following:
bind-address = 0.0.0.0
close the file by ctrl+x, follow the guide to save the file.
Then run either of the following command in terminal:
sudo service mysql restart sudo /etc/init.d/mysql restart
3). Configure project config file
cd /opt/project/MultiDBs-Query-Server/MultiDBsQueryServerAPI/src/main/resources sudo nano config.properties
change the following to correct value: (e.g. metastore.rest.base = http://54.152.26.131:7654)
metastore.rest.base = (url of metastore project)
What does parameters mean in this file?
"port" is the port you are going to use for the server
"metastore.rest.base" is the base url of metastore project
"metastore.rest.getAllDatasources" is the path after "metastore.rest.base" which will provide all datasources list
"metastore.rest.addDatasource" is the path after "metastore.rest.base" which provides the register restful api
"presto.root" is the root folder of presto server
4). Add priviledge to project folder(replace the username with your server login username)
cd /opt/ sudo chown -R username:username project
5). Enable start-server and stop-server scripts
cd /opt/project/MultiDBs-Query-Server/ sudo chmod +x ./start-servers.sh sudo chmod +x ./stop-servers.sh
6). Configure the web client
cd /usr/share/nginx sudo rm -R html sudo ln -sv /opt/project/MultiDBs-Query-WebClient html cd /opt/project/MultiDBs-Query-WebClient/javascripts/knockout_models sudo nano global.js
change the following to correct value: (e.g. var restBaseUrl = "http://54.174.80.167:7654/"; var metastoreGetDataSourcesUrl = "http://54.152.26.131:7654/datasources";)
var restBaseUrl = "http://(your ip address):(your server port,default 7654)/"; var metaStoreGetDataSourcesURL = "http://(metastore ip address):(metastore server port,default 7654)/datasources";
cd /opt/project/MultiDBs-Utils
mvn install
cd /opt/project/MultiDBs-Query-Server
mvn install
cd /opt/project/MultiDBs-Query-Server
./start-servers.sh
You can also stop the server by running: ./stop-servers.sh