Problems starting zookeeper - java

I face a strange problem while starting zookeeper. Everytime I start zookeeper, it is getting started but it is getting bound to the port as a process that I am able to restart it again. Following is my zoo.cfg file
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/zookeeper
clientPort=2181
Also when I try connecting and executing zoo keeper commands through my java file, I get the below error
15/07/20 12:27:46 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
15/07/20 12:27:46 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
java.lang.RuntimeException: error in updating node :/testnode/test result : CONNECTION_LOSS
So can someone explain me why is it trying to re-connect and help me sort this error out ?

This occurred because my java home was not exported correctly. It was pointed to the bin inside jdk directory which should not be the case. So after exporting java home to the root directory of jdk solved the issue

Related

Netbeans Debugging with Tomcat Connection Refused

I am using Netbeans 8.2 with the Java EE Base 1.31.1 and EJB and EAR 1.27.1 plugins installed. I installed Tomcat 9.0.4 and added it as a server to Netbeans. Netbeans can successfully start the tomcat server and launch my web app, but it will not debug. When I attempt to debug my webapp, I get the following error in my webapp log:
ant -f /Users/jryan/JDev/SVN/trunk/Java/CollaborationServer -Dnb.internal.action.name=debug -Ddirectory.deployment.supported=true -DforceRedeploy=false -Dnb.wait.for.caches=true -Dbrowser.context=/Users/jryan/JDev/SVN/trunk/Java/CollaborationServer debug
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
debug:
Stopping Tomcat process...
Waiting for Tomcat...
Tomcat server stopped.
Starting Tomcat process...
Waiting for Tomcat...
Tomcat server started.
connect-debugger:
/Users/jryan/JDev/SVN/trunk/Java/CollaborationServer/nbproject/build-impl.xml:1206: The following error occurred while executing this line:
/Users/jryan/JDev/SVN/trunk/Java/CollaborationServer/nbproject/build-impl.xml:1216:
org.netbeans.api.debugger.jpda.DebuggerStartException: Connection refused (Connection refused)
at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.waitRunning(JPDADebuggerImpl.java:405)
at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.waitRunning(JPDADebuggerImpl.java:387)
at org.netbeans.api.debugger.jpda.JPDADebugger.attach(JPDADebugger.java:324)
at org.netbeans.modules.debugger.jpda.ant.JPDAConnect$1.run(JPDAConnect.java:235)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:222)
at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:116)
at com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:90)
at org.netbeans.api.debugger.jpda.AttachingDICookie.getVirtualMachine(AttachingDICookie.java:231)
at org.netbeans.modules.debugger.jpda.actions.StartActionProvider.doStartDebugger(StartActionProvider.java:188)
at org.netbeans.modules.debugger.jpda.actions.StartActionProvider.access$200(StartActionProvider.java:80)
at org.netbeans.modules.debugger.jpda.actions.StartActionProvider$1.run(StartActionProvider.java:165)
... 4 more
BUILD FAILED (total time: 7 seconds)
The tomcat log says Listening for transport dt_socket at address: 8000
And the Netbeans Debugger Console says:
Attaching to localhost:8000
Connection refused.
Does anyone know what is happening here, and what I can do to fix it?
Thanks!
Perhaps try adding the flags detailed in this Answer.
This is how we currently do it.
Oops. It turns out that I had commented out the 127.0.0.1 localhost entry in my /etc/hosts file. When I re-enabled localhost, it worked fine! And as an aside, I thought I had to comment out the default localhost line because I had another line in there for a locally hosted site I was testing, but according to this answer, there's no need to do that!

Apache Storm: Nimbus not starting on Port 6627

