You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by GitBox <gi...@apache.org> on 2019/12/03 09:21:01 UTC
[GitHub] [metron] anandsubbu commented on a change in pull request #1572:
METRON-2327 - Support for SOLR time-based arrays
anandsubbu commented on a change in pull request #1572: METRON-2327 - Support for SOLR time-based arrays
URL: https://github.com/apache/metron/pull/1572#discussion_r353061141
##########
File path: metron-platform/metron-solr/metron-solr-common/src/main/scripts/create_configset.sh
##########
@@ -0,0 +1,54 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+METRON_VERSION=${project.version}
+METRON_HOME=/usr/metron/$METRON_VERSION
+ZOOKEEPER=${ZOOKEEPER:-localhost:2181}
+ZOOKEEPER_HOME=${ZOOKEEPER_HOME:-/usr/hdp/current/zookeeper-client}
+SECURITY_ENABLED=${SECURITY_ENABLED:-false}
+NEGOTIATE=''
+if [ ${SECURITY_ENABLED,,} == 'true' ]; then
+ NEGOTIATE=' --negotiate -u : '
+fi
+
+# test for errors in SOLR URL
+if [[ ${SOLR_NODE} =~ .*:null ]]; then
+ echo "Error occurred while attempting to read SOLR Cloud configuration data from Zookeeper.";
+ if ! [[ ${ZOOKEEPER} =~ .*/solr ]]; then
+ echo "Warning! Environment variable ZOOKEEPER=$ZOOKEEPER does not contain a chrooted zookeeper ensemble address - are you sure you do not mean ZOOKEEPER=$ZOOKEEPER/solr?";
+ fi
+ exit 1;
+fi
+
+
+# test for presence of datetime field in schema collection
+DQT='"'
+DATETIME_SCHEMA="<field name=${DQT}datetime${DQT} type=${DQT}datetime${DQT}"
+grep --quiet --fixed-strings $DATETIME_SCHEMA $METRON_HOME/config/schema/$1/schema.xml; rc=$?
Review comment:
I see this when I run the `create_configset` script...
```
[root@solrtra-5 schema]# pwd
/usr/metron/0.7.2/config/schema
[root@solrtra-5 schema]# ../../bin/create_configset.sh bro1
grep: name="datetime": No such file or directory
grep: type="datetime": No such file or directory
adding: solrconfig.xml (deflated 72%)
adding: schema.xml (deflated 88%)
{
"responseHeader":{
"status":0,
"QTime":96}}
Configset bro1 successfully uploaded
```
Looks like the regex pattern needs fixing?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services