This is an automated email from the ASF dual-hosted git repository.

zhiqiangtao pushed a commit to branch dev-1.3.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.3.1 by this push:
     new e7d2bd5c2 fix some sql bug and optimize  web install.sh (#3868)
e7d2bd5c2 is described below

commit e7d2bd5c2ee38e909705f58a651311b816a720dd
Author: Casion <[email protected]>
AuthorDate: Tue Nov 22 09:57:31 2022 +0800

    fix some sql bug and optimize  web install.sh (#3868)
    
    * remove linkis_ps_error_code about some special key word
    * optimize web install.sh
    * fix NPE of RMMonitorRest
    * update dml sql
---
 .../linkis/manager/rm/restful/RMMonitorRest.scala  | 11 ++-
 linkis-dist/package/db/linkis_dml.sql              |  4 +-
 .../db/upgrade/1.3.1_schema/mysql/linkis_dml.sql   | 78 ++++++++++++++++++++++
 linkis-web/install.sh                              | 43 +++++++++---
 4 files changed, 118 insertions(+), 18 deletions(-)

diff --git 
a/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/manager/rm/restful/RMMonitorRest.scala
 
b/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/manager/rm/restful/RMMonitorRest.scala
index db092daf6..7a81b5df0 100644
--- 
a/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/manager/rm/restful/RMMonitorRest.scala
+++ 
b/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/manager/rm/restful/RMMonitorRest.scala
@@ -469,12 +469,11 @@ class RMMonitorRest extends Logging {
         .get
         .asInstanceOf[EngineTypeLabel]
       val record = new mutable.HashMap[String, Any]
-      record.put("applicationName", node.getServiceInstance.getApplicationName)
-      record.put("engineInstance", node.getServiceInstance.getInstance)
-//      if (null != node.getEMNode) {
-//        record.put("moduleName", 
node.getEMNode.getServiceInstance.getApplicationName)
-//        record.put("engineManagerInstance", 
node.getEMNode.getServiceInstance.getInstance)
-//      }
+      if (node.getServiceInstance != null) {
+        record.put("applicationName", 
node.getServiceInstance.getApplicationName)
+        record.put("engineInstance", node.getServiceInstance.getInstance)
+      }
+
       record.put("creator", userCreatorLabel.getCreator)
       record.put("engineType", engineTypeLabel.getEngineType)
       if (node.getNodeResource != null) {
diff --git a/linkis-dist/package/db/linkis_dml.sql 
b/linkis-dist/package/db/linkis_dml.sql
index 114dee947..d89dbfd94 100644
--- a/linkis-dist/package/db/linkis_dml.sql
+++ b/linkis-dist/package/db/linkis_dml.sql
@@ -401,7 +401,7 @@ INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type)
 INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43037','表字段类型修改导致的转型失败,请联系修改人员','cannot be cast to',0);
 INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES ('43038','select 
的表可能有误','Invalid call to toAttribute on unresolved object',0);
 INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43039','语法问题,请检查脚本','Distinct window functions are not supported',0);
-INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43040','Presto查询一定要指定数据源和库信息','Schema must be specified when session schema 
is not set',0);
+INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43040','查询一定要指定数据源和库信息','Schema must be specified when session schema is not 
set',0);
 
 --  43 python
 INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43001','代码中存在NoneType空类型变量,请检查代码','''NoneType'' object',0);
@@ -452,7 +452,7 @@ INSERT INTO `linkis_ps_dm_datasource_type` (`name`, 
`description`, `option`, `cl
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('kafka', 'kafka', 'kafka', '消息队列', '', 
2);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('presto', 'presto SQL', 'presto', 
'大数据存储', '', 3);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('hive', 'hive数据库', 'hive', '大数据存储', '', 
3);
-INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('mongodb', 'default', 'default', 
'DEFAULT', NULL, 3);
+
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('oracle','oracle数据库','oracle','关系型数据库','',3);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('dm','达梦数据库','dm','关系型数据库','',3);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('kingbase','人大金仓数据库','kingbase','关系型数据库','',3);
diff --git a/linkis-dist/package/db/upgrade/1.3.1_schema/mysql/linkis_dml.sql 
b/linkis-dist/package/db/upgrade/1.3.1_schema/mysql/linkis_dml.sql
index 662943cd2..302d3494a 100644
--- a/linkis-dist/package/db/upgrade/1.3.1_schema/mysql/linkis_dml.sql
+++ b/linkis-dist/package/db/upgrade/1.3.1_schema/mysql/linkis_dml.sql
@@ -21,12 +21,90 @@ UPDATE `linkis_ps_dm_datasource_type_key` SET `require`=0 
WHERE `data_source_typ
 -- update pipeline config key
 UPDATE `linkis_ps_configuration_config_key` SET `key` = 
'pipeline.output.isoverwrite' WHERE `key` = 'pipeline.output.isoverwtite';
 
+
+UPDATE `linkis_ps_error_code` SET `error_desc`='查询一定要指定数据源和库信息' WHERE  
`error_code`=43040;
+
+
 -- Add datasource for linkis_ps_dm_datasource_type
+
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('oracle','oracle数据库','oracle','关系型数据库','',3);
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('dm','达梦数据库','dm','关系型数据库','',3);
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('kingbase','人大金仓数据库','kingbase','关系型数据库','',3);
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('postgresql','postgresql数据库','postgresql','关系型数据库','',3);
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('sqlserver','sqlserver数据库','sqlserver','关系型数据库','',3);
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('db2','db2数据库','db2','关系型数据库','',3);
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('greenplum','greenplum数据库','greenplum','关系型数据库','',3);
+
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('doris','doris数据库','doris','olap','',4);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('clickhouse','clickhouse数据库','clickhouse','olap','',4);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('elasticsearch','elasticsearch数据源','es无结构化存储','分布式全文索引','',3);
 
 -- Add datasource for linkis_ps_dm_datasource_type_key
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'oracle';
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL, 1, '主机名(Host)', 'Host', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL, 1, '端口号(Port)', 'Port', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'driverClassName', '驱动类名(Driver class name)', 'Driver class name', 
'oracle.jdbc.driver.OracleDriver', 'TEXT', NULL, 1, '驱动类名(Driver class name)', 
'Driver class name', NULL, NULL, NULL, NULL,  now(), [...]
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'params', '连接参数(Connection params)', 'Connection params', NULL, 'TEXT', NULL, 
0, '输入JSON格式(Input JSON format): {"param":"value"}', 'Input JSON format: 
{"param":"value"}', NULL, NULL, NULL, NULL,  no [...]
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'username', '用户名(Username)', 'Username', NULL, 'TEXT', NULL, 1, 
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL, NULL,  now(), 
now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'instance', '实例名(instance)', 'Instance', NULL, 'TEXT', NULL, 0, 
'实例名(instance)', 'Instance', NULL, NULL, NULL, NULL,  now(), now());
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'dm';
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL, 1, '主机名(Host)', 'Host', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL, 1, '端口号(Port)', 'Port', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'driverClassName', '驱动类名(Driver class name)', 'Driver class name', 
'dm.jdbc.driver.DmDriver', 'TEXT', NULL, 1, '驱动类名(Driver class name)', 'Driver 
class name', NULL, NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'params', '连接参数(Connection params)', 'Connection params', NULL, 'TEXT', NULL, 
0, '输入JSON格式(Input JSON format): {"param":"value"}', 'Input JSON format: 
{"param":"value"}', NULL, NULL, NULL, NULL,  no [...]
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'username', '用户名(Username)', 'Username', NULL, 'TEXT', NULL, 1, 
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL, NULL,  now(), 
now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'instance', '实例名(instance)', 'Instance', NULL, 'TEXT', NULL, 1, 
'实例名(instance)', 'Instance', NULL, NULL, NULL, NULL,  now(), now());
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'kingbase';
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL, 1, '主机名(Host)', 'Host', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL, 1, '端口号(Port)', 'Port', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'driverClassName', '驱动类名(Driver class name)', 'Driver class name', 
'com.kingbase8.Driver', 'TEXT', NULL, 1, '驱动类名(Driver class name)', 'Driver 
class name', NULL, NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'params', '连接参数(Connection params)', 'Connection params', NULL, 'TEXT', NULL, 
0, '输入JSON格式(Input JSON format): {"param":"value"}', 'Input JSON format: 
{"param":"value"}', NULL, NULL, NULL, NULL,  no [...]
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'username', '用户名(Username)', 'Username', NULL, 'TEXT', NULL, 1, 
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL, NULL,  now(), 
now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'instance', '实例名(instance)', 'Instance', NULL, 'TEXT', NULL, 1, 
'实例名(instance)', 'instance', NULL, NULL, NULL, NULL,  now(), now());
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'postgresql';
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL, 1, '主机名(Host)', 'Host', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL, 1, '端口号(Port)', 'Port', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'driverClassName', '驱动类名(Driver class name)', 'Driver class name', 
'org.postgresql.Driver', 'TEXT', NULL, 1, '驱动类名(Driver class name)', 'Driver 
class name', NULL, NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'params', '连接参数(Connection params)', 'Connection params', NULL, 'TEXT', NULL, 
0, '输入JSON格式(Input JSON format): {"param":"value"}', 'Input JSON format: 
{"param":"value"}', NULL, NULL, NULL, NULL,  no [...]
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'username', '用户名(Username)', 'Username', NULL, 'TEXT', NULL, 1, 
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL, NULL,  now(), 
now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'instance', '实例名(instance)', 'Instance', NULL, 'TEXT', NULL, 1, 
'实例名(instance)', 'Instance', NULL, NULL, NULL, NULL,  now(), now());
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'sqlserver';
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL, 1, '主机名(Host)', 'Host', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL, 1, '端口号(Port)', 'Port', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'driverClassName', '驱动类名(Driver class name)', 'Driver class name', 
'com.microsoft.jdbc.sqlserver.SQLServerDriver', 'TEXT', NULL, 1, '驱动类名(Driver 
class name)', 'Driver class name', NULL, NULL, NULL,  [...]
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'params', '连接参数(Connection params)', 'Connection params', NULL, 'TEXT', NULL, 
0, '输入JSON格式(Input JSON format): {"param":"value"}', 'Input JSON format: 
{"param":"value"}', NULL, NULL, NULL, NULL,  no [...]
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'username', '用户名(Username)', 'Username', NULL, 'TEXT', NULL, 1, 
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL, NULL,  now(), 
now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'instance', '实例名(instance)', 'Instance', NULL, 'TEXT', NULL, 1, 
'实例名(instance)', 'Instance', NULL, NULL, NULL, NULL,  now(), now());
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'db2';
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL, 1, '主机名(Host)', 'Host', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL, 1, '端口号(Port)', 'Port', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'driverClassName', '驱动类名(Driver class name)', 'Driver class name', 
'com.ibm.db2.jcc.DB2Driver', 'TEXT', NULL, 1, '驱动类名(Driver class name)', 
'Driver class name', NULL, NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'params', '连接参数(Connection params)', 'Connection params', NULL, 'TEXT', NULL, 
0, '输入JSON格式(Input JSON format): {"param":"value"}', 'Input JSON format: 
{"param":"value"}', NULL, NULL, NULL, NULL,  no [...]
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'username', '用户名(Username)', 'Username', NULL, 'TEXT', NULL, 1, 
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL, NULL,  now(), 
now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'instance', '实例名(instance)', 'Instance', NULL, 'TEXT', NULL, 1, 
'实例名(instance)', 'Instance', NULL, NULL, NULL, NULL,  now(), now());
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'greenplum';
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL, 1, '主机名(Host)', 'Host', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL, 1, '端口号(Port)', 'Port', NULL, 
NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'driverClassName', '驱动类名(Driver class name)', 'Driver class name', 
'com.pivotal.jdbc.GreenplumDriver', 'TEXT', NULL, 1, '驱动类名(Driver class name)', 
'Driver class name', NULL, NULL, NULL, NULL,  now() [...]
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'params', '连接参数(Connection params)', 'Connection params', NULL, 'TEXT', NULL, 
0, '输入JSON格式(Input JSON format): {"param":"value"}', 'Input JSON format: 
{"param":"value"}', NULL, NULL, NULL, NULL,  no [...]
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'username', '用户名(Username)', 'Username', NULL, 'TEXT', NULL, 1, 
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL, NULL,  now(), 
now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', NULL, NULL, NULL,  now(), now());
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'instance', '实例名(instance)', 'Instance', NULL, 'TEXT', NULL, 1, 
'实例名(instance)', 'Instance', NULL, NULL, NULL, NULL,  now(), now());
+
+
 select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'doris';
 INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL, 1, '主机名(Host)', 'Host', NULL, 