I can't see anything on port 6627 after starting Nimbus. I am getting the Connection Refused error. Following errors are thrown in Nimbus Log:
6899 [main] ERROR com.smarterme.intake.EmbeddedTopologyRunner - Toplogy submitting failed.....org.apache.thrift7.transport.TTransportException: java.net.ConnectException: Connection refused
java.lang.RuntimeException: org.apache.thrift7.transport.TTransportException: java.net.ConnectException: Connection refused
at backtype.storm.utils.NimbusClient.getConfiguredClient(NimbusClient.java:38)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:116)**
Do you guys have any idea about this?
Add "nimbus" to /etc/hosts file as alias to 127.0.0.1 and localhost.
Make sure iptables is not the issue from the host you are
trying to run or Most likely there is something wrong in your ~/.storm/storm.yaml
Go through below link,hope this could help you.
http://storm.apache.org/about/deployment.html

Not able to run the examples of HBase-The definitive guide

I've been trying to run examples from HBase-The definitve guide and i've been encountering with this error and i'm not able to get past it. I'm running in Stand alone mode if that helps.
Exception in thread "main" org.apache.hadoop.hbase.MasterNotRunningException: �
17136#ubuntulocalhost,32992,1373877731444
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:615)
at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:94)
at util.HBaseHelper.<init>(HBaseHelper.java:29)
at util.HBaseHelper.getHelper(HBaseHelper.java:33)
at client.PutExample.main(PutExample.java:22)
But my HMaster process is running:
hduser#ubuntu:/home/ubuntu/hbase-book/ch03$ jps
17602 Jps
8709 NameNode
8929 DataNode
9472 TaskTracker
9252 JobTracker
9172 SecondaryNameNode
17136 HMaster
This is my hbase-site.xml file:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///usr/local/hbase/hbase-data/</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/usr/local/hbase/zookeeper-data/</value>
This is my /etc/hosts file:
127.0.0.1 localhost
127.0.1.1 ubuntu
127.0.0.1 ubuntu.ubuntu-domain ubuntu
Specifically, i'm trying to run the 3rd chapter examples and i'm just not understanding why my setup is not running..
Any idea where i'm going wrong?
Edit: Here are the logs:
2013-07-15 03:56:32,663 INFO org.apache.zookeeper.server.NIOServerCnxnFactory: Accepted socket connection from /127.0.0.1:60119
2013-07-15 03:56:32,672 WARN org.apache.zookeeper.server.ZooKeeperServer: Connection request from old client /127.0.0.1:60119; will be dropped if server is in r-o mode
2013-07-15 03:56:32,672 INFO org.apache.zookeeper.server.ZooKeeperServer: Client attempting to establish new session at /127.0.0.1:60119
2013-07-15 03:56:32,674 INFO org.apache.zookeeper.server.ZooKeeperServer: Established session 0x13fe17e7f1d0006 with negotiated timeout 40000 for client /127.0.0.1:60119
2013-07-15 03:57:11,653 DEBUG org.apache.hadoop.hbase.io.hfile.LruBlockCache: Stats: total=1.17 MB, free=247.24 MB, max=248.41 MB, blocks=2, accesses=68, hits=55, hitRatio=80.88%, , cachingAccesses=61, cachingHits=53, cachingHitsRatio=86.88%, , evictions=0, evicted=6, evictedPerRun=Infinity
2013-07-15 03:57:14,333 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x13fe17e7f1d0006, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
at java.lang.Thread.run(Thread.java:724)
2013-07-15 03:57:14,334 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /127.0.0.1:60119 which had sessionid 0x13fe17e7f1d0006
2013-07-15 03:57:24,551 INFO org.apache.hadoop.hbase.master.LoadBalancer: Skipping load balancing because balanced cluster; servers=1 regions=1 average=1.0 mostloaded=1 leastloaded=1
2013-07-15 03:57:24,568 DEBUG org.apache.hadoop.hbase.client.MetaScanner: Scanning .META. starting at row= for max=2147483647 rows using org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation#189ddf
2013-07-15 03:57:24,578 DEBUG org.apache.hadoop.hbase.master.CatalogJanitor: Scanned 1 catalog row(s) and gc'd 0 unreferenced parent region(s)
It has nothing to do with standalone or distributed mode. Make sure your setup is working fine. I can see that RegionServer and Zookeeper are not running. Comment out the line 127.0.1.1 ubuntu in your /etc/hosts file and restart HBase. You might have to kill it.
P.S : Since you already have Hadoop configured and it is running fine, you can run HBase in pseudo-distributed setup.

