OpenNMS Service will not start - Error reading JAVA SDK 10.0.2 - opennms

OpenNMS thinks SDK 10.0.2 is not newer then 1.0.8
Help!
Starting OpenNMS: runjava: /usr/java/jdk-10.0.2/bin/java is not Java 1.8 or newer.
Aug 17 08:05:37 localhost.localdomain opennms[12690]: runjava: error: bad version or vendor for configured Java runtime environment
Aug 17 08:05:37 localhost.localdomain opennms[12690]: runjava: "/usr/java/jdk-10.0.2/bin/java -version" does not report that is version 1.8+ and a compatible JDK.
Aug 17 08:05:37 localhost.localdomain opennms[12690]: runjava: run "/opt/opennms/bin/runjava -s" to setup java.conf
Aug 17 08:05:37 localhost.localdomain opennms[12690]: Unknown value return from doStatus: 1
Aug 17 08:05:37 localhost.localdomain opennms[12690]: [FAILED]
Aug 17 08:05:37 localhost.localdomain systemd[1]: opennms.service: control process exited, code=exited status=1
Aug 17 08:05:37 localhost.localdomain systemd[1]: Failed to start OpenNMS server.
-- Subject: Unit opennms.service has failed
-- Defined-By: systemd
[root#localhost bin]# runjava -s
runjava: Looking for an appropriate JRE...
runjava: Checking for an appropriate JRE in JAVA_HOME...
runjava: /usr/java/jdk-10.0.2/bin/java is not Java 1.8 or newer.
runjava: "/usr/java/jdk-10.0.2/bin/java" is not an appropriate JRE
runjava: Checking JRE in user's path: "/bin/java"...
runjava: /bin/java is not Java 1.8 or newer.
runjava: did not find an appropriate JRE in user's path: "/bin/java"
runjava: searching for a good JRE...
WARNING: unsure how to handle Java version output: java version "10.0.2" 2018-07-17
runjava: found a good JRE in "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64/jre/bin/java"
runjava: value of "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64/jre/bin/java" stored in configuration file

It is currently just possible to run OpenNMS Horizon with Java 8. You can set a specific JDK instead of detecting one using ${OPENNMS_HOME}/bin/runjava -s path/to/jdk or modifying the path to the java binary in the configuration file ${OPENNMS_HOME}/etc/java.conf.

I installed OpenNMS 1.3 on my Linux Ubuntu 18LTS, but it didn't finish install and the service didn't start because OpenJDK was being used (OpenJDK was already installed in the system). It seems that only Java8 is supported.
In order to get it working, I installed Java8 JDK in a non default directory, then modified '/usr/share/opennms/bin/runjava' (set JB="/path_to_java8/java", and added this path inside /usr/share/opennms/etc/java.conf. Only after those changes, '/usr/share/opennms/bin/install -dis' did run successfully .
The last step, before enabling the opennms service, is setting the JAVA_PATH variable in '/etc/default/opennms' .

Related

elasticsearch not started on macOS

When I try to start elasticsearch on my macOS laptop, it does not appear to have started. So much of the answers I find on the internet do not relate to using brew on macOS.
See this command line history of trying to start it.
:>brew services stop elasticsearch
Stopping `elasticsearch`... (might take a while)
==> Successfully stopped `elasticsearch` (label: homebrew.mxcl.elasticsearch)
:>brew services start elasticsearch
==> Successfully started `elasticsearch` (label: homebrew.mxcl.elasticsearch)
:>curl http://localhost:9200
curl: (7) Failed to connect to localhost port 9200: Connection refused
:>curl https://localhost:9200
curl: (7) Failed to connect to localhost port 9200: Connection refused
:>lsof -i :9200
:>sudo ps -ef | grep elastic
501 85360 68989 0 9:51AM ttys000 0:00.00 grep elastic
Also using the Network Utility I see nothing is listening at the port 9200.
I am using Catalina Version 10.15.7 (19H1030).
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
My elasticsearch version is
Version: 6.0.1, Build: 601be4a/2017-12-04T09:29:09.525Z, JVM: 1.8.0_121
The location of the binary on my PATH is /usr/local/bin/elasticsearch
EDIT:
There was a comment to include any error messages or the output. If this was not clear, what I wrote is the only output. The only output to stdout or stderr from brew services start elasticsearch is "Successfully started elasticsearch".
However, when trying elasticsearch -d from the command line I get this:
:>elasticsearch
2021-05-24 09:33:08,875 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
at org.apache.logging.log4j.core.jmx.Server.register(Server.java:389)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:167)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:556)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:206)
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:220)
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:197)
at org.elasticsearch.common.logging.LogConfigurator.configureStatusLogger(LogConfigurator.java:172)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:141)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:120)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:290)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:130)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:121)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:69)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85)
ERROR: no log4j2.properties found; tried [/usr/local/etc/elasticsearch] and its subdirectories
The /usr/local/etc/elasticsearch directory exists but is empty.
:>ls -l /usr/local/etc
...
drwxr-xr-x 2 marlpier admin 64 May 19 16:30 elasticsearch
...
:>find /usr/local/etc/elasticsearch
/usr/local/etc/elasticsearch
Maybe my jvm.options file is not found. Where should it be?
Answer was that brew reinstall elasticsearch was not working.
Doing brew uninstall elasticsearch gave a java error. So to uninstall java, brew uninstall java also gave a java error.
Answer to uninstall java was here by removing the java directory.
After that I was able to uninstall elasticsearch and then install it again with brew. Now it works.

