Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy JMX related files instead of moving to support jmx on k8s #5045

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion common/scala/copyJMXFiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

if [[ $( ls /conf/jmxremote.* 2> /dev/null ) ]]
then
mv /conf/jmxremote.* /home/owuser
# JMX auth files would be mounted as a symbolic link (read-only mode)
# with `root` privileges by the k8s secret.
cp -rL /conf/jmxremote.* /home/owuser
rm -f /conf/jmxremote.* 2>/dev/null || true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note. The files can not be removed in the k8s because it's read-only mounted, so I hide the message and returns true. But in the default (Bare-metal, VM..) environment, the file can be removed.

bash-4.4$ rm -f jmxremote.*
rm: can't remove 'jmxremote.access': Resource busy
rm: can't remove 'jmxremote.password': Resource busy


# The owner must be `owuser` and the file only have read permission.
chmod 600 /home/owuser/jmxremote.*
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note. The mounted files (/conf/jmxremote.*) cannot be used directly, it's limitation of JMX.

If the auth file has permissions other than read, the following error occurs:
"Password file read access must be restricted"

fi