zookeper-server-start.sh config/zookeeper.properties is throwing "Already in use".how to solve this error in ubuntu? - apache-kafka

Vfore starting kafka i tried to start zookeeper server,it is throwing following java.net.BindException Exception.
I checked existing processes using :
netstat -nap|grep 4040 and 8080
I found no processes running there. can anyone know about this?
screenshot

It's trying to start zookeeper on the default port of 2181. You probably have another zookeeper running. Try running the Java ps command "jps" and kill any other zookeeper process running on the same machine

Related

apache flink doesnt connect to port 8081

Hi i am new to apache flink and i am trying to run a batch wordcount example to start learning about it.I have run
./bin/start-cluster.sh
and then i executed ./bin/flink run ./examples/batch/WordCount.jar --input test.txt --output out.txt
and i get the following
org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:8081
console messages
so i think its about server connection error and i tried some things like xampp but nothing better
So what's your opinion on that?
It seems like your cluster is not starting. Please try ./bin/start-cluster.sh again and go to http://localhost:8081/ to confirm your cluster is up. After that, the word count example should run fine after specifying the appropriate input and output files.

Cannot run Kafka Producer due to socket.error: [Errno 48] Address already in use

I have a local docker-machine and I am trying to run a Kafka producer written in python. However, it gives a socket.error: [Errno 48] Address already in use and stopped. Appreciate any helps!
Error Msg:
Docker machine
Images on docker-machine
Containers
Command to run the producer
$ python producer.py
P.S. I don't think anything would be wrong in the producer.py, because I ran it successfully a couple days before and I didn't change anything ever since.
It turns out that I already have a process running, which uses the port 9092.
sudo lsof -i:9092
So after I kill it, I can run my producer successfully again
kill 28987
But I remembered I shut down the producer last time I used it, wonder how it was still open...

How to check zookeeper in cloudera vm

For starting KAFKA we need to start zookeeper.but in cloudera VM i think there is zookeeper instance already running .SO can anyone tell me how to check through VM terminal whether the default instance is runnig or not ?
Also if we start a zookeeper service we can see the logger screen but how to check it for cloudera VM.
Thank You,
BISHNU
In the Cloudera VM, you're running on a single node so running zookeeper-client should indicate if zookeeper is running. If you see:
[zk: localhost:2181(CONNECTED) 0]
it's running. If you see this error looping:
java.net.ConnectException: Connection refused
it's not running.
Also you can check via netstat -tupln l grep 2181

Unable to start the zookeeper server

I am running kafka on amazon EC2 and ubuntu. For starters I'm trying to run the zookeeper server and create a test topic. The ultimate aim is to integrate spark with kafka for sentiment analysis.
When I try to start the zookeeper server I get the following warning and the process doesn't seem to end i.e I don't see a shell prompt after i type this command:
bin/zookeeper-server-start.sh config/zookeeper.properties
WARN Either no config or no quorum defined in config, running in standalone mode (org.apache.zookeeper.server.quorum.QuorumPeerMain)
Thanks in advance for any help on this.
Thats a warning not an error .. your zookeeper should be running and you should be able to connect to it .. just open another tarminal and run (from ZK home)
bin/zkCli.sh -server 127.0.0.1:2181
optional commands to check server status:
echo ruok | nc 127.0.0.1 2181
echo mntr | nc 127.0.0.1 2181
echo srvr | nc 127.0.0.1 2181

Context Broker FI: Fatal Error (error starting REST interface)

I have stopped a virtual machine with CentOS running an instance of Context Broker. Upon relaunching the system with the enabler, the latter gives a Fatal Error. See the below log:
# contextBroker
INFO#13:18:32 contextBroker.cpp[1348]: Orion Context Broker is running
INFO#13:18:32 mongoGlobal.cpp[164]: Successful connection to database
INFO#13:18:32 contextBroker.cpp[1157]: Connected to mongo at localhost:orion
INFO#13:18:32 mongoGlobal.cpp[483]: Database Operation Successful ({ conditions.type: "ONTIMEINTERVAL" })
INFO#13:18:32 rest.cpp[901]: Fatal Error (error starting REST interface)
I'm working on the 4.1.2 version of Orion, CentOS 6 running in VirtualBox. Running with su because I get a permission denied on a log file error. For info, I have enabled bridging network connection just before the VM reboot.
Is it the fact that the broker was not closed correctly that there is something blocking its restart? (PS. yes I know that there is a nearly exact same error message in the administration guide, but I don't see any solutions there)
Thank you!
EDIT: one solution that works is uninstalling the contextBroker package and installing it again. I wish there was a cleaner way!
EDIT: this problem reproduces every time I kill the contextBroker application - then every time restarts don't help, reinstalling the package does.
Make sure there is no other instance of the broker running (ps aux | grep contextBroker), using the same port.
If there is another instance of the broker running, then the port will be taken and the REST initialization will fail.
About running as root because of log-file permissions ... Why not simply change the owner of the log-file instead?