NULL, NULL, NULL,  now(), now());
 INSERT INTO `linkis_ps_dm_datasource_type_key` (`data_source_type_id`, `key`, 
`name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (@data_source_type_id, 
'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL, 1, '端口号(Port)', 'Port', NULL, 
NULL, NULL, NULL,  now(), now());
diff --git a/linkis-web/install.sh b/linkis-web/install.sh
index e2b0eadcb..dc017cca5 100644
--- a/linkis-web/install.sh
+++ b/linkis-web/install.sh
@@ -22,6 +22,16 @@ echo "linkis frontend deployment script"
 
 source $workDir/config.sh
 # frontend directory,decompression directory by default
+
+input_port=$1
+
+re='^[0-9]+$'
+if  [[ $input_port =~ $re ]] ; then
+   echo "try to use special frontend port:${input_port}"
+   linkis_port=$input_port
+fi
+
+
 linkis_basepath=$workDir
 
 #To be compatible with MacOS and Linux
@@ -69,7 +79,7 @@ echo ""
 
 portIsOccupy=false
 checkPort(){
-    pid=`lsof -nP -iTCP:$linkis_port -sTCP:LISTEN`
+    pid=`sudo lsof -nP -iTCP:$linkis_port -sTCP:LISTEN`
     if [ "$pid" != "" ];then
       echo "$linkis_port already used"
       portIsOccupy=true
@@ -178,7 +188,7 @@ centos6(){
     linkisConf
 
     # firewall
-    S_iptables=`lsof -i:$linkis_port | wc -l`
+    S_iptables=`sudo lsof -i:$linkis_port | wc -l`
     if [ "$S_iptables" -gt "0" ];then
       # allow to access port,restart firewall
       service iptables restart
@@ -190,7 +200,7 @@ centos6(){
     fi
 
     # start nginx
-    /etc/init.d/nginx start
+    sudo /etc/init.d/nginx start
 
      # adjust SELinux parameter
     sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
@@ -206,14 +216,27 @@ if [ "$portIsOccupy" = true ];then
   exit 1
 fi
 
-# centos 6
-if [[ $version -eq 6 ]]; then
-    centos6
-fi
+if [ -e /var/run/nginx.pid ]; then
+echo "Nginx is already running! Will try to reload nginx config";
+# config inginx
+linkisConf
+
+sudo nginx -s reload
+
+else
+
+       echo "Starting install nginx and try to starting..."
+
+  # centos 6
+  if [[ $version -eq 6 ]]; then
+      centos6
+  fi
+
+  # centos 7
+  if [[ $version -eq 7 ]]; then
+      centos7
+  fi
 
-# centos 7
-if [[ $version -eq 7 ]]; then
-    centos7
 fi
 
 echo "Please open the link in the 
browser:http://${linkis_ipaddr}:${linkis_port}";


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to