From 75370b4b74091ab29d2ad5cf124a48203df3faa5 Mon Sep 17 00:00:00 2001 From: tangpeng Date: Tue, 28 Feb 2017 14:19:20 +0800 Subject: Modify database script Change-Id: Ice12c7810a183c4dbb501f7f6fd38499be9aaff7 Issue-ID:HOLMES-47 Signed-off-by: tangpeng --- .../src/main/assembly/conf/rulemgt.yml | 71 ++------------------- .../mysql/openo-holmes_rulemgt-createobj.sql | 72 +++++++++++----------- 2 files changed, 41 insertions(+), 102 deletions(-) (limited to 'rulemgt-standalone/src/main/assembly') diff --git a/rulemgt-standalone/src/main/assembly/conf/rulemgt.yml b/rulemgt-standalone/src/main/assembly/conf/rulemgt.yml index 91d6eb4..7b8b883 100644 --- a/rulemgt-standalone/src/main/assembly/conf/rulemgt.yml +++ b/rulemgt-standalone/src/main/assembly/conf/rulemgt.yml @@ -9,7 +9,7 @@ apidescription: ZTE Holmes rule Management rest API server: type: simple - rootPath: '/api/correlation-mgt/v1/*' + rootPath: '/api/holmes-rulemgt/v1/*' applicationContextPath: / adminContextPath: /admin connector: @@ -49,9 +49,8 @@ logging: database: driverClass: com.mysql.jdbc.Driver user: root - password: root - #url: jdbc:mysql://${db_ip}:${db_port}/mysql?useUnicode=relationtesttrue&characterEncoding=UTF8 - url: jdbc:mysql://localhost:3306/relationtest?useUnicode=true&characterEncoding=UTF8 + password: rootpass + url: jdbc:mysql://10.74.156.206:3306/holmes properties: charSet: UTF-8 maxWaitForConnection: 1s @@ -61,67 +60,5 @@ database: checkConnectionWhileIdle: false evictionInterval: 10s minIdleTime: 1s - #dbServiceName: dbService - # dbServiceVersion: v1 - -#mqConfig: -# brokerIp: 127.0.0.1 -# brokerPort: 61616 -# autoDiscover: false -# mqServiceName: activemq -# mqServiceVersion: v1 -# -#cacheConfig: -# cacheServerIp: 10.74.156.206 -# cacheServerPort: 27017 -# autoDiscover: false -# cacheServiceName: mongodbService -# cacheServiceVersion: v1 -# asNamespace: zenap -# type: mongodb -# userName: zenap -# password: zenap -# # the micro service ip - -#msbClientConfig: - # msbSvrIp: 10.74.156.206 - # msbSvrPort: 10081 - -#kafkaClientConf: -# bootstrapServers: 10.74.151.190:9092 -# autoDiscover: true -# kafkaServiceName: kafka -# kafkaServiceVersion: v1 -# consumerConf: -# properties: -# value.deserializer: org.apache.kafka.common.serialization.StringDeserializer -# producerConf: -# properties: -# value.serializer: org.apache.kafka.common.serialization.StringSerializer -# -#zkConfig: -# connectString: 10.74.151.195:2181 -# retryPolicy: -# type: boundedExponentialBackoff -# baseSleepTimeMs: 50 -# maxSleepTimeMs: 500 -# maxRetries: 3 -# sessionTimeout: 60 -# connectionTimeout: 15 -# autoDiscover: true -# zkServiceName: zk -# zkServiceVersion: v1 -# -#ftpServiceConfig: -# type: ftp -# pasv: false -# userName: uep -# userPassword: U_tywg_2008_ftp -# ftpServerAddress: 10.74.148.251 -# ftpServerPort: 20021 -# ftpsServerAddress: 10.74.148.251 -# ftpsServerPort: 20021 -# sftpServerAddress: 10.74.148.251 -# sftpServerPort: 20021 -# +msbServerAddr: http://127.0.0.1:80 diff --git a/rulemgt-standalone/src/main/assembly/dbscripts/mysql/openo-holmes_rulemgt-createobj.sql b/rulemgt-standalone/src/main/assembly/dbscripts/mysql/openo-holmes_rulemgt-createobj.sql index c8ba2bd..4d6b296 100644 --- a/rulemgt-standalone/src/main/assembly/dbscripts/mysql/openo-holmes_rulemgt-createobj.sql +++ b/rulemgt-standalone/src/main/assembly/dbscripts/mysql/openo-holmes_rulemgt-createobj.sql @@ -13,46 +13,48 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- -/******************drop old database and user***************************/ -use mysql; -drop database IF EXISTS holmes; -delete from user where User='holmes'; +/******************DROP OLD DATABASE AND USER***************************/ +USE MYSQL; +DROP DATABASE IF EXISTS HOLMES; +DELETE FROM USER WHERE USER='HOLMES'; FLUSH PRIVILEGES; -/******************create new database and user***************************/ -create database holmes CHARACTER SET utf8; +/******************CREATE NEW DATABASE AND USER***************************/ +CREATE DATABASE HOLMES CHARACTER SET UTF8; -GRANT ALL PRIVILEGES ON holmes.* TO 'holmes'@'%' IDENTIFIED BY 'holmes' WITH GRANT OPTION; -GRANT ALL PRIVILEGES ON mysql.* TO 'holmes'@'%' IDENTIFIED BY 'holmes' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON HOLMES.* TO 'HOLMES'@'%' IDENTIFIED BY 'HOLMES' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON MYSQL.* TO 'HOLMES'@'%' IDENTIFIED BY 'HOLMES' WITH GRANT OPTION; -GRANT ALL PRIVILEGES ON catalog.* TO 'holmes'@'localhost' IDENTIFIED BY 'holmes' WITH GRANT OPTION; -GRANT ALL PRIVILEGES ON mysql.* TO 'holmes'@'localhost' IDENTIFIED BY 'holmes' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON CATALOG.* TO 'HOLMES'@'LOCALHOST' IDENTIFIED BY 'HOLMES' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON MYSQL.* TO 'HOLMES'@'LOCALHOST' IDENTIFIED BY 'HOLMES' WITH GRANT OPTION; FLUSH PRIVILEGES; -use holmes; -set Names 'utf8'; -/******************delete old table and create new***************************/ -use holmes; -DROP TABLE IF EXISTS aplus_rule; -CREATE TABLE aplus_rule ( - rid varchar(30) NOT NULL, - name varchar(150) NOT NULL, - description varchar(4000) DEFAULT NULL, - enable int(1) NOT NULL, - templateID int(10) NOT NULL, - engineType varchar(20) NOT NULL, - creator varchar(20) NOT NULL, - createTime datetime NOT NULL, - updator varchar(20) DEFAULT NULL, - updateTime datetime DEFAULT NULL, - params varchar(4000) DEFAULT NULL, - content varchar(4000) NOT NULL, - vendor varchar(100) NOT NULL, - package varchar(255) NULL, - PRIMARY KEY (rid), - UNIQUE KEY name (name), - KEY IDX_APLUS_RULE_ENABLE (enable), - KEY IDX_APLUS_RULE_TEMPLATEID (templateID), - KEY IDX_APLUS_RULE_ENGINETYPE (engineType) +USE HOLMES; +SET NAMES 'UTF8'; +/******************DELETE OLD TABLE AND CREATE NEW***************************/ +USE HOLMES; +DROP TABLE IF EXISTS APLUS_RULE; +CREATE TABLE APLUS_RULE ( + RID VARCHAR(30) NOT NULL, + NAME VARCHAR(150) NOT NULL, + DESCRIPTION VARCHAR(4000) NULL, + ENABLE INT(1) NOT NULL, + TEMPLATEID INT(10) NOT NULL, + ENGINEID VARCHAR(20) NOT NULL, + ENGINETYPE VARCHAR(20) NOT NULL, + CREATOR VARCHAR(20) NOT NULL, + CREATETIME DATETIME NOT NULL, + UPDATOR VARCHAR(20) NULL, + UPDATETIME DATETIME NULL, + PARAMS VARCHAR(4000) NULL, + CONTENT VARCHAR(4000) NOT NULL, + VENDOR VARCHAR(100) NOT NULL, + PACKAGE VARCHAR(255) NULL, + PRIMARY KEY (RID), + UNIQUE KEY NAME (NAME), + KEY IDX_APLUS_RULE_ENABLE (ENABLE), + KEY IDX_APLUS_RULE_TEMPLATEID (TEMPLATEID), + KEY IDX_APLUS_RULE_ENGINEID (ENGINEID), + KEY IDX_APLUS_RULE_ENGINETYPE (ENGINETYPE) ) -- cgit 1.2.3-korg