1.add h2 port

2.fix bug: multi server
This commit is contained in:
judy0131 2018-10-25 13:18:14 +08:00
parent c6db0d1acb
commit 6b6a1588ec
3 changed files with 5 additions and 5 deletions

View File

@ -19,5 +19,4 @@ piflow.bundle=/opt/project/piflow/piflow-server/target/piflow-server-0.9.jar
yarn.url=http://10.0.86.191:8088/ws/v1/cluster/apps/
checkpoint.path=hdfs://10.0.86.89:9000/xjzhu/piflow/checkpoints/
log.path=/opt/project/piflow/logs
icon.path=/opt/project/piflow/icon
h2.port=50001

View File

@ -11,7 +11,8 @@ object H2Util {
val CREATE_FLOW_TABLE = "create table if not exists flow (id varchar(255), name varchar(255), state varchar(255), startTime varchar(255), endTime varchar(255))"
val CREATE_STOP_TABLE = "create table if not exists stop (flowId varchar(255), name varchar(255), state varchar(255), startTime varchar(255), endTime varchar(255))"
//val CONNECTION_URL = "jdbc:h2:tcp://" + PropertyUtil.getPropertyValue("server.ip") + ":9092/~/piflow"
val CONNECTION_URL = "jdbc:h2:tcp://" + PropertyUtil.getPropertyValue("server.ip") + "/~/piflow"
val serverIP = PropertyUtil.getPropertyValue("server.ip") + ":" + PropertyUtil.getPropertyValue("h2.port")
val CONNECTION_URL = "jdbc:h2:tcp://" + serverIP + "/~/piflow;AUTO_SERVER=true"
var connection : Connection= null
try{
@ -113,7 +114,7 @@ object H2Util {
statement.close()
if (!flowInfo.equals(""))
flowInfo += stopList.mkString(",") + "]}"
flowInfo += stopList.mkString(",") + "]}}"
flowInfo
}

View File

@ -187,6 +187,6 @@ object HTTPService extends DefaultJsonProtocol with Directives with SprayJsonSup
object Main {
def main(argv: Array[String]):Unit = {
HTTPService.run
val h2Server = Server.createTcpServer("-tcp", "-tcpAllowOthers").start()
val h2Server = Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort",PropertyUtil.getPropertyValue("h2.port")).start()
}
}