cannot run jconsole - memory-leaks

In my windows XP machine I try to run jconsole like this:
jconsole 2228
Here 2228 is the pid of the process(got it from Task Manager).
The output is:
Unable to attach to 2228: Could not map vmid to user name
My java version is 1.5.0_07
Also tried
jps -mlv
.
Output is empty.In tmp folder there is no hsperfdata_.
Tried the same thing in a linux box with same result.In the linux box I logged in as root.Output of the id command:
# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
Output of jps command:
jps -mlv
28574 sun.tools.jps.Jps -mlv -Dapplication.home=/usr/local/Java/jdk1.5.0_16 -Xms8m
One difference with windows box is atleast /tmp/hsperfdata_root exists and permissions are:
drwxr-xr-x 2 root root 4096 Dec 17 12:52 hsperfdata_root
Plz help.
Regards,
Subhendu

If you are attempting to connect using the PID on windows, the TEMP directory for both the user running jconsole and the user running the jvm need to be the same. If jps doesn't list your jvm, then this is the problem.
This usually occurs with JVMs which are run as windows services that run as SYSTEM user. The temp directory for SYSTEM user is usually C:\windows\temp. The temp directory for you is probably C:\Documents and Setting\YOURNAME...

Well, I found out that adding system property com.sun.management.jmxremote solves the problem.
However, if someone wants to add anything to enhance my understanding - most welcome.
Regards,
Subhendu

Related

'at' command on Suse SLES 11 does nothing, works perfectly on other (RHEL) server

When our users want to schedule a job using the at command it doesn't work on our SLES 11 server.
If they do the exact same on our RedHat Enterprise Linux server it works perfectly.
I've tested it on both servers with their account:
at 11:50
ls -al >/home/USERS/username/justtesting.txt
<<Ctrl+D>>
and on the RHEL server it creates that file, and a subsequent atq command gives an empty list.
If I do the exact same on the Suse machine, the file is never created, and the atq command list all attempts we did in the following format:
23 2020-03-05 11:50 a USERS\username
or
24 2020-03-05 11:50 = USERS\username
The user is in the etc/at.allow file on the Suse machine (there was no /etc/at.allow or /etc/at.deny file to start with, but I added it anyway), and while scheduling the job there is NO errormessage whatsoever.
If I try the at command as my admin user, it works flawlessly on the SLES machine, so it is probably related to userrights somewhere. But again: the user doesn't get any errormessage indication they don't have the needed permissions.
I have two questions:
First of all, obviously: how do I get this to work? Any help would be greatly appreciated
Second: what does the 'a' or '=' mean in the atq list? If searched but can't seem to find the answer. (the 'at' command is an annoying one to google... :) )
best regards, and thanks for any and all help.
'at' commands are executed by the 'atd' daemon. Check if the daemon is up and running; it seems that default SuSE configuration is set not to run the daemon during startup.
Quick and dirty: ps ax | grep atd
More proficiency: systemctl status atd
as per suggestion of Andrew, I've posted this question on unix.stackexchange.com.
https://unix.stackexchange.com/questions/571490/at-command-on-suse-sles-11-does-nothing-works-perfectly-on-other-rhel-serve

HDP 2.5 Hortonworks ambari-admin-password-reset missing