Elastic Search 6.x Keeps Failing

(New on forums like this so bare with me lol)
Anyways Just wondered if someone can help me, I've installed Elasticsearch 6.8.9 through the DEB package and have installed the Elasticsearch head through GitHub. I've done the following after doing research but for some reason ElasticSearch exits after it starts so it's not running properly. It was running fine on ElasticSearch 2.4 but since the head requires 5.x through GitHub, I've been struggling really bad to get it working. I tried to install it through
sudo apt-get install elasticsearch
And these apt-get install scripts as well:
sudo apt-get install openjdk-8-jdk openjdk-8-jre-headless
but wasn't working properly either. Any advice would be appreciated. Many thanks:
/etc/elasticsearch/jvm.options
# Reduce RAM heap size to 128MB (was 1GB)
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
-Xms128m
-Xmx128m
/etc/elasticsearch/elasticsearch.yml
# Set network.host to 0.0.0.0
network.host: 0.0.0.0
sudo nano /etc/environment
# Set JAVA_HOME to target Java8 instead of Java11
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-armhf/bin/java"
sudo update-alternatives --config java
(Selected option 2, pressed enter and no problem there)
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-armhf/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-armhf/bin/java 1111 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java 1081 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
source /etc/environment
echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java
java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b01-1+rpi1-b01)
OpenJDK Client VM (build 25.212-b01, mixed mode)
I've even done this command through the /usr/share/elasticsearch folder
wget -qO - https://artifacts.elastic.co/GPG-KEY- **elasticsearch** | sudo apt-key add -
But this is the ultimate result that I keep getting. I tried to look through the logs for any specific errors but can't filter it. Running a Raspberry Pi 3.
**●** elasticsearch.service - ElasticsearchLoaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: **failed** (Result: exit-code) since Sat 2020-07-04 15:48:04 BST; 20h ago
Docs: http://www.elastic.co
Process: 1066 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet **(code=exited, status=1/FAILURE)**
Main PID: 1066 (code=exited, status=1/FAILURE)
Jul 04 15:47:03 raspberrypi systemd[1]: Started Elasticsearch.
Jul 04 15:47:03 raspberrypi elasticsearch[1066]: warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME
Jul 04 15:48:04 raspberrypi systemd[1]: **elasticsearch.service: Main process exited, code=exited, status=1/FAILURE**
Jul 04 15:48:04 raspberrypi systemd[1]: **elasticsearch.service: Failed with result 'exit-code'.****~**
I assume there's nothing in the ES logs itself (probably something like /var/log/elasticsearch/)?
Otherwise, do you have any existing indices? ES 6 is not compatible with indices from ES 2.X or before, see here.
If you have existing indexes and want to use ES6, you would have to upgrade to ES5, reindex your data, and then upgrade to ES6.

