'org.apache.nifi.bootstrap.Command Apache NiFi is not running

Nifi is not starting. When I run ./nifi.sh status it gives the error like,

org.apache.nifi.bootstrap.Command Apache NiFi is not running

I am getting below error in log nifi-app.log file:

2016-12-21 11:54:30,653 INFO [main] o.a.nifi.properties.NiFiPropertiesLoader Determined default nifi.properties path to be '/root/HDF-2.0.0.0/nifi/./conf/nifi.properties'
2016-12-21 11:54:30,663 INFO [main] o.a.nifi.properties.NiFiPropertiesLoader Loaded 121 properties from /root/HDF-2.0.0.0/nifi/./conf/nifi.properties
2016-12-21 11:54:30,674 INFO [main] org.apache.nifi.NiFi Loaded 121 properties
2016-12-21 11:54:30,681 INFO [main] org.apache.nifi.BootstrapListener Started Bootstrap Listener, Listening for incoming requests on port 39604
2016-12-21 11:54:30,692 ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi due to java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_101]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_101]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_101]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_101]
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_101]
    at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_101]
    at java.net.Socket.connect(Socket.java:538) ~[na:1.8.0_101]
    at org.apache.nifi.BootstrapListener.sendCommand(BootstrapListener.java:100) ~[nifi-runtime-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
    at org.apache.nifi.BootstrapListener.start(BootstrapListener.java:83) ~[nifi-runtime-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
    at org.apache.nifi.NiFi.<init>(NiFi.java:102) ~[nifi-runtime-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
    at org.apache.nifi.NiFi.main(NiFi.java:262) ~[nifi-runtime-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2]
2016-12-21 11:54:30,694 INFO [Thread-1] org.apache.nifi.NiFi Initiating shutdown of Jetty web server...
2016-12-21 11:54:30,695 INFO [Thread-1] org.apache.nifi.NiFi Jetty web server shutdown completed (nicely or otherwise).
2016-12-21 11:57:07,288 INFO [main] org.apache.nifi.NiFi Launching NiFi...


Solution 1:[1]

Check and kill running processes which are already using same port with Nifi.

Solution 2:[2]

for me, using openjdk 8 instead of 9 works.

Solution 3:[3]

Maybe you need to restart your CPU after unzip the downloaded file and run it for a first time, I had the same issue

Solution 4:[4]

Go to the nifi folder and check under bin folder nifi.sh is there or not and run below command in linux because you are running on linux machine not windows so don't run batch file here.

bin/nifi.sh start

bin/nifi.sh status

bin/nifi.sh stop.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Onur Tekir
Solution 2 echo
Solution 3 Juan Paco Hernandez
Solution 4 khushbu kanojia