I have downloaded the sandbox from hortonworks (Centos OS), then tried to follow the tutorial. It seems like the ambari-admin-password-reset command is not there and missing. I tried also to login with putty, the console asked me to change the password so I did.
now it seems like the command is there, but I have different passwords for the console and one for the putty for the same user.
I have tried to look for the reason why for the same user 'root' I have 2 different passwords (one for the virtual box console and one for the putty) that I can login with. I see different commands on each box. more than that when I share folder I can only see it on the virtual box console but not on the putty console) which is really frustrating.
How can I enforce that what I would see from putty would be the same as what I see from the virtual box console.
I think it somehow related to TTY but I am not sure.
EDIT:
running commands from the virtual box machine output:
grep "^passwd" /etc/nsswitch.conf
OUT: passwd: files sss
grep root /etc/passwd
OUT: rppt"x"0"0"root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
getent passwd root
OUT: root:x:0:0:root:/root:/bin/bash
EDIT:
I think this is all about docker containers. It seems like the machine 2222 port is the ssh port for the hdp 2.5 container and not for the hosting machine.
Now I get another problem. when running
docker exec sandbox ls
it is getting stuck. any help ?
Thanks for helpers
So now I had the time to analyze the sandbox vm, and write it up for other users.
As you stated correctly in your edit of the question, its the docker container setup of the sandbox, which confuses with two separate root users:
via ssh root#127.0.0.1 -p 2222 you get into the docker container called "sandbox". This is a CentOS release 6.8 (Final), containing all the HDP services, especially the ambari service. The configuration enforces a password change at first login for the root user. Inside this VM you can also execute the ambari-admin-password-reset and set there a password for the ambari admin.
via console access you reach the docker host running a Centos 7.2, here you can login with the default root password for the VM as found in the HDP docs.
Coming to your sub-question with the hanging docker exec, it seems to be a bug in that specific docker version. If you google that, you will find issues discussing this or similar problems with docker.
So I thought that it would be a good idea to just update the host via yum update. However this turned out to be a difficult path.
yum tried to update the kernel, but complained that there is not enough space on the boot partion.
So I moved the boot partion to the root partition:
edit /etc/fsab and comment out the boot entry
unmount /boot
mv /boot
cp -a /boot.org /boot
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda
reboot
After that I have found out that the docker configuration is broken and docker does not start anymore. In the logs it complained about
"Error starting daemon: error initializing graphdriver:
\"/var/lib/docker\" contains other graphdrivers: devicemapper; Please
cleanup or explicitly choose storage driver (-s )"
So I edited /etc/systemd/system/multi-user.target.wants/docker.service and changed the ExecStart setting to:
ExecStart=/usr/bin/dockerd --storage-driver=overlay
After a service docker start and a docker start sandbox. The container worked again and I could could login to the container and after a ambari-server restart everything worked again.
And now - with the new docker version 1.12.2, docker exec sandbox ls works again.
So to sum up the docker exec command has a bug in that specific version of the sandbox, but you should think twice if you want to upgrade your sandbox.
I ran into the same issue.
The HDP 2.5 sandbox runs all of its components in a docker container, but commands like docker exec -it sandbox /bin/bash or docker attach sandbox got stuck.
When I ran a simple ps aux, I found several /usr/bin/docker-proxy commands which looked like :
/usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 60000 -container-ip 172.17.0.2 -container-port 60000
They probably forward the HTTP ports of the various UIs of HDP components.
I could ssh into the container ip (here 172.17.0.2) using root/hadoop to authenticate. From there, I could use all "missing" commands like ambari-admin-password-reset.
$ ssh root#172.17.0.2
... # change password
$ ambari-admin-password-reset
NB: I am new to docker, so there's probably a better way to deal with this.
I'd like to post here the instructions for 3.0.1 here.
I followed the instructions of installing hortonworks version 3.0.1 here: https://youtu.be/5TJMudSNn9c
After running the docker container, go to your browser and enter "localhost:4200", that will take you to the in browser terminal of the container, that hosts ambari. Enter "root" for login and "hadoop" for password, change the root password, and then enter "ambari-admin-password-reset" in order to reset ambari password.
In order to be able to use sandbox-hdp.hortonworks.com, you need to add the line "127.0.0.1 sandbox-hdp.hortonworks.com" at the end of the /private/etc/hosts file on your mac.
Incorrect Pass
Then right corner click on power button >> power off drop down >> Restart >> when it boots up then press Esc key to get into recovery menu
Restart
select advance option and hit enter
Advance Option
Select Recovery mode hit enter
Select Root
Root enter
Command
mount -rw -o remount/
ls /home
change pass command
passwd username
user as yours
last step
enter pass two times by pressing enter
enter image description here
Hopefully you changed password (:

How can I let jprofiler find the PID of running tomcat server?

I extracted the jprofiler tar.gz on a remote linux server. After trying the bin/jpenable command I got:
'No unprofiled JVMs found.'
So I went looking for the PID of the running tomcat server and I think I found it in the var/run directory. A file called tomcat7.pid
So I went back to the source folder of jprofiler and tried: jpenable --pid=[the id that was in the pid file I mentioned earlier]
as specified on page 277 of the following document: http://resources.ej-technologies.com/jprofiler/help/doc/help.pdf and got:
No JVM with PID [the pid] found that is running as the same user.
So since the user I'm logged in as is ubuntu I tried to log in with user tomcat7 but even after giving up the correct password (which we changed with sudo) I remain logged in as ubuntu (as confirmed by whoami command) and the problem above persists.
How do I get this jprofiler to find the jvm I need it to??
Fixed.
We run tomcat as a service so we needed to add agentpath on startup of the jvm. Added the following to /usr/share/tomcat7/bin/setenv.sh :
-agentpath:/opt/jprofiler/jprofiler7/bin/linux-x64/libjprofilerti.so=port={port we want}
Then enabled that port on aws.

Cassandra in Docker unable to make directory on mounted volume

When I attempt to start the docker image tobert/cassandra from https://github.com/tobert/cassandra-docker I get the following error. Can anyone explain what this error means?
os.MkdirAll('/data/conf') failed: %!s(MISSING)
The command I am running is:
sudo docker run -v /data/cassandra:/data tobert/cassandra
I have created the directory /data/cassandra in my host os of RH Linux. I have even opened up the permissions all the way to see if it was a permission issue.
drwxrwxrwx. 2 root root 6 Apr 10 12:10 cassandra
Is SELinux enabled? You're doing everything right so something else must be blocking mkdir. Please check your syslog (RHEL <= 6.x) or journalctl (RHEL 7).

Permissions issue on cifs mount between Ubuntu and Mavericks

On my Linux box running Ubuntu 12.04LTS I am able to mount a share using cifs.
The shared folder in question is located at a Mac Pro running Mavericks.
Here is the fstab on the Ubuntu/Linux box.
//132.13.6.5/Data /home/sro/Mount cifs username=sro,password=psw,nounix,sec=ntlmssp,rw
/Mount on the Linux box has these permissions:
drwxr-xr-x 21 root root 0 Jan 16 13:29 Mount
I can read /Mount/Data but not write (I get a permission error).
I think this is because /Mount is created by root and I am trying this a user.
But I am unable to change /Mount permissions or ownership even using sudo.
On the Mac/Mavericks side, /Data has read/write permissions.
Any ideas how to solve this?
The issue here was a missing UID/GID pair. Apparently when those are absent the default owner of the share will be root.
So my fstab line should look like this:
//132.13.6.5/Data /home/sro/Mount cifs username=sro,password=psw,nounix,sec=ntlmssp,rw,uid=1001,gid=1001
Two things:
your UID/GID may not be 1001 so better check with the id command first
you may want to use permission masks as detailed here.
add to your fstab line uid=your_user_name your line will be:
//132.13.6.5/Data /home/sro/Mount cifs username=sro,password=psw,nounix,sec=ntlmssp,rw,uid=your_user_name
That way you are asking linux to set that user as owner of filesystem being mounted.

Resources