Kafka error while running command to start zookeeper - apache-kafka

I have kafka installed at following location
C:\Users\username\work\data\kafkadirectory\kafka\apache-kafka\kafka
Now, when I run following command at above location:
path/to/zookeeper-server-start.bat config\zookeeper.properties
I get error:
The input line is too long.
The syntax of the command is incorrect.
As can be seen, directory names don't include version(google search tells to get rid of version in directory names).
Still I face the issue.

Try the below-mentioned steps
Better to move the folder to short path 'C:\kafka\' (Reducing folder hierarchy)
Restart the command prompt to reset the classpath variable
Use PowerShell which have longer support to the classpath

Related

When can I use the command 'mongod' in Command Line?

I recently installed the version 4.4 of MongoDB,I followed all the instructions as in the documentation of mongodb.
As instructed by my tutor I created another folder named 'mongodb'in my pc,inside which I created another folder named 'data' as well.Now i went to the command prompt and entered into the same mongodb folder i created earlier and typed the following command.
C:\Users\Dell\mongodb>mongod --dbpath=data --bind_ip 127.0.0.1
When I press Enter I see an error :
'mongod' is not recognized as an internal or external command,operable program or batch file.
I am totally stuck in this.I even reinstalled mongodb again,but it is not working.
You might have a problem with path in Mongodb. After the installation process ends open a
Command Interpreter with Administrative privileges and run:
"C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe"
Now afterward you can use the 'mongod' Command. If still you are unable go to the pre insatlled Mongodb folder copy the path upto bin .
Now go to :
controlpanel>system and security>system>Advanced system settings.
A dialogue box appears and then at the bottom there is the option for Environment Variables.Click on that.
If Mongodb variable already exit delete that and click on the path option. You might see a new option somewhere around click on that and input box appears.Now paste the copied path in that box and click save/Ok or sth to end the options.
Now you can use the 'mongod' command .

Nagios Error : /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

I am trying to install nagios-plugins-2.2.1 on redhat machine
when running this command:
Nagios /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
i am getting the error as
no such file or directory
pls help
https://www.youtube.com/watch?v=VsIrAsXzbx4
It looks like the nagios binary is located in another location not in /usr/local/nagios/bin/nagios
To find where it is run:
which nagios
If nagios was installed using the RHEL package manager so it will be usually in:
/usr/sbin/nagios
If it did not come back with result just type the first 3 letters "nag" then type the "Tab" key and it will complete it.
Once you find it then use it instead of /usr/local/nagios/bin/nagios
Then make sure you get the right nagios.cfg file location by running the 2 following commands:
updatedb
locate nagios.cfg
If when you run updatedb you got "Command not found" error message then mlocate package is not installed and you can get the nagios.cfg location by running this command instead
find / -xdev -type f -name "nagios.cfg"
So by that you should have both "nagios binary" and "nagios.cfg file", you can then re-run the command with the right file paths
It looks like "nagios.cfg" does not exist.
Try to create it and configuring it manually.
Then try again.
You can try to look at where your nagios.cfg file has been created, using
locate nagios.cfg
for instance, to make sure your file is in the right path and maybe call that newly displayed path instead.
/usr/local/nagios/bin/nagios -v [path_of_nagios_cfg]
Also you need to omit the first "Nagios" from the command line as it is in Capital N which sure is supposed to come back with "no such file or directory" message
The command should only be like this:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
you will find nagios.cfg file in #/usr/local/nagios/etc
then run that command giving this path.

Not able to start kafka with .\bin\windows\kafka-server-start.bat .\config\server.properties cmd

I have preconfigured zookeeper and kafka and after making all the changes when i execute below command in cmd prompt
.\bin\windows\kafka-server-start.bat .\config\server.properties
following error is thrown
'wmic' is not recognized as an internal or external command,
operable program or batch file.
Do suggest for this .
For steps kafka preconfiguration used fowwloing link : https://dzone.com/articles/running-apache-kafka-on-windows-os
I had similar issue. I added C:\Windows\System32\wbem to path.
Now I am not getting the same error but no logs are getting printed after starting kafka-server.
Kafka server not returning anything
This is because WMIC internally runs other OS commands. For this C:\Windows\System32 must be set in Classpath. If this is missing, nothing gets displayed when starting Kafka server.
go to System environment variables form control panel, edit PATH and append below to existing path value separated by ;
C:\Windows\System32\wbem;%PATH%;
after setting PATH in env variables, confirm whether wmic is picked properly:
open command prompt and type below command
where wmic
This should return the following as output:
"C:\Windows\System32\wbem\WMIC.exe"

How to load scripts in MongoDB

I'm using MongoDB version 3.0 and I want to run script.js on database
Problem I have find is that mongo is not seeing my file script.js.
What I have done step by step:
I have installed MongoDB in directory MongoDB\Server\3.0\bin\
I have put script.js inside \bin directory
I want to do is run script.js using load() method
I have got an error
load("script.js")
2016-10-09T22:17:17.557+0200 E - file [script.js] doesn't exist
2016-10-09T22:17:17.558+0200 E QUERY Error: error loading js file: script.js
at (shell):1:1
Probably I have put script.js in wrong place but where I should put it?
Next step is I'm using mlab and I want to load my script to the online server, how to do this?
I don't know of any magic that would make a \bin directory relevant, but assuming that your script is located in /bin, you just need to call out the full path when you do the load from within the mongoshell
load('/bin/script.js');
If your script is located off your home directory it will be like
load('/Users/yourname/script.js');
See the docs for load: https://docs.mongodb.com/manual/reference/method/load/
Ditto for how you run it on "the server". Its not so much running on the server, but in the shell that you are running. If the shell is connected to a particular server, the effects of the script will be on the server but the script itself executes in your shell.
For windows try:
load('c:\MongoDB\Server\3.0\bin\prova.js')
load("C:\\Data\\Mongo\\M001\\loadMovieDetailsDataset\\loadMovieDetailsDataset.js")
Double \ does the trick. I was receiving similar error as my install path was not set and the file res
Try changing the name of the .js file. In my case, the error was coming because the folder name and the file name were the same.

lost PATH while trying to set custom winlogon shell in WindowsXP

I have changed the shell key in windows registry to gain custom shell (Kiosk usage):
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
I set shell key to a batch file which runs two applications as below:
start "myFirstAppTitle" "myAppPath\myApp1.exe"
start "mySecondAppTitle" "myAppPath\myApp2.exe"
Each application runs but the second application which needs some files to be excuted throws an error which says could not find dependency files. whereas the dependency files are adjoining to the exe file and the mentioned app works fine, when starts from startup.
Meanwhile when i run the batch file manually it rusn fine.
I added the PATH command to the batch file but it did't work too.
Change the batch file to this:
set PATH=%PATH%;C:\MyAppPath
start "myFirstAppTitle" "myApp1.exe"
start "mySecondAppTitle" "myApp2.exe"
If you start executables without an absolute path, the path is relative to the current working directory. Also, when you specify an executable with a relative path, %PATH% is not searched for a matching subfolder with a matching executable.
Since the script worked when you manually started it, your working directory probably was C:\. However, when run at logon as a replacement shell, the working directory is most likely "%SystemRoot%\system32".
The problem solved strangely, i removed the title parameter of start command and it worked. In fact i used start command this fashion:
set PATH=%PATH%;C:\MyAppPath
start myapp.exe
start myapp2.exe