I can't run Kafka on windows - windows

I'm learning about Microservice Architecture these days and I need to run Kafka to follow some tutorials. However, zookeeper-server-start on cmd which is the first step for running up Kafka doesn't work for me.
It says 'the syntax of the command is incorrect'
I followed process below
download kafka and extarct
(https://kafka.apache.org/downloads - kafka_2.11-2.1.0.tgz (binary download))
open cmd and write command
These are what I've tried so far (at kafka directory)
bin\windows\zookeeper-server-start.bat zookeeper.properties
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
\bin\windows\zookeeper-server-start.bat \config\zookeeper.properties
zookeeper-server-start.bat ../../config/zookeeper.properties
and so on... plus, kafka directory is not too long to cause the error.(C:\kafka)

Change the directory of Kafka to keep simple
Like:
From kafka_2.13-3.0.0 to kafka
It's worked for me.

I have moved Kafka folder directly to a different directory and renamed long Kafka-version as well. After that, it works fine.

Best thing to do is run Docker, and Kafka under that. You can find docker images here, and an example Docker Compose here

Let's consider you have unzip kafka_xxx.tgz in folder (C:\kafka) then you can use as below command:
C:\kafka\bin\windows>zookeeper-server-start.bat C:\kafka\config\zookeeper.properties
You may get message as "The syntax of the command is incorrect", But you can ignore it.
It will not cause any problem.
If you would like to verify zookeeper is running or not then you can open other command prompt and use below command:
C:\User> jps
Output:
12896 Jps
13264 QuorumPeerMain

Kafka in window
zookeeper-3.4.10\conf\zoo-sample.cfg
rename: zoo-sample.cfg to zoo.cfg and change into zoo.cfg
dataDir=C:\\Users\\Sumit\\zookeeper-3.4.10\\zookeeper
Now start{zookeeper bin folder}: zkserver
open kafka directory and type following code in cmd-promot
.\bin\windows\kafka-server-start.bat .\config\server.properties

check for correct Path , use from English characters to Path and
Use a shorter address. example :
d:\kafka\

I put the kafka folder under c: drive like C:\kafka_2 and also moved the properties files to the windows folder (because it was saying invalid input).
Executed the command like : C:\kafka_2\bin\windows>zookeeper-server-start.bat zookeeper.properties,
and it worked like magic

I faced the same issue as you and the way I solved it, I keep the directory to shortest as possible:
On my side: E:/kafka and the rest of the directories like (bin, config, etc..) will be inside kafka
I hope it works for you.

I faced a similar issue [on windows].
tried changing the dataDir variable to C://path-to-tmp/folder.
It did not work.
Then changed the drive letter to small i.e.
c:/path-to-tmp/folder
and lo and behold it works like a charm.
True Story.

Related

kubectl not working on my windows 10 machine

When I try to run any kubectl command including kubectl version, I get a pop-up saying "This app can't run on your PC, To find a version for your PC, check with the software publisher" when this is closed, the terminal shows "access denied"
The weird thing is, when I run the "kubectl version" command in the directory where I have downloaded kubectl.exe, it works fine.
I have even added this path to my PATH variables.
thank you for the answer, #rally
apparently, in my machine, it was an issue of administrative rights during installation. My workplace's IT added the permission and it worked for me.
Adding this answer here so that if anyone else comes across this problem they can try this solution as well.
Not knowing what exactly you downloaded, i would suggest you to delete everying in the folder and follow the instructions for installing kubectl for Windows from here:
https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/
Note: downloading the .exe is not enough. You need a kubeconfig file "config", which contains the configuration to access your cluster.
kubectl looks for this file in a hidden folder under your user profile directory. c:\users<me>.kube.
Just to let you try, i would suggest you to activate Kubernetes in your Docker-Desktop installation. I guess you have this installed. If not install it from the Dockersite. https://www.docker.com/products/docker-desktop/
Activating Kubernetes inside Docker-desktop, will install also kubectl and save the config in the .kube folder.
After the installation finished, in a new terminal:
kubectl get node
You should see the 1 node in the kubernetes-docker-desktop cluster.
Now if you want to access another cluster, you need the kubeconfig-file for that cluster. If you have it, just rename the config in the .kube folder (to not loose it) and put the other config inside.
If the new config file is correct you should be able to access that cluster.
The config file can be structured to hold more than one cluster configuration and you can switch between them using a so called context.
Here you can get the information how to do that, according to your needs:
https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/
Hope this can help you, starting with KUbernetes.

Git installation failed [duplicate]

I am new here and i will try to explain my question kindly ignore any mistakes.
I am using git version git-2.8.2
It worked fine for one day then this problem occurs.
I am using gcloud repository.
First I tried gcloud clone command then this error occurs
Then to make sure git is there I tired git command then this error occurs
Then I double check by opening git Bash but same error was there too.
I tried reinstalling changing directory. but nothing works.
I face the same problem after I try to avoid memory leak in Windows 10. If you happened to change the regedit like me, just type regedit in the search then go to
HKEY_LOCAL_MACHINE -> SYSTEM -> ControlSet001 -> Services -> Null
change the value of Start to 1.
I accidentally bumped into the same problem when I was sorting out the services running on my computer with Windows 10.
fatal: open /dev/null or dup failed: No such file or directory
The reason was that I deleted the service named 'Null' that had no description as I thought that was a virus service.
Thus, when I found my git unable to operate, I reckoned the deleted service.
According to a solution provided on some site I tried to run the service again using cmd.exe
sc config Null start= system
sc start Null
but it said the service hadn't been existed in the list.
Thankfully, there are some kind folks who shares the information of the default services running on Windows 10 and the description necessary for the successful bringing back the service.
So as to get the service back in the list:
press Win + R
type regedit
go to HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services section
Create Null folder and all the params it needs.
Restart your computer.
Now you got your Null service back and your git back as well.
Hope this helps.
I solved my problem accidentally. I would like to share it with everyone.
It was not a problem of git or gcloud or source tree.
Actually I have forcefully stooped windows update from installing which causes this problem.
Now when I install windows updates again this problem is fixed now.
Maybe this helps someone.
the similar situation in chrooted linux tree is fixable following way:
cd inside the folder where you are preparing the chroot dir, then
mount -o bind /dev dev/
then only chroot inside
I had this weird bug just now. I went back a dir and tried git init, it worked there.
I re-ran zsh and tried again in the dir it errored in originally and it worked. shrugs

Can't get druid running

enter image description here
I have windows with linux subsystem and I am trying to run druid. I am getting a message CANNOT CREATE FIFO. What should I do to avoid it?
I faced the same issue myself. Was trying to run through WSL Ubuntu. It seems that FIFO file can't be created over mounted drive i.e /mnt/c/.
Workaround for this, you'd have to copy the entire Druid installation folder over to any internal folder eg. /usr/share/ and launch from there.

Kafka installation - classpath is empty

I try to install kafka on my windows(8), and it's not work.
I download kafka and extract it on c:\kafka after it i change the server.properties and zookeeper.properties.
I set in those file the logs path.
I even try to download an tun zookeper outside the kafka install but the zookeeper runing and the kafka not.
the Error that i get when i try to run this command is:
bin\windows\zookeeper-server-start.bat .config\zookeeper.properties
and this is the result:
Classpath is empty. Please build the project first e.g. by running 'gradlew jarAll'
The solutions is to Download the binary jar file.
go to config\server.properties and config\zookeeper.properties and change the folder. the new folder need to be write with / and not .
and after it you need to got the main folder and run the command:
bin\windows\zookeeper-server-start.bat config\zookeeper.properties
without the . before "config\zookeeper.properties"
I have provided the answer for the similar error here, check this out.
https://i-am-jabi.medium.com/fixing-classpath-is-empty-69288c1509a2
Here are the steps to resolve the issue:
Open kafka-run-class.bat file. You will find this in bin\windows folder of your confluent Kafka.
Search for “rem Classpath addition for core” in kafka-run-class.bat file. When you find it, it looks like below.
Now lets add the below snippet above the “rem Classpath addition for core” line in kafka-run-class.bat file.
rem classpath addition for LSB style path
if exist %BASE_DIR%\share\java\kafka\* (
call:concat %BASE_DIR%\share\java\kafka\*
)
After adding the above snippet, your file will look like this.
Now, when you run the bat files under windows folder, they will run fine without any issues. Here is the zookeeper start log after fixing the classpath error.

nutch 1.10 input path does not exist /linkdb/current

When I run nutch 1.10 with the following command, assuming that TestCrawl2 did not previously exist and needs to be created,...
sudo -E bin/crawl -i -D solr.server.url=http://localhost:8983/solr/TestCrawlCore2 urls/ TestCrawl2/ 20
I receive an error on indexing that claims:
Indexer: org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/opt/apache-nutch-1.10/TestCrawl2/linkdb/current
The linkdb directory exists, but does not contain the 'current' directory. The directory is owned by root so there should be no permissions issues. Because the process exited from an error, the linkdb directory contains .locked and ..locked.crc files. If I run the command again, these lock files cause it to exit in the same place. Delete TestCrawl2 directory, rinse, repeat.
Note that the nutch and solr installaions themselves have run previously without problems in a TestCrawl instance. It's just now that I'm trying a new one that I'm having problems. Any suggestions on troubleshooting this issue?
Ok, it seems as though I have run into a version of this problem:
https://issues.apache.org/jira/browse/NUTCH-2041
Which is a result of the crawl script not being aware of changes to ignore_external_links my nutch-site.xml file.
I am trying to crawl several sites and was hoping to keep my life simple by ignoring external links and leaving regex-urlfilter.txt alone (just using +.)
Now it looks like I'll have to change ignore_external_links back to false and add a regex filter for each of my urls. Hopefully I can get a nutch 1.11 release soon. It looks like this is fixed there.

Resources