Project Server Maintainance


1.Upgrade Server

Go to the project folder,stop the server, pull from git, build with maven, and start the server.
cd /opt/project/MultiDBs-Query-Server/
./stop-servers.sh
git pull
mvn clean install
./start-servers.sh


2.Upgrade WebClient

Go to the project folder, full from git.
cd /opt/project/MultiDBs-Query-WebClient/
git pull


3.Temporary Catalogs Removing

Sometimes when there's error, temporary catalogs cannot be deleted. So we have to delete them manually.
cd /opt/project/MultiDBs-Query-Server/presto-server-0.97/etc/catalog/
find . -type f -name tmp\* -exec rm {} \;


4.Outdated datasource info removing:

When metastore deletes a datasource, they should have called our drop catalog api yet they seem not to have called it.
So, we have to call it by ourselves. First get all datasources information from metastore (you can do it by opening the webpage).
Then, call the url in the browser "http://{your server ip}:{port}/Catalog/drop/{databaseid}" to drop it.


5.Presto server down issue:

When occurred an out-of-memory error, presto kills itself. (You can change it in jvm.config under presto-server-0.97/etc folder)
To start the server, just simply go to the presto-server-0.97 folder, and call the launcher to start the server.
cd /opt/project/MultiDBs-Query-Server/presto-server-0.97
bin/launcher start



Future development guide


1.Presto catalog listening thread

Currently, the only way for presto to get new catalog loaded or get a catalog removed is to restart.
This may cause many issues. Later workers should try to change presto code to add a catalog listening thread to detect catalog changes.

Please go to presto github to see more information and be free to ask questions and submit issues.


2.Check catalogs when server starts

Currently, we have a class called "CatalogMatcherManager" which has not been implemented.
Yet it should be able to handle stuff like:
1). Connect to metastore and check lost catalogs.
2). Fix lost catalogs.
3). Connect to metastore and check catalogs that has been removed from metastore.
4). Remove outdated catalogs.
5). Remove trash catalogs generated but not deleted caused by errors when using save API in the wrong way.
Refer to 3 above in Maintainance part.


3.More Presto Manager APIs

Now we only have add and drop catalog APIs. Yet there're some needs that we provide all catalogs we have.
Plus, there should be a API to launch presto server if we found that it was down.