Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-8051

The newts script only works if cassandra runs on localhost

    XMLWordPrintable

    Details

      Description

      When running "newts init" after properly configure org.opennms.newts.config.hostname on opennms.properties, the tool ignore that setting and assume that cassandra is running on the same machine (i.e. localhost):

      [root@onms17srv bin]# ./newts init
      Initializing the 'newts' keyspaces on localhost:9042
      21:46:12.193 [Main] INFO  com.datastax.driver.core.NettyUtil - Did not find Netty's native epoll transport in the classpath, defaulting to NIO.
      java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:497)
          at org.opennms.bootstrap.Bootstrap$3.run(Bootstrap.java:373)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] Cannot connect))
          at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:223)
          at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78)
          at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1272)
          at com.datastax.driver.core.Cluster.init(Cluster.java:158)
          at com.datastax.driver.core.Cluster.connect(Cluster.java:248)
          at org.opennms.newts.cassandra.SchemaManager.<init>(SchemaManager.java:47)
          at org.opennms.netmgt.newts.cli.Init.execute(Init.java:47)
          at org.opennms.netmgt.newts.cli.Newts.main(Newts.java:56)
          ... 6 more
      [root@onms17srv bin]# grep "newts.*hostname" /opt/opennms/etc/opennms.properties 
      org.opennms.newts.config.hostname=cassandrasrv01
      

      Current workaround is to edit the script and force the settings, for example:

      exec "$OPENNMS_BINDIR"/runjava -r -- $JAVA_OPTIONS \
              -Dorg.opennms.newts.config.hostname=cassandrasrv01 \
              -Dopennms.home="$OPENNMS_HOME" \
              -Dlog4j.configurationFile="$OPENNMS_HOME"/etc/log4j2-tools.xml \
              -Dopennms.manager.class="$APP_CLASS" \
              -jar "$OPENNMS_HOME"/lib/opennms_bootstrap.jar \
              "$@"
      

        Attachments

          Activity

            People

            • Assignee:
              j-white Jesse White
              Reporter:
              agalue Alejandro Galue
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: