diff --git a/config.properties b/config.properties index 1806c0d..145678e 100644 --- a/config.properties +++ b/config.properties @@ -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 \ No newline at end of file +h2.port=50001 \ No newline at end of file diff --git a/piflow-core/src/main/scala/cn/piflow/util/H2Util.scala b/piflow-core/src/main/scala/cn/piflow/util/H2Util.scala index fe59a10..3ffbb1c 100644 --- a/piflow-core/src/main/scala/cn/piflow/util/H2Util.scala +++ b/piflow-core/src/main/scala/cn/piflow/util/H2Util.scala @@ -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 } diff --git a/piflow-server/src/main/scala/cn/piflow/api/HTTPService.scala b/piflow-server/src/main/scala/cn/piflow/api/HTTPService.scala index e7825c4..90c8c4e 100644 --- a/piflow-server/src/main/scala/cn/piflow/api/HTTPService.scala +++ b/piflow-server/src/main/scala/cn/piflow/api/HTTPService.scala @@ -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() } }