Unable to connect local slave to Jenkins master on AWS

I've set-up a Jenkins on AWS ec2 instance. I have a few machines with me (Ubuntu, Mac) which are supposed to be the slaves.
I've configured the nodes on my Jenkins master and I'm trying to connect the slaves using JNLP-4 protocol via random ports.
I've enabled the Security, Selected the TCP Ports for agents as Random, Enable CLI over remoting, Enable Agent -> Master Access control.
After doing all these, when I try to connect I get the following error:
Vighneshs-MBP:Downloads vighneshpai$ java -jar agent.jar -jnlpUrl https://my.host.name/computer/Mac/slave-agent.jnlp -secret cf400d1a4e0a1dcc75da2b361efafbce3321e17b935bdcf14350a36e
Oct 11, 2018 8:43:50 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: Mac
Oct 11, 2018 8:43:50 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Oct 11, 2018 8:43:50 PM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 3.25
Oct 11, 2018 8:43:50 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using /Users/vighneshpai/Downloads/remoting as a remoting work directory
Both error and output logs will be printed to /Users/vighneshpai/Downloads/remoting
Oct 11, 2018 8:43:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [https://my.host.name/]
Oct 11, 2018 8:43:51 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, JNLP-connect, Ping, JNLP2-connect, JNLP3-connect]
Oct 11, 2018 8:43:56 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver isPortVisible
WARNING: connect timed out
Oct 11, 2018 8:43:56 PM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: https://my.host.name/ provided port:49187 is not reachable
java.io.IOException: https://my.host.name/ provided port:49187 is not reachable
at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:286)
at hudson.remoting.Engine.innerRun(Engine.java:523)
at hudson.remoting.Engine.run(Engine.java:474)
I've also tried using a Fixed port and add the port to the allowed list of ports for Inbound access. Still not able to connect.
Same machines, without any problem connected to the Jenkins running on local machine.
What could be the problem?
Setting the property -Dhudson.TcpSlaveAgentListener.hostName in /etc/default/jenkins resolved my problem.
Changing the port to Fixed instead of random and allowing that particular port in the aws as an exception with TCP, resolved this.
If you've setup http_proxy/https_proxy in the environment variables (and it's a proxy which jenkins doesn't like)) then that too will throw this cryptic error.
Since your Jenkins AWS instance is behind a firewall your slaves won't be able to connect using your given port (49187) if the port itself is not open.
Simply;
Add a security group on AWS console, allowing connections on the port (49187 in this case) for your slave IP address(es).
p.s: If it were to be a random Jenkins machine, a simple sudo ufw allow 49187 should suffice:)
If not a firewall issue, make sure that the setting "Dhudson.TcpSlaveAgentListener.hostName" is set when running the Jenkins to the FQDN of the Jenkins master, or a partial record that the agent can reach for sure.
In our case this wasn't configured as the FQDN and the slave could not reach the record.
My issue was resolved after I performed a Jenkins server restart using the URL
https://JenkinsURL/restart
Or
https://JenkinsURL/SafeRestart

Tomcat Connectors (mod_jk) make error

