Debugging MapReduce Hadoop in local mode in eclipse. Failed to connect remote VM - eclipse

I am new to hadoop and I am trying to debug MapReduce Hadoop in local mode in Eclipse in Virtualbox Ubuntu following these articles: Debug Custom Java hadoop code in local environment and Hadoop MapReduce Debugging in Local Setup
In hadoop-env.sh I put the text
export HADOOP_OPTS="$HADOOP_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8008"
I tried to run Eclipse from command line
eclipse -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8008
I also changed from hdfs to file:/// in core-site.xml in hadoop configurations
<name>fs.default.name</name>
<value>file:///localhost:8020</value>
I checked the port 8080. Seems like it works okay:
netstat -atn | grep 8080`
says tcp6 8080 LISTEN
http://localhost:8080 opens in browser and says Required param job, map and reduce
still everything is useless as when I try to set debug configuration with the port 8080 in Eclipse it breaks “failed to connect remote vm”.
Can anyone suggest a possible solution?

That isn't the way to run eclipse as a debugger.
Run eclipse without any command line options and setup a debug configuration for a remote java application that connects to 8008.
[EDIT]
I also think your hadoop debug options are wrong. I use:
-agentlib:jdwp=transport=dt_socket,address=8008,server=y,suspend=n

Related

Where do you configure spark and hive settings on local install of jupyter?

I'm trying to configure Spark on my local IDE and local install of Conda jupyter environment to use our corp spark/hive connect which looks something specs similar to this:
host: mycompany.com
port: 10003
I tried to configure spark-default.conf
spark.master spark://mycompany.com:10003
And when I try and call the spark context : sc
I get the following error with Jupyter:
Exception: Java gateway process exited before sending the driver its port number
Does anyone know of any good documentation that I can use to configure my local instance of jupyter and or Netbeans to use Spark with Scala or Python?

Having issue with Tomcat when I run in a eclipse

I am novice in java I have installed Tomcat and it runs fine in a browser but when I run in a eclipse its showing error like
Several ports (8005, 8282, 8009) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
I would like to mention one thing I am not authorized to login with admin account I have tried lot to stop the already running stuff through command prompt and i followed this link Deployment error: Starting of tomcat fail
however I am getting the same error is there any way to solve this issue.
Thank You.
Some other process is using one or more of the ports needed by tomcat (8005, 8282, 8009). Probably an old instance of tomcat. Kill it, then try again.
You can run netstat -abn on windows or netstat -apn on Linux to figure out which process is listening to these ports.

Tomcat 7 remote debugging on EC2

I have a tomcat 7 instance running on EC2. The port that tomcat is running on is its default, 8080.
I wanna start tomcat in debug mode, so I started tomcat with the following command :
sudo service tomcat7 start -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
I have 8000 port opened in my security group. But when I try to remote debug using eclipse, it gives me a Connection refused error. Any clue what I am doing wrong ?
Thanks..
I don't think that you can put the debug options as arguments to the service command.
Assuming you installed the standard tomcat7 package using yum, edit the file /etc/tomcat7/tomcat7.conf and add this line in it:
JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
Then restart the Tomcat service.

How to set nodejs debug mode don't listen 127.0.0.1

I want to remote debug the nodejs program in Eclipse. I start the node script with the debug option.
$node debug script.js
But I can't connect to the node in Eclispe. When I netstat the node's TCP port. I found that node only listen 127.0.0.1 in debug mode. So I can't connect it from different computer.
But I can't find any startup options that can change to listen to any address.
Anyone know to make it listen to any address to remote debug in other computer?
if anyone else stumble upon this: you can set the node debug to any address as you set the port
node --debug=169.168.1.2:5858 app.js
if that would be the ip of your remote machine or even better to every machine
node --debug=0.0.0.0:5858 app.js
but please be aware that the 2nd option should only be used if you are debugging in your own private network as you open it up for everyone
This is what I do in linux Debian:
install balancer
sudo apt-get install balance -y
then create a route in balancer to reroute your 5858 port to 5859
balance 5859 127.0.0.1:5858
start your app
node --debug app.js
now you can access it from everywhere on port 5859
I'm looking into V8 code that goes through deps/v8/src/debug-agent.* down to deps/v8/src/platform-posix.cpp (for linux) to POSIXSocket::Bind method and it can't seem to have any option about this (unless I'm missing something).
I bet you either hack it and recompile node or you'll need to build a small proxy beside your node process.
Here's a great tut on debugging nodejs from eclipse. Note at the bottom there is a script the author uses to forward localhost:5858 to the remote server's 127.0.0.1. You could also just use an SSH tunnel.
So, to summarize:
start your script with node --debug app.js
configure eclipse as if you were debugging locally
use the node_g script or configure an SSH tunnel
go on vacation now that your code is bug-free
to debug nodejs remotely over SSH session do:
1. install balance on Linux: https://balance.inlab.net/overview/
2. run the command: balance -df 8585 127.0.0.1:5858 > /tmp/balance.out 2>&1 &
3. ssh to your remote Linux box (tunnel will be created 8585 > 5858 > nodejs)
4. run your node script on server: node --debug-brk --nolazy ./myNodeApp.js
5. kick off debug session in WebStorm alt-d to port 8585
now you are remote debugging securely over SSH session

jboss-5.1.0.GA auto start on boot

I was given the task of installing jboss-5.1.0.GA on a remote ubuntu 10.4 Lts server. With all those resources out there I was able to run jboss successfully but my problem was that I wasn't able to get auto start on boot work so that jboss would be running on the server.
I followed a couple of tutorials that said me create a separate user called jboss and to copy the jboss_init_Redhat.sh to the /etc/init.d/jboss (jboss home, java path ,jboss user and the binding to 0.0.0.0 is all set) and used /etc/init.d/jboss start
but I can't get to see the Jboss page at the Ip on a browser.,
If i do a ./run.sh -b 0.0.0.0 ==> the server is up ...
Can some body shed some light on this issue????
If you want to run JBoss AS on given interface using jboss_init_redhat.sh script look at these line:
#if JBOSS_HOST specified, use -b to bind jboss services to that address
JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"}
You should just define new variable before these line:
JBOSS_HOST="0.0.0.0"
You should also check shutdown command (especially when you run your server on some other address then 127.0.0.1 or 0.0.0.0), it should know how to find your server:
JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown -s jnp://${JBOSS_HOST}:1099"}