diff options
author | sg481n <sg481n@att.com> | 2017-08-03 17:56:38 -0400 |
---|---|---|
committer | Sai Gandham <sg481n@att.com> | 2017-08-04 15:41:45 +0000 |
commit | aaf2df8b908fcb48043d2cd51803d8fd99f18b43 (patch) | |
tree | 5f90faea16d339e30ee2b7dc6607d7fdbfaeaaa7 /datarouter-node/src/main/resources/misc | |
parent | 6ec9a9ce6c1062efa99da501fe8c6ea116aebf6f (diff) |
 [DMAAP-48] Initial code import
Change-Id: I3e65371093487d7de167ec6c29f327f366f1e299
Signed-off-by: sg481n <sg481n@att.com>
Diffstat (limited to 'datarouter-node/src/main/resources/misc')
-rw-r--r-- | datarouter-node/src/main/resources/misc/descriptor.xml | 53 | ||||
-rw-r--r-- | datarouter-node/src/main/resources/misc/doaction | 42 | ||||
-rw-r--r-- | datarouter-node/src/main/resources/misc/drtrnode | 114 | ||||
-rw-r--r-- | datarouter-node/src/main/resources/misc/havecert.tmpl | 11 | ||||
-rw-r--r-- | datarouter-node/src/main/resources/misc/log4j.properties.tmpl | 11 | ||||
-rw-r--r-- | datarouter-node/src/main/resources/misc/node.properties | 112 | ||||
-rw-r--r-- | datarouter-node/src/main/resources/misc/notes | 54 |
7 files changed, 397 insertions, 0 deletions
diff --git a/datarouter-node/src/main/resources/misc/descriptor.xml b/datarouter-node/src/main/resources/misc/descriptor.xml new file mode 100644 index 00000000..88fccc19 --- /dev/null +++ b/datarouter-node/src/main/resources/misc/descriptor.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ============LICENSE_START==================================================
+ * org.onap.dmaap
+ * ===========================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ *
+-->
+<descriptor version="1" xmlns="http://aft.att.com/swm/descriptor">
+ <platforms>
+ <platform os="Linux" osVersions="*" architecture="*"/>
+ </platforms>
+ <paths>
+ <path name="/opt/app/datartr" user="datartr" group="datartr" permissions="755,644" recursive="true"/>
+ <path name="/opt/app/platform/init.d/drtrnode" user="datartr" group="datartr" permissions="755"/>
+ </paths>
+ <actions>
+ <action type="INIT">
+ <proc stage="POST" user="datartr" group="datartr"/>
+ </action>
+ <action type="FALL">
+ <proc stage="PRE" user="datartr" group="datartr"/>
+ <proc stage="POST" user="datartr" group="datartr"/>
+ </action>
+ <action type="INST">
+ <proc stage="PRE" user="datartr" group="datartr"/>
+ <proc stage="POST" user="datartr" group="datartr"/>
+ </action>
+ <action type="DINST">
+ <proc stage="PRE" user="datartr" group="datartr"/>
+ </action>
+ </actions>
+ <dependencies>
+ <dependencyFilter componentName="com.att.java:jdk8lin" versions="[1.8.0.77-02]" sequence="1"/>
+ <dependencyFilter componentName="com.att.platform:initd" versions="[1.0.15,)" sequence="2"/>
+ <dependencyFilter componentName="com.att.dmaap.datarouter:util" versions="[1.0.7,)" sequence="3"/>
+ </dependencies>
+</descriptor>
diff --git a/datarouter-node/src/main/resources/misc/doaction b/datarouter-node/src/main/resources/misc/doaction new file mode 100644 index 00000000..617b01d9 --- /dev/null +++ b/datarouter-node/src/main/resources/misc/doaction @@ -0,0 +1,42 @@ +#!/bin/bash + +cd /opt/app/datartr/etc +for action in "$@" +do +case "$action" in +'backup') + cp log4j.properties log4j.properties.save 2>/dev/null + cp node.properties node.properties.save 2>/dev/null + cp havecert havecert.save 2>/dev/null + ;; +'stop') + /opt/app/platform/init.d/drtrnode stop + ;; +'start') + /opt/app/platform/init.d/drtrnode start || exit 1 + ;; +'config') + /bin/bash log4j.properties.tmpl >log4j.properties + /bin/bash node.properties.tmpl >node.properties + /bin/bash havecert.tmpl >havecert + echo "$AFTSWM_ACTION_NEW_VERSION" >VERSION.node + chmod +x havecert + rm -f /opt/app/platform/rc.d/K90drtrnode /opt/app/platform/rc.d/S10drtrnode + ln -s ../init.d/drtrnode /opt/app/platform/rc.d/K90drtrnode + ln -s ../init.d/drtrnode /opt/app/platform/rc.d/S10drtrnode + ;; +'restore') + cp log4j.properties.save log4j.properties 2>/dev/null + cp node.properties.save node.properties 2>/dev/null + cp havecert.save havecert 2>/dev/null + ;; +'clean') + rm -f log4j.properties node.properties havecert log4j.properties.save node.properties.save havecert.save SHUTDOWN redirections.dat VERSION.node + rm -f /opt/app/platform/rc.d/K90drtrnode /opt/app/platform/rc.d/S10drtrnode + ;; +*) + exit 1 + ;; +esac +done +exit 0 diff --git a/datarouter-node/src/main/resources/misc/drtrnode b/datarouter-node/src/main/resources/misc/drtrnode new file mode 100644 index 00000000..ba784f36 --- /dev/null +++ b/datarouter-node/src/main/resources/misc/drtrnode @@ -0,0 +1,114 @@ +#!/bin/bash + +umask 0022 +TZ=GMT0 +export TZ +PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/java/jdk/jdk180/bin +export PATH +CLASSPATH=`echo /opt/app/datartr/etc /opt/app/datartr/lib/*.jar | tr ' ' ':'` +export CLASSPATH + +pids() { + ps -ef | grep java | grep node.NodeMain | sed -e 's/[^ ]* *//' -e 's/ .*//' +} + +start() { + ID=`id -n -u` + GRP=`id -n -g` + if [ "$ID" != "root" ] + then + echo drtrnode must be started as user datartr not $ID + exit 1 + fi + if [ "$GRP" != "datartr" ] + then + echo drtrnode must be started as group datartr not $GRP + exit 1 + fi + cd /opt/app/datartr + if etc/havecert + then + echo >/dev/null + else + echo No certificate file available. Cannot start + exit 0 + fi + PIDS=`pids` + if [ "$PIDS" != "" ] + then + echo drtrnode already running + exit 0 + fi + + mkdir -p /opt/app/datartr/spool/s + chmod 755 /opt/app/datartr/spool/s + + rm -f /opt/app/datartr/etc/SHUTDOWN + nohup java com.att.research.datarouter.node.NodeMain </dev/null >/dev/null 2>&1 & + sleep 5 + PIDS=`pids` + if [ "$PIDS" = "" ] + then + echo drtrnode startup failed + else + echo drtrnode started + fi +} + +stop() { + ID=`id -n -u` + GRP=`id -n -g` + if [ "$ID" != "datartr" ] + then + echo drtrnode must be stopped as user datartr not $ID + exit 1 + fi + if [ "$GRP" != "datartr" ] + then + echo drtrnode must be stopped as group datartr not $GRP + exit 1 + fi + touch /opt/app/datartr/etc/SHUTDOWN + PIDS=`pids` + if [ "$PIDS" != "" ] + then + sleep 5 + kill -9 $PIDS + sleep 5 + echo drtrnode stopped + else + echo drtrnode not running + fi +} + +status() { + PIDS=`pids` + if [ "$PIDS" != "" ] + then + echo drtrnode running + else + echo drtrnode not running + fi +} + +case "$1" in +'start') + start + ;; +'stop') + stop + ;; +'restart') + stop + sleep 20 + start + ;; +'status') + status + ;; +*) + echo "Usage: $0 { start | stop | restart }" + exit 1 + ;; +esac +exit 0 diff --git a/datarouter-node/src/main/resources/misc/havecert.tmpl b/datarouter-node/src/main/resources/misc/havecert.tmpl new file mode 100644 index 00000000..2e813ba3 --- /dev/null +++ b/datarouter-node/src/main/resources/misc/havecert.tmpl @@ -0,0 +1,11 @@ +#!/bin/bash +cat <<!EOF +TZ=GMT0 +cd /opt/app/datartr; +if [ -f ${DRTR_NODE_KSTOREFILE:-etc/keystore} ] +then + exit 0 +fi +echo `date '+%F %T,000'` WARN Certificate file "${DRTR_NODE_KSTOREFILE:-etc/keystore}" is missing >>${DRTR_NODE_LOGS:-logs}/node.log +exit 1 +!EOF diff --git a/datarouter-node/src/main/resources/misc/log4j.properties.tmpl b/datarouter-node/src/main/resources/misc/log4j.properties.tmpl new file mode 100644 index 00000000..24bd3df0 --- /dev/null +++ b/datarouter-node/src/main/resources/misc/log4j.properties.tmpl @@ -0,0 +1,11 @@ +cat <<!EOF +log4j.debug=FALSE +log4j.rootLogger=INFO,Root + +log4j.appender.Root=org.apache.log4j.DailyRollingFileAppender +log4j.appender.Root.file=${DRTR_NODE_LOGS:-logs}/node.log +log4j.appender.Root.datePattern='.'yyyyMMdd +log4j.appender.Root.append=true +log4j.appender.Root.layout=org.apache.log4j.PatternLayout +log4j.appender.Root.layout.ConversionPattern=%d %p %m%n +!EOF diff --git a/datarouter-node/src/main/resources/misc/node.properties b/datarouter-node/src/main/resources/misc/node.properties new file mode 100644 index 00000000..fb97702f --- /dev/null +++ b/datarouter-node/src/main/resources/misc/node.properties @@ -0,0 +1,112 @@ +#-------------------------------------------------------------------------------
+# ============LICENSE_START==================================================
+# * org.onap.dmaap
+# * ===========================================================================
+# * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# * ===========================================================================
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# * http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# * ============LICENSE_END====================================================
+# *
+# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+# *
+#-------------------------------------------------------------------------------
+#
+# Configuration parameters fixed at startup for the DataRouter node
+#
+# URL to retrieve dynamic configuration
+#
+#ProvisioningURL: ${DRTR_PROV_INTURL}
+ProvisioningURL=https://prov.datarouternew.com:8443/internal/prov
+
+#
+# URL to upload PUB/DEL/EXP logs
+#
+#LogUploadURL: ${DRTR_LOG_URL}
+LogUploadURL=https://prov.datarouternew.com:8443/internal/logs
+
+#
+# The port number for http as seen within the server
+#
+#IntHttpPort: ${DRTR_NODE_INTHTTPPORT:-8080}
+IntHttpPort=8080
+#
+# The port number for https as seen within the server
+#
+IntHttpsPort=8443
+#
+# The external port number for https taking port mapping into account
+#
+ExtHttpsPort=443
+#
+# The minimum interval between fetches of the dynamic configuration
+# from the provisioning server
+#
+MinProvFetchInterval=10000
+#
+# The minimum interval between saves of the redirection data file
+#
+MinRedirSaveInterval=10000
+#
+# The path to the directory where log files are stored
+#
+LogDir=/opt/app/datartr/logs
+#
+# The retention interval (in days) for log files
+#
+LogRetention=30
+#
+# The path to the directories where data and meta data files are stored
+#
+SpoolDir=/opt/app/datartr/spool
+#
+# The path to the redirection data file
+#
+#RedirectionFile: etc/redirections.dat
+#
+# The type of keystore for https
+#
+KeyStoreType: jks
+#
+# The path to the keystore for https
+#
+KeyStoreFile:/opt/app/datartr/self_signed/keystore.jks
+#
+# The password for the https keystore
+#
+KeyStorePassword=changeit
+#
+# The password for the private key in the https keystore
+#
+KeyPassword=changeit
+#
+# The type of truststore for https
+#
+TrustStoreType=jks
+#
+# The path to the truststore for https
+#
+#TrustStoreFile=/usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts
+TrustStoreFile=/opt/app/datartr/self_signed/cacerts.jks
+#
+# The password for the https truststore
+#
+TrustStorePassword=changeit
+#
+# The path to the file used to trigger an orderly shutdown
+#
+QuiesceFile=etc/SHUTDOWN
+#
+# The key used to generate passwords for node to node transfers
+#
+NodeAuthKey=Node123!
+
diff --git a/datarouter-node/src/main/resources/misc/notes b/datarouter-node/src/main/resources/misc/notes new file mode 100644 index 00000000..f37a8ea2 --- /dev/null +++ b/datarouter-node/src/main/resources/misc/notes @@ -0,0 +1,54 @@ +package notes for com.att.dmaap.datarouter:node + +This component is for the Data Router Node software. + +The following pre-requisite components should already be present: + com.att.aft.swm:swm-cli + com.att.aft.swm:swm-node + - SWM Variables: AFTSWM_AUTOLINK_PARENTS=/opt/app:/opt/app/workload,/opt/app/aft:/opt/app/workload/aft + com.att.platform:uam-auto + com.att.java:jdk8lin + com.att.platform:initd + com.att.platform:port-fwd + - SWM Variables: PLATFORM_PORT_FWD=80,8080|443,8443 + com.att.dmaap.datarouter:util + +In a non-production environment, the URL for fetching provisioning data from +the provisioning server must be overridden. This can be done by setting a SWM +variable prior to installing this component. The production (default) value for +this variable is: + DRTR_PROV_INTURL=https://feeds-drtr.web.att.com/internal/prov + +Similarly, the URL for uploading event logs to the log server must be overridden. This can also be done by setting a SWM variable. The production (default) value is: + DRTR_LOG_URL=https://feeds-drtr.web.att.com/internal/logs + +Other SWM variables that can be set are: + +DRTR_NODE_INTHTTPPORT (default 8080) + The TCP/IP port number the component should listen on for "go fetch" + requests from the provisioning server +DRTR_NODE_INTHTTPSPORT (default 8443) + The TCP/IP port number the component should listen on for publish + requests from feed publishers and other nodes +DRTR_NODE_EXTHTTPSPORT (default 443) + The TCP/IP port number the component should use for node-to-node + transfers and for sending redirect requests back to publishers +DRTR_NODE_SPOOL (default /opt/app/datartr/spool) + The directory where data files should be saved while in transit +DRTR_NODE_LOGS (default /opt/app/datartr/logs) + The directory where log files should be kept +DRTR_NODE_LOG_RETENTION (default 30) + How long a log file is kept before being deleted +DRTR_NODE_KSTOREFILE (default /opt/app/datartr/etc/keystore) + The java keystore file containing the server certificate and private key + for this server +DRTR_NODE_KSTOREPASS (default changeit) + The password for the keystore file +DRTR_NODE_PVTKEYPASS (default changeit) + The password for the private key in the keystore file +DRTR_NODE_TSTOREFILE (by default, use the truststore from the Java JDK) + The java keystore file containing the trusted certificate authority + certificates +DRTR_NODE_TSTOREPASS (default changeit) + The password for the trust store file. Only applies if a trust store + file is specified. |