I'm trying to install Tomcat Connectors (mod_jk) on my Mac and I'm following the instructions from the following sites.
http://pablotips.blogspot.com/2015/01/compiling-modjk-on-mac-os-x-1010.html
https://www.bartbusschots.ie/s/2009/05/05/installing-mod_jk-for-apache-22-on-mac-os-x-105-leopard/
I get the following error when I run the make process.
Q.1 How can I fix this error and compile the make process?
Q.2 Will this help me serve my files from the default apache /Sites directory using Tomcat server?
find apr_lib.h
$ sudo find / -name "apr_lib.h"
add lib
LDFLAGS='-L[path]' CFLAGS='-I[path]'
$ ./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64' LDFLAGS='-L/usr/include/apr-1' CFLAGS='-I/usr/include/apr-1' --with-apxs=/usr/sbin/apxs
When you are starting Tomcat you are seeing following error as well:
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path
The APR is Apache Tomcat Native library which allows optimal performance in production environments.
Prerequisites for installing APR
APR library
APR-util library
OpenSSL library
Download it from this link http://apr.apache.org/download.cgi and integrate to Tomcat. This will fix your problem
When you installed and integrated then when you restart Tomcat server. You will see like following:
After restarting the Tomcat service, we can get the following message
in catalina.out log if APR was installed successfully.
------------ Oct 07, 2015 8:08:54 AM org.apache.catalina.core.AprLifecycleListener init INFO: Loaded APR
based Apache Tomcat Native library 1.1.29 using APR version 1.5.2. Oct
07, 2015 8:08:54 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
[false], random [true].
Let me know if you need more help from my end

mongod runs but only outputs all output going to path and that's it

I am completely lost at the moment and would greatly appreciate your assistance. I installed mongoDB through Homebrew and created a data/db directory on my hardrive at the root. Everything seemed fine so far. I then proceeded to run mongod and I was met with the following :
all output going to: /usr/local/var/log/mongodb/mongo.log
Here is the contents of the log file (the latest section of it) on my last run:
Wed Sep 26 18:46:19 [initandlisten] MongoDB starting : pid=7720 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=Notionworks-MacBook-Pro.local
Wed Sep 26 18:46:19 [initandlisten]
Wed Sep 26 18:46:19 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Wed Sep 26 18:46:19 [initandlisten] db version v2.2.0, pdfile version 4.5
Wed Sep 26 18:46:19 [initandlisten] git version: f5e83eae9cfbec7fb7a071321928f00d1b0c5207
Wed Sep 26 18:46:19 [initandlisten] build info: Darwin bs-osx-106-x86-64-1.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_49
Wed Sep 26 18:46:19 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/usr/local/etc/mongod.conf", dbpath: "/usr/local/var/mongodb", logappend: "true", logpath: "/usr/local/var/log/mongodb/mongo.log" }
Wed Sep 26 18:46:19 [initandlisten] journal dir=/usr/local/var/mongodb/journal
Wed Sep 26 18:46:19 [initandlisten] recover : no journal files present, no recovery needed
Wed Sep 26 18:46:19 [websvr] admin web console waiting for connections on port 28017
Wed Sep 26 18:46:19 [initandlisten] waiting for connections on port 27017
As far as I can tell, everything looks like it is running correctly (however I don't really know what I'm looking at). The only thing that seems amis is the dbpath, which according to the documentation defaults to /data/db/
Any help would be greatly appreciated!
EDIT:
Sorry I forgot to mention that I did try to run mongo after running mongod. Here's the code:
Notionworks-MacBook-Pro:locomotivecms Notionwork$ mongod
all output going to: /usr/local/var/log/mongodb/mongo.log
mongo
db.test.save( { a: 1} )
db.test.find()
Does this look normal to you? It doesn't return anything...
UPDATE:
Solved it! I was being silly and trying to enter the command mongo in the same terminal window. I did not realize that you had to open a new window in order to run it. There was no mention of having to open a new window in mongoDB's set-up tutorial, and I didn't put two and two together. I was confounded, as I thought that mongoDB was just sitting there thinking... It works great now! All I have to figure out now is how to change mongoDB's default path permanently so that I wont have to change it every time with -- dbpath. Right now it defaults to usr/local/var/mongodb. I just have to find the config file and change that if possible... Just found it in the log! Yay! I'll see if I can change it! Thanks again for your prompt replies!
The you need to change the limit of your files which is 266 right now.
** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Enter the following in the command-line to change it:
ulimit -n 1000
You might get maxproc error which changing it, you can find out more on this post
If you want to start playing around with that instance just type
mongo
in a new terminal or run mongod with --fork
Type mongo in the new terminal.

Resources