You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by fg...@apache.org on 2019/03/20 22:55:39 UTC

[incubator-sdap-nexus] branch master updated: SDAP-187 Unable to change cassandra port (#66)

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

fgreg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git


The following commit(s) were added to refs/heads/master by this push:
     new 49d7d43  SDAP-187 Unable to change cassandra port (#66)
49d7d43 is described below

commit 49d7d43ea6c64e2d3055ab9af4ba07b948bbd2e1
Author: twnone <an...@gmail.com>
AuthorDate: Wed Mar 20 23:55:35 2019 +0100

    SDAP-187 Unable to change cassandra port (#66)
    
    * SDAP-187 webapp : Impossible to change Cassandra cluster CQL port
    
    * SDAP-187 : fix typo
---
 analysis/webservice/algorithms/doms/DomsInitialization.py | 3 ++-
 analysis/webservice/algorithms/doms/domsconfig.ini        | 1 +
 data-access/nexustiles/config/datastores.ini              | 3 ++-
 docker/nexus-webapp/standalone/docker-entrypoint.sh       | 2 ++
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/analysis/webservice/algorithms/doms/DomsInitialization.py b/analysis/webservice/algorithms/doms/DomsInitialization.py
index 0afe01d..21832c1 100644
--- a/analysis/webservice/algorithms/doms/DomsInitialization.py
+++ b/analysis/webservice/algorithms/doms/DomsInitialization.py
@@ -38,6 +38,7 @@ class DomsInitializer:
         domsconfig.readfp(pkg_resources.resource_stream(__name__, "domsconfig.ini"), filename='domsconfig.ini')
 
         cassHost = domsconfig.get("cassandra", "host")
+        cassPort = domsconfig.get("cassandra", "port")
         cassKeyspace = domsconfig.get("cassandra", "keyspace")
         cassDatacenter = domsconfig.get("cassandra", "local_datacenter")
         cassVersion = int(domsconfig.get("cassandra", "protocol_version"))
@@ -50,7 +51,7 @@ class DomsInitializer:
         dc_policy = DCAwareRoundRobinPolicy(cassDatacenter)
         token_policy = TokenAwarePolicy(dc_policy)
 
-        with Cluster([host for host in cassHost.split(',')], load_balancing_policy=token_policy,
+        with Cluster([host for host in cassHost.split(',')], port=cassPort, load_balancing_policy=token_policy,
                      protocol_version=cassVersion) as cluster:
             session = cluster.connect()
 
diff --git a/analysis/webservice/algorithms/doms/domsconfig.ini b/analysis/webservice/algorithms/doms/domsconfig.ini
index 6e113c3..06ddf7d 100644
--- a/analysis/webservice/algorithms/doms/domsconfig.ini
+++ b/analysis/webservice/algorithms/doms/domsconfig.ini
@@ -1,5 +1,6 @@
 [cassandra]
 host=127.0.0.1
+port=9042
 keyspace=doms
 local_datacenter=datacenter1
 protocol_version=3
diff --git a/data-access/nexustiles/config/datastores.ini b/data-access/nexustiles/config/datastores.ini
index 7c1c82e..a1959bd 100644
--- a/data-access/nexustiles/config/datastores.ini
+++ b/data-access/nexustiles/config/datastores.ini
@@ -1,5 +1,6 @@
 [cassandra]
 host=127.0.0.1
+port=9042
 keyspace=nexustiles
 local_datacenter=datacenter1
 protocol_version=3
@@ -17,4 +18,4 @@ host=localhost:8983
 core=nexustiles
 
 [datastore]
-store=cassandra
\ No newline at end of file
+store=cassandra
diff --git a/docker/nexus-webapp/standalone/docker-entrypoint.sh b/docker/nexus-webapp/standalone/docker-entrypoint.sh
index 0589fb2..8db7246 100755
--- a/docker/nexus-webapp/standalone/docker-entrypoint.sh
+++ b/docker/nexus-webapp/standalone/docker-entrypoint.sh
@@ -21,12 +21,14 @@ if [ -n "$TORNADO_HOST" ]; then
   sed -i "s/server.socket_host = .*/server.socket_host = '${TORNADO_HOST}'/g" ${NEXUS_SRC}/analysis/webservice/config/web.ini
 fi
 sed -i "s/host=127.0.0.1/host=$CASSANDRA_CONTACT_POINTS/g" ${NEXUS_SRC}/data-access/nexustiles/config/datastores.ini && \
+sed -i "s/port=9042/port=$CASSANDRA_PORT/g" ${NEXUS_SRC}/data-access/nexustiles/config/datastores.ini && \
 sed -i "s/local_datacenter=.*/local_datacenter=$CASSANDRA_LOCAL_DATACENTER/g" ${NEXUS_SRC}/data-access/nexustiles/config/datastores.ini && \
 sed -i "s/host=localhost:8983/host=$SOLR_URL_PORT/g" ${NEXUS_SRC}/data-access/nexustiles/config/datastores.ini
 
 # DOMS
 sed -i "s/module_dirs=.*/module_dirs=webservice.algorithms,webservice.algorithms_spark,webservice.algorithms.doms/g" ${NEXUS_SRC}/analysis/webservice/config/web.ini && \
 sed -i "s/host=.*/host=$CASSANDRA_CONTACT_POINTS/g" ${NEXUS_SRC}/analysis/webservice/algorithms/doms/domsconfig.ini && \
+sed -i "s/port=.*/port=$CASSANDRA_PORT/g" ${NEXUS_SRC}/analysis/webservice/algorithms/doms/domsconfig.ini && \
 sed -i "s/local_datacenter=.*/local_datacenter=$CASSANDRA_LOCAL_DATACENTER/g" ${NEXUS_SRC}/analysis/webservice/algorithms/doms/domsconfig.ini
 
 cd ${NEXUS_SRC}/data-access