Munin jmx configuration - java

I am trying to enable JMX monitoring on Munin
I have followed the guide at:
https://github.com/munin-monitoring/contrib/tree/master/plugins/java/jmx
It tells me:
1) Files from "plugin" folder must be copied to /usr/share/munin/plugins (or another - where your munin plugins located)
2) Make sure that jmx_ executable : chmod a+x /usr/share/munin/plugins/jmx_
3) Copy configuration files that you want to use, from "examples" folder, into /usr/share/munin/plugins folder
4) create links from the /etc/munin/plugins folder to the /usr/share/munin/plugins/jmx_
The name of the link must follow wildcard pattern:
jmx_<configname>,
where configname is the name of the configuration (config filename without extension), for example:
ln -s /usr/share/munin/plugins/jmx_ /etc/munin/plugins/jmx_process_memory
I have done exatly this but whern i run ./jmx_process_memory, I just get:
Error: Could not find or load main class org.munin.plugin.jmx.memory
The actual config file is called java_process_memory.conf, so i have also tried naming the symlink jmx_java_process_memory, but get the same error.
I have had success by naming the symlink jmx_Threads as described here:
http://blog.johannes-beck.name/?p=160
I can see that org.munin.plugin.jmx.Threads is the name of a class within munin-jmx-plugins.jar, and the other classes seem to work also. But this is not what the Munin guide tells me to do, so is the documentation wrong? What is the purpose of the config files, they must be there for a reason? There are example config files for Tomcat, which is where my real interest lies, so I need to understand this. Without being able the get it working as per the guide though im a bit stuck!
Can anyone put me right on this?
Cheers
NFV