Unable to start WebLogic remotely to Debug

I setup my remote WebLogic server to debug, using these options:
-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=${DEBUG_PORT},server=y,suspend=n -Djava.compiler=NONE"
I started WebLogic on the server and saw that it was listening on 8453 for dt_socket. I added the remote server on my local Eclipse and tested the connection. I also see that the server is STARTED and I can view the details. However, I'm unable to restart in DEBUG. I also stopped WebLogic on the server and now in Eclipse I see that it is stopped, but I'm not able to start it (the icons for debug and start are greyed out). When I set up my Remote Java Application in Eclipse I did check "Allow termination of remote VM".
Before stopping the server, the debug icon wasn't disabled and when I clicked it I got this message:
Cannot attach to remote server.
Please make sure the server myserver.com is running and listening for transport dt_socket at address: 8453
Failed to connect to remote VM. Connection refused.
Connection refused: connect
Instead of using java startup options, modify the following scripts:
setDomainEnv.sh -> make sure DEBUG_PORT is set ie. 8453
startWebLogic.sh -> set PRODUCTION_MODE=false and set debugFlag=true
Restart server, remote debug should work on port 8453.

Cannot connect to hsqldb database

I am using the following command to create a database using windows command and connect to it but I am getting java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind error.
Command used to create a database named xdb and connect to it:
java -cp ./lib/hsqldb.jar org.hsqldb.Server -database.0 file:mydb -dbname.0 xdb
Complete error:
[Server#83cc67]: [Thread[main,5,main]]: checkRunning(false) entered
[Server#83cc67]: [Thread[main,5,main]]: checkRunning(false) exited
[Server#83cc67]: Startup sequence initiated from main() method
[Server#83cc67]: Loaded properties from [C:\Home\hsqldb\server.properties]
[Server#83cc67]: Initiating startup sequence...
[Server#83cc67]: [Thread[HSQLDB Server #83cc67,5,main]]: run()/openServerSocket(
):
java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at java.net.ServerSocket.<init>(ServerSocket.java:97)
at org.hsqldb.HsqlSocketFactory.createServerSocket(Unknown Source)
at org.hsqldb.Server.openServerSocket(Unknown Source)
at org.hsqldb.Server.run(Unknown Source)
at org.hsqldb.Server.access$000(Unknown Source)
at org.hsqldb.Server$ServerThread.run(Unknown Source)
[Server#83cc67]: Initiating shutdown sequence...
[Server#83cc67]: Shutdown sequence completed in 6 ms.
[Server#83cc67]: 2012-05-18 01:31:59.184 SHUTDOWN : System.exit() is called next
Could someone help me understand why am I getting this error and how to solve it?
Thanks
The default port for hsqldb is 9001
Run netstat -an check to see if there is something is LISTENING on port 9001
netstat -an | grep LISTENING to check for all servers listening for incoming connections
netstat -an | grep 9001 to check for a specific port number.
If there is something already there then the new of hsqldb that you are trying to start will fail to bind a socket to the 9001 port.
On Windows 7 you can run TCPView to see what process is currently listening on the "overcrowded" port. Then it's a matter of deciding to terminate that process which is using 9001 or reconfiguring hsqldb and your client application to use a different (unused) port.
It is possible to change the port that hsqldb listens on using the --port XXXX, where XXXX is the new port number.
Also from the java -cp ./lib/hsqldb.jar org.hsqldb.Server --help output...
The server looks for a 'server.properties' file in the current directory and loads properties from it if it exists. Command line options override those loaded from the 'server.properties' file.
There are other possible causes of this error so it would be useful to know what operating system the hsqldb is running on.
Failure to bind to a socket is a problem that can afflict any server application so you can review the answers provided for other server software that return this error such as the question asked about JBOSS here ...
java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind (JBOSS)
It looks like you try to bind to port 0 and it doesn't exist. Try to config a different port

Categories