error while running command ./catalina.sh run in cygdrive - cygwin

Anila#Annie /cygdrive/c/server/c1/apache/bin
$ ./catalina.sh run
Using CLASSPATH: C:\server\c1\apache\bin\bootstrap.jar;C:\server\c1\apache\bin\tomcat-juli.jar
./catalina.sh: line 319: /c/server/c1/jdk/bin/java: No such file or directory
this the error i get when i tried running it when implementing cluster and load balancing with apache. what to do?

Related

Unable to Launch PM2 start pm2.json as Windows Service?

I launch the Node apps using the json file with pm2 using the command line pm2 start pm2.json and it always launched without any issues. However, I wanted to launch it via the Windows Service. So I created a run.bat in the same folder where my pm2.json is present
and added the same command line pm2 start pm2.json in the run.bat. Then I used nssm.exe to set the run.bat as Windows Service. However, it always shows its status as Paused and never started the apps.
The event viewer shows the logs that the run.bat existed with 1:
However, it still works fine using the command line pm2 start pm2.json
How to start the command line pm2 start pm2.json through the Windows Service?

Selenium test case is not finding the chrome drive even though file exist on the server

I am trying to execute selenium test cases through Jenkins on an ec2 unix instance. I am getting the following error in Jenkins logs:
Error in Launch Browser Driver: java.lang.IllegalStateException: The driver executable does not exist: /home/ec2-user/workspace/PJTest/src/main/resources/drivers/chromedriver
I ssh'ed to the server and created this folder manually and copied the chrome driver file. The job still gives the same error.
I have verified and the chromedriver file exist.
How do I debug this further to find out why Jenkins job is still unable to find this file?
Also, Jenkins is running inside docker on this ec2 instance. I am using the following command to start docker:
docker run -d -v /var/jenkins_home:/var/jenkins_home:z -p 80:8080 -p 50000:50000 -v "/home/ec2-user/source/tyoc/jenkins" -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -v $(which docker-compose):/usr/bin/docker-compose jenkins/jenkins:lts

Docker: Error response from daemon: OCI runtime create failed: container_linux.go:296:

I am trying to run a simple node application with express but I get this error:
Here's my working directory:
I ran the following command to mount my current source code directory to /var/www inside the node container and run node npm start to start up the app;
but I get the error above and not sure what to do:
docker run -p 8085:3000 -v /home/joel/workspace/plural_docker_webdev:/var/www node -w "/var/www" node npm start
And I get this error:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:296: starting container process caused "exec: \"-w\": executable file not found in $PATH": unknown.
ERRO[0000] error waiting for container: context canceled
Docker is telling you that the command hit an error.
It is trying to run the node image with the command -w.
Since -w is not a command, it throws this error.
This is because you have written node in a place you probably didn't mean to.
Your command is being interpreted like this:
docker run -p [port_info] -v [volume_info] node [command]
You can rewrite your command like so and it should work fine:
docker run -p 8085:3000 -v /home/joel/workspace/plural_docker_webdev:/var/www -w "/var/www" node npm start
I had the same issue. My problem was that we did not give it enough memory.
Went with the recommended minimum of 2GB of memory. turns out other resources were consuming most of it. gave it 4GB, rebooted & it works fine now.

How to reload nginx config if it is running or start if it's stopped?

I update nginx config files periodically and due to technical issues sometimes it can happen that nginx is not running.
In this case if I run nginx -s reload, I see this error:
nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)
How can I reload nginx config with the command from above if it's running or start if it's not running without seeing that error?
If you can't count on the fact that nginx is already running then you should just restart it. But, if you really want the above, assuming you're running on linux/unix and it looks like you are then you can create a tiny shell script. Again, assuming your default shell is bash or bash compatible (other shells would have to be ported) you could do something like this:
#!/bin/sh
if [ -f /run/nginx.pid ]; then
/path/to/nginx -s reload
else
/path/to/whatever/command/starts/nginx
fi
You can take the above to a whole new level by using inotify. Again, assuming you're running a Linux distribution, you can install your OS distribution's inotify-tools package and automate running the above script file every time your config files change. See this for more info on using inotify:
How to execute a command when a file changes

ssh error while starting namenode

I have been trying to start the services in hadoop using the command
start-dfs.sh
it gives me the following results
why is this happening and what should be done?

Resources