I was stuck with somehow the same issue.
What i did to get something working a little bit better but still not perfectly.
I'm on RHEL :
[root#bus|in plugins]# cat /etc/munin/plugin-conf.d/munin-node
[diskstats]
user munin
[iostat_ios]
user munin
[jmx_*]
env.ip 192.168.1.101
env.port 5054 <- being the port configured for your jmx
then
[root#bus|in plugins]# ls -l /etc/munin/plugins/jmx_MultigraphAll
lrwxrwxrwx 1 root root 29 14 mars 15:36 /etc/munin/plugins/jmx_MultigraphAll -> /usr/share/munin/plugins/jmx_
and I modified the /usr/share/munin/plugins/jmx_ with the following :
#!/bin/sh
# -*- sh -*-
: << =cut
=head1 NAME
jmx_ - Wildcard plugin to monitor Java application servers via JMX
=head1 APPLICABLE SYSTEMS
Tested with Tomcat 4.1/5.0/5.5/6.0 on Sun JVM 5/6 and OpenJDK.
Any JVM that supports JMX should in theory do.
Needs nc in path for autoconf.
=head1 CONFIGURATION
[jmx_*]
env.ip 127.0.0.1
env.port 5400
env.category jvm
env.username monitorRole
env.password SomethingSecret
env.JRE_HOME /usr/lib/jvm/java-6-sun/jre
env.JAVA_OPTS -Xmx128m
Needed configuration on the Tomcat side: add
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=5400 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false
to CATALINA_OPTS in your startup scripts.
Replace authenticate=false with
-Dcom.sun.management.jmxremote.password.file=/etc/tomcat/jmxremote.password \
-Dcom.sun.management.jmxremote.access.file=/etc/tomcat/jmxremote.access
...if you want authentication.
jmxremote.password:
monitorRole SomethingSecret
jmxremote.access:
monitorRole readonly
You may need higher access levels for some counters, notably ThreadsDeadlocked.
=head1 BUGS
No encryption supported in the JMX connection.
The plugins available reflect the most interesting aspects of a
JVM runtime. This should be extended to cover things specific to
Tomcat, JBoss, Glassfish and so on. Patches welcome.
=head1 AUTHORS
=encoding UTF-8
Mo Amini, Diyar Amin and Younes Hajji, Høgskolen i Oslo/Oslo
University College.
Shell script wrapper and integration by Erik Inge Bolsø, Redpill
Linpro AS.
Previous work on JMX plugin by Aleksey Studnev. Support for
authentication added by Ingvar Hagelund, Redpill Linpro AS.
=head1 LICENSE
GPLv2
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf suggest
=cut
MUNIN_JAR="/usr/share/java/munin-jmx-plugins.jar"
if [ "x$JRE_HOME" != "x" ] ; then
JRE=$JRE_HOME/bin/java
export JRE_HOME=$JRE_HOME
fi
JAVA_BIN=${JRE:-/opt/jdk/jre/bin/java}
ip=${ip:-192.168.1.101}
port=${port:-5054}
if [ "x$1" = "xsuggest" ] ; then
echo MultigraphAll
exit 0
fi
if [ "x$1" = "xautoconf" ] ; then
NC=`which nc 2>/dev/null`
if [ "x$NC" = "x" ] ; then
echo "no (nc not found)"
exit 0
fi
$NC -n -z $ip $port >/dev/null 2>&1
CONNECT=$?
$JAVA_BIN -? >/dev/null 2>&1
JAVA=$?
if [ $JAVA -ne 0 ] ; then
echo "no (java runtime not found at $JAVA_BIN)"
exit 0
fi
if [ ! -e $MUNIN_JAR ] ; then
echo "no (munin jmx classes not found at $MUNIN_JAR)"
exit 0
fi
if [ $CONNECT -eq 0 ] ; then
echo "yes"
exit 0
else
echo "no (connection to $ip:$port failed)"
exit 0
fi
fi
if [ "x$1" = "xconfig" ] ; then
param=config
else
param=Tomcat
fi
scriptname=${0##*/}
jmxfunc=${scriptname##*_}
prefix=${scriptname%_*}
if [ "x$jmxfunc" = "x" ] ; then
echo "error, plugin must be symlinked in order to run"
exit 1
fi
ip=$ip port=$port $JAVA_BIN -cp $MUNIN_JAR $JAVA_OPTS org.munin.plugin.jmx.$jmxfunc $param $prefix
And you have to add the right permissions and owner:group on what you define as the JRE, for example here :
[root#bus|in plugins]# ls -ld /opt/jdk
drwxrwxr-x 8 nobody nobody 4096 8 oct. 15:03 /opt/jdk
Now I can run (and I can see it's using nobody:nobody as user:group, maybe something to play with in the conf) :
[root#bus|in plugins]# munin-run jmx_MultigraphAll -d
# Processing plugin configuration from /etc/munin/plugin-conf.d/df
# Processing plugin configuration from /etc/munin/plugin-conf.d/fw_
# Processing plugin configuration from /etc/munin/plugin-conf.d/hddtemp_smartctl
# Processing plugin configuration from /etc/munin/plugin-conf.d/munin-node
# Processing plugin configuration from /etc/munin/plugin-conf.d/postfix
# Processing plugin configuration from /etc/munin/plugin-conf.d/sendmail
# Setting /rgid/ruid/ to /99/99/
# Setting /egid/euid/ to /99 99/99/
# Setting up environment
# Environment ip = 192.168.1.101
# Environment port = 5054
# About to run '/etc/munin/plugins/jmx_MultigraphAll'
multigraph jmx_memory
Max.value 2162032640
Committed.value 1584332800
Init.value 1613168640
Used.value 473134248
multigraph jmx_MemoryAllocatedHeap
Max.value 1037959168
Committed.value 1037959168
Init.value 1073741824
Used.value 275414584
multigraph jmx_MemoryAllocatedNonHeap
Max.value 1124073472
Committed.value 546373632
Init.value 539426816
Used.value 197986088
[...]
multigraph jmx_ProcessorsAvailable
ProcessorsAvailable.value 1
Now I'm trying to get it to work for different JVMs on the same host, because this is for a single one.
I hope that can help you.
edit :
actually I did the modifications to use with several java processes having their own jmx ports.
What you have to add them there :
[root#bus|in plugins]# cat /etc/munin/plugin-conf.d/munin-node
[diskstats]
user munin
[iostat_ios]
user munin
[admin_jmx_*]
env.ip 192.168.1.101
env.port 5054
[managed_jmx_*]
env.ip 192.168.1.101
env.port 5055
[jboss_jmx_*]
env.ip 192.168.1.101
env.port 1616
and then create the links :
[root#bus|in plugins]# ls -l /etc/munin/plugins/*_jmx_*
lrwxrwxrwx 1 root root 29 14 mars 15:36 /etc/munin/plugins/admin_jmx_MultigraphAll -> /usr/share/munin/plugins/jmx_
lrwxrwxrwx 1 root root 29 14 mars 16:51 /etc/munin/plugins/jboss_jmx_MultigraphAll -> /usr/share/munin/plugins/jmx_
lrwxrwxrwx 1 root root 29 14 mars 16:03 /etc/munin/plugins/managed_jmx_MultigraphAll -> /usr/share/munin/plugins/jmx_
and I commented out the ip and port from the /usr/share/munin/plugins/jmx_ file, but I'm not sure it plays a role.

Related

Apache druid No known server

I am trying to setup the Apache Druid on a single machine following quickstart guide here. When I start historical server, it shows io.druid.java.util.common.IOE: No known server exception on screen.
Command:
java `cat conf-quickstart/druid/historical/jvm.config xargs` \
-cp "conf-quickstart/druid/_common:conf-quickstart/druid/historical:lib/*" \
io.druid.cli.Main server historical
Full stack-trace-
2018-04-07T18:23:40,234 WARN [main]
io.druid.java.util.common.RetryUtils - Failed on try 1, retrying in
1,246ms. io.druid.java.util.common.IOE: No known server at
io.druid.discovery.DruidLeaderClient.getCurrentKnownLeader(DruidLeaderClient.java:276)
~[druid-server-0.12.0.jar:0.12.0] at
io.druid.discovery.DruidLeaderClient.makeRequest(DruidLeaderClient.java:128)
~[druid-server-0.12.0.jar:0.12.0] at
io.druid.query.lookup.LookupReferencesManager.fetchLookupsForTier(LookupReferencesManager.java:569)
~[druid-server-0.12.0.jar:0.12.0] at
io.druid.query.lookup.LookupReferencesManager.tryGetLookupListFromCoordinator(LookupReferencesManager.java:420)
~[druid-server-0.12.0.jar:0.12.0] at
io.druid.query.lookup.LookupReferencesManager.lambda$getLookupListFromCoordinator$4(LookupReferencesManager.java:398)
~[druid-server-0.12.0.jar:0.12.0] at
io.druid.java.util.common.RetryUtils.retry(RetryUtils.java:63)
[java-util-0.12.0.jar:0.12.0] at
io.druid.java.util.common.RetryUtils.retry(RetryUtils.java:81)
[java-util-0.12.0.jar:0.12.0] at
io.druid.query.lookup.LookupReferencesManager.getLookupListFromCoordinator(LookupReferencesManager.java:388)
[druid-server-0.12.0.jar:0.12.0]
I have tried to setup from scratch many times with exactly the same steps mentioned on quick-start guide, but I am unable to resolve this error. How to resolve this error?
If you already tried to start druid, then delete the druid-X.Y.Z/log and druid-X.Y.Z/var folders.
Start zookeeper ./zookeeper-X.Y.Z/bin/zkServer.sh start
Recreate those folders you erased with druid-X.Y.Z/bin/init
Run each command in a new tab in this order
java `cat conf-quickstart/druid/coordinator/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/coordinator:lib/*" io.druid.cli.Main server coordinator
java `cat conf-quickstart/druid/overlord/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/overlord:lib/*" io.druid.cli.Main server overlord
java `cat conf-quickstart/druid/broker/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/broker:lib/*" io.druid.cli.Main server broker
java `cat conf-quickstart/druid/historical/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/historical:lib/*" io.druid.cli.Main server historical
java `cat conf-quickstart/druid/middleManager/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/middleManager:lib/*" io.druid.cli.Main server middleManager
You should now have 1 tab open for each of those commands (so 5).
Insert the data curl -X 'POST' -H 'Content-Type:application/json' -d #quickstart/wikiticker-index.json localhost:8090/druid/indexer/v1/task
You will then see {"task":"index_hadoop_wikiticker_2018-06-06T19:17:51.900Z"}

Error registering PhantomJS node in Selenium Grid

I have the following problem
I successfully launched Selenium Grid hub with:
java -jar selenium-server-standalone-2.53.0.jar -role hub
After that I tried to launch PhantomJS node with:
phantomjs --webdriver=8090 --webdriver-selenium-grid-hub=http://localhost:4444
but got Error:
[INFO - 2016-03-25T13:56:28.397Z] GhostDriver - Main - running on
port 8090 [INFO - 2016-03-25T13:56:28.397Z] GhostDriver - Main -
registering to Selenium HUB 'http://localhost:4444' version: using
'127.0.0.1:8090' with
org.openqa.grid.selenium.proxy.DefaultRemoteProxy as remote proxy.
[ERROR - 2016-03-25T13:56:28.400Z] GhostDriver - main.fail -
{"line":97,"sourceURL":"phantomjs://platform/hub_register.js","stack":"register#phantomjs://platform/hub_register.js:97:79\nglobal
code#phantomjs://code/main.js:78:37"}
phantomjs://platform/console++.js:263 in error
Standard node works ok, but PhantomJS failes. What I'm doing wrong?
For anyone still looking, there are linux and windows x64 builds available here with the workaround of v2.1.1 (windows build is on a pull request - the hex editor workaround wont work for windows cos the .exe's are compressed)
https://github.com/mrorgues/PhantomJSCustomEdition
workaround***
d/l source from phantomjs http://phantomjs.org/build.html and edit hub_register.js in the src/ghostdriver
comment out lines as shown below:
//var ghostdriver = ghostdriver || {};
return {
capabilities: [{
browserName: "phantomjs",
version: version,
//platform: ghostdriver.system.os.name + '-' + ghostdriver.system.os.version + '-' + ghostdriver.system.os.architecture,
maxInstances: 1,
seleniumProtocol: "WebDriver"
compile and everything works!
shortcut:
https://github.com/darwin10/phantomjs
Original Source : https://github.com/detro/ghostdriver/issues/394
Try replacing localhost with local IP
phantomjs --webdriver=8090 --webdriver-selenium-grid-hub=http://localhost:4444
with
phantomjs --webdriver=8090 --webdriver-selenium-grid-hub=http://127.0.0.1:4444
You can override part of binary file with the dd command.
I'm going to replace platform: with //atform::
$ cp /usr/local/bin/phantomjs .
$ ./phantomjs --version
2.1.1
$ xxd -c 16 phantomjs | grep -C 2 'platform:'
01c6aaa0: 7273 696f 6e3a 2076 6572 7369 6f6e 2c0a rsion: version,.
01c6aab0: 2020 2020 2020 2020 2020 2020 2020 2020
01c6aac0: 706c 6174 666f 726d 3a20 6768 6f73 7464 platform: ghostd
01c6aad0: 7269 7665 722e 7379 7374 656d 2e6f 732e river.system.os.
01c6aae0: 6e61 6d65 202b 2027 2d27 202b 2067 686f name + '-' + gho
$ printf '//' | dd of=phantomjs conv=notrunc bs=1 seek=$((0x01c6aac0+0))
2+0 records in
2+0 records out
2 bytes transferred in 0.000117 secs (17085 bytes/sec)
$ xxd phantomjs | grep 'atform:'
01c6aac0: 2f2f 6174 666f 726d 3a20 6768 6f73 7464 //atform: ghostd
$ ./phantomjs --version
2.1.1
$ mv phantomjs /usr/local/bin/
If you cannot locate the string, try to increase octets per line (xxd -c 256).
I have spent 2 months trying to fix this problem, trying everything possible, my main issue was that many solutions won't connect to the grid, and ones that do are in docker containers what can only connect to a local grid hosted on the same Docker host.
So... I finally built my own solution which works:
https://github.com/madhavajay/selenium-node-phantomjs
Docker image is madhavajay/selenium-node-phantomjs
It uses PhantomJS 2.1.1 Custom Build with fixed Ghostdriver and then my own tweaks to the latest fork of Ghostdriver to allow a custom --remoteHost param all wrapped up in a Docker Container with configurable Environment Variables.
I hope this saves someone the lost weeks I suffered.
I had the same issue. Instead of downloading the source code and compiling, as suggested by Ojen G., I used a fix posted by neuro-sys to make the change in the executable. My OS is Ubuntu 16.04.
Download replacestrings.c program.
wget https://gist.githubusercontent.com/neuro-sys/3bf00b6cf28a93e07e44/raw/52f715fd49fbd271a9450b61d5cd3cf29907a5a0/replacestring.c
Compile program
gcc replacestring.c -o replacestring
Replace Java source code string in binary, creating fixed binary.
./replacestring "$(strings /usr/lib/phantomjs/phantomjs | grep "platform: ghostdriver")" " " < /usr/lib/phantomjs/phantomjs > f_phantomjs
Make binary executable; and put as replacement
chmod +x f_phantomjs
sudo chown root:root f_phantomjs
sudo mv f_phantomjs /usr/lib/phantomjs
cd /usr/lib/phantomjs
sudo echo "Fixed error in phantomjs; old file in e_phantomjs" > README.txt
sudo mv phantomjs e_phantomjs
sudo ln f_phantomjs phantomjs
After these steps, it runs fine (Selenium hub already running):
phantomjs --webdriver=8080 --webdriver-selenium-grid-hub=http://localhost:4444
[INFO - 2016-05-07T16:33:35.534Z] GhostDriver - Main - running on port 8080
[INFO - 2016-05-07T16:33:35.534Z] GhostDriver - Main - registering to Selenium HUB 'http://localhost:4444' version: using '127.0.0.1:8080' with org.openqa.grid.selenium.proxy.DefaultRemoteProxy as remote proxy.
[INFO - 2016-05-07T16:33:35.604Z] HUB Register - register - Registered with grid hub: http://localhost:4444/ (ok)
Following this gist:
https://gist.github.com/neuro-sys/41e368839a9b20dafb34
Editing the binary to put a // in front of the offending line worked for me, but not the string replace thing.
-> Follow the part about using hdex
Search for platform:
and replace with //atform:
by replacing the letters pl with // (2F2F in hex)

class: Configuration not found on when simulating Hadoop YARN SLS

I am trying to simulate Hadoop YARN SLS (Scheduling Load Simulator) with the sources given in Hadoop's GitHub and the SLS source files are located in [REF-1].
Here the step I have done :
Using VMWARE as the Host.
Using Ubuntu 14.04
Installing Hadoop v 2.6.0 [REF-2]
User : hduser | group : hadoop
Installing any needed packages (e.g. maven)
Get the clonning file of Hadoop's GitHub [REF-1]
Syntax : git clone https://git.apache.org/hadoop.git
Result : hduser#ubuntu:~/hadoop$
I made the changes inside directory hduser#ubuntu:~/hadoop/hadoop-tools$
FYI : I used the codes from MaxinetSLS [REF-3] as the way I compile the source files. The SLS source files can be downloaded by using this syntax in Linux : git clone https://github.com/wette/netSLS.git. By default, I can run this program with no error. The SLS Simulator can work perfectly.
From MaxiNetSLS's source files, I copied this files below into my work in hduser#ubuntu:~/hadoop/hadoop-tools$ :
netSLS/generator > hduser#ubuntu:~/hadoop/hadoop-tools$
netSLS/html > hduser#ubuntu:~/hadoop/hadoop-tools$
netSLS/sls.sh > hduser#ubuntu:~/hadoop/hadoop-tools$
netSLS/sls/hadoop/ > hduser#ubuntu:~/hadoop/hadoop-tools/hadoop-sls$
Then, I modified some files as follows.
netSLS/sls.sh
#!/usr/bin/env bash
function print_usage {
echo -e "usage: sls.sh TraceFile"
echo -e
echo -e "Starts SLS with the given trace file."
}
if [[ -z $1 ]]; then
print_usage
exit 1
fi
TRACE_FILE=$(realpath $1)
if [[ ! -f ${TRACE_FILE} ]]; then
echo "File not found: ${TRACE_FILE}"
print_usage
exit 1
fi
cd hadoop-sls
OUTPUT_DIRECTORY="/tmp/sls"
mkdir -p ${OUTPUT_DIRECTORY}
ARGS="-inputsls ${TRACE_FILE}"
ARGS+=" -output ${OUTPUT_DIRECTORY}"
ARGS+=" -printsimulation"
mvn exec:java -Dexec.args="${ARGS}"
hduser#ubuntu:~/hadoop/hadoop-tools/hadoop-sls/pom.xml$
[REF-4]
hduser#ubuntu:~/hadoop/hadoop-tools$ nano hadoop-sls/hadoop/etc/hadoop/sls-runner.xml
[REF-5]
Next step, I try to :
Compile the script using hduser#ubuntu:~/hadoop/hadoop-tools/hadoop-sls$ mvn compile
Compiled with no error (mvn_compile_perfect.jpg).
Run the program using hduser#ubuntu:~/hadoop/hadoop-tools$ ./sls.sh generator/small.json
Got the error here (error_json_compile.jpg). :(
Until now, I have went through some information related with similar problems I faced [REF-6] and tried it, but I still get the same problem. I guess I think the problem is in the ~/hadoop/hadoop-tools/hadoop-sls/pom.xml I mistakenly modified. I have lack of knowledge with Linux Environment. :(
References : http://1drv.ms/21zcJIH (txt file)
*Cannot post more than 2 links in my post. :(

How start jboss service remotely with SSH?

I need to start the service of Jboss 7.1.1 remotely through SSH. But when execute the command does not happened.
The command: ssh user#server '/etc/init.d/jboss-as start' #(no error, no service started)
The script jboss-as:
#!/bin/sh
case "$1" in
start)
echo "Starting JBoss AS 7"
su --command "/path/to/jboss-as-7.1.1.Final/bin/standalone.sh >& /dev/null &" root
;;
stop)
echo "Stopping JBoss AS 7"
su --command "/path/to/jboss-as-7.1.1.Final/bin/jboss-cli.sh --connect command=:shutdown" root
;;
*)
echo "Usage: /etc/init.d/jboss-as {start|stop}"
exit 1
;;
esac
exit 0
How to execute the command: ssh user#server 'service jboss-as start' or ssh user#server '/etc/init.d/jboss-as start'?
The connection with ssh is OK
The Jboss Server is OK
If i execute the code: ssh user#server '/etc/init.d/mysql restart' it happens!
One of a few things are limiting your ability to run this service with the command as that is a valid method of starting the service.
user#server '/etc/init.d/jboss-as start'
All of which you can test remotely after initiating the SSH connection. SSH into the server and start the service with the same user you are going to connect with using the above command.
Firstly make sure the service is actually called 'jboos-as' with ls /etc/init.d/ |grep 'jboss'. The result will be exactly how you will call the command so replace jboss-as with the output from the grep.
Secondly it is a permissions issue on the init script. From what I could see online you have to create this script so if the permissions are not setup correctly it will not execute.
To check run ls -al /etc/init.d/ |grep 'jboss' and your output should appear as follows:
Output:
-rwxr-xr-x. 1 root root 2979 Sep 19 05:34 jboss*
The user issuing the start command will need to match the first user listed. In this case the first 'root' and/or be in the same group as the group listing which is the second 'root' in the example. This can vary if for instance your user is in the wheel group, but generally services are run as root or a specific user for that service.
Lastly The more important aspect is that the file is executable. This is listed as the x value in the ls -al output above. If no 'x's are listed you will need to make the file executable with the following:
chmod +x /etc/init.d/jboss
IMPORTANT all the above command will need you to referrence the file as it output in the first grep command, so /etc/init.d/jboss-as or /etc/init.d/jboss or /etc/init.d/jboss-something different.
I hope this helps you out and if it does not please post the results of the ls -al output and we can help you further.
Ok.
Let`s go.
Search the name of the jboss service:
ls /etc/init.d/ |grep 'jboss' Returned "jboss-as". It is ok!
Permissions:
ls -al /etc/init.d/ |grep 'jboss' Returned exactly the same output: -rwxr-xr-x. 1 root root 2979 Sep 19 05:34 jboss-as Its ok!
Still do not works.
The principal objective to execute this command is an action of button in the Java program using SWT and the lib that implements SSH called JSCH. Look the code:
Session session = jsch.getSession("user", "SERVER_IP_ADDRESS", PORT);
session.setPassword("pass");
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
session.connect();
Channel channel = session.openChannel("exec");
((ChannelExec)channel).setCommand("'/etc/init.d/jboss-as start'"); #command to start jboss service
channel.setInputStream(null);
((ChannelExec)channel).setErrStream(System.err);
InputStream in=channel.getInputStream();
channel.connect();

Unable To Download code From Appengine - Java

The below is the code I am trying to execute to download the source code from AppEngine:
/Users/sridhar/Desktop/backupdata/appengine-java-sdk-1.7.4/bin/appcfg.sh download_app -A maharasims2 -V 23 download_app .
I am getting the Bad Format error:
Bad argument: Expected download directory as an argument after download_app.
AppCfg [options] -A app_id [ -V version ] download_app <out-dir>
Download a previously-uploaded app to the specified directory. The app
ID is specified by the "-A" option. The optional version is specified
by the "-V" option.
Can anyone help me out?
I tried the following and it worked.
Step 1: jdk/bin/appcfg.sh -A < apppid > -V < version > download_app < directory >
Example :
/Users/Desktop/appengine-java-sdk-1.7.4/bin/appcfg.sh -A testapp -V 23 download_app ~/Desktop/backupdata/downloads/
Step 2: http://architecturalatrocities.com/post/19073788679/fixing-the-trustanchors-problem-when-running-openjdk-7
Note :
Use step 2 if you are encountering the following error :
"java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty"
The options should go before the command:
appcfg.sh -A maharasims2 -V 23 download_app .

Categories

Resources