You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by tracel <tr...@gmail.com> on 2016/03/29 11:08:51 UTC
How to script with visor cli?
Hi,
I am trying to write some script with the visor cli,
my first attempt is to connect visor to a cluster with a custom config, then
do a "cache" command
Visor seems don't allow both -cfg and -e:
# bin/ignitevisorcmd.sh -cfg=config/test-one.xml -e=cache
OpenJDK Server VM warning: ignoring option MaxPermSize=128M; support was
removed in 8.0
(wrn) <visor>: Options can't contains both -cfg and one of -b or -e
options.
Then I try put both "open" and "cache" into -e:
# bin/ignitevisorcmd.sh -e="open -cpath=config/test-one.xml";"cache"
OpenJDK Server VM warning: ignoring option MaxPermSize=128M; support was
removed in 8.0
___ _________________________ ________
__ | / /____ _/__ ___/__ __ \___ __ \
__ | / / __ / _____ \ _ / / /__ /_/ /
__ |/ / __/ / ____/ / / /_/ / _ _, _/
_____/ /___/ /____/ \____/ /_/ |_|
ADMIN CONSOLE
2015 Copyright(C) Apache Software Foundation
+----------------------------+
| Status | Disconnected |
| Grid name | <n/a> |
| Config path | <n/a> |
| Uptime | <n/a> |
+----------------------------+
Type 'help' for more information.
Type 'open' to join the grid.
Type 'quit' to quit form Visor console.
visor> open
Local configuration files:
+========================================================================================+
| # | Configuration File
|
+========================================================================================+
| 0 | config/default-config.xml
|
| 1 | (?) config/router/default-router.xml
|
| 2 | config/test-one.xml
|
| 3 | examples/config/example-cache.xml
|
| 4 | examples/config/example-default.xml
|
| 5 | (?) examples/config/example-ignite.xml
|
| 6 | examples/config/filesystem/example-igfs.xml
|
| 7 |
examples/src/main/java/org/apache/ignite/examples/misc/springbean/spring-bean.xml
|
| 8 | platforms/cpp/examples/config/example-cache.xml
|
| 9 | platforms/dotnet/examples/Config/example-cache-query.xml
|
| 10 | platforms/dotnet/examples/Config/example-cache-store.xml
|
| 11 | platforms/dotnet/examples/Config/example-cache.xml
|
| 12 | platforms/dotnet/examples/Config/example-compute.xml
|
+----------------------------------------------------------------------------------------+
Choose configuration file number ('c' to cancel) [0]: quit
(wrn) <visor>: Invalid selection: quit
visor> -bash: cache: command not found
It seems the visor was running the 'open' without the -cpath option, what's
wrong with the command?
Thanks in advance!
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-script-with-visor-cli-tp3733.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: How to script with visor cli?
Posted by tracel <tr...@gmail.com>.
thanks Vasiliy for the hint, finally got this right, found quotes within
quotes work, both of these seems to work fine:
bin/ignitevisorcmd.sh -e="'open -cpath=config/test-one.xml;cache'"
bin/ignitevisorcmd.sh -e='"open -cpath=config/test-one.xml;cache"'
f.e.:
# bin/ignitevisorcmd.sh -e='"open -cpath=config/test-one.xml;cache"'
OpenJDK Server VM warning: ignoring option MaxPermSize=128M; support was
removed in 8.0
___ _________________________ ________
__ | / /____ _/__ ___/__ __ \___ __ \
__ | / / __ / _____ \ _ / / /__ /_/ /
__ |/ / __/ / ____/ / / /_/ / _ _, _/
_____/ /___/ /____/ \____/ /_/ |_|
ADMIN CONSOLE
2015 Copyright(C) Apache Software Foundation
+----------------------------+
| Status | Disconnected |
| Grid name | <n/a> |
| Config path | <n/a> |
| Uptime | <n/a> |
+----------------------------+
Type 'help' for more information.
Type 'open' to join the grid.
Type 'quit' to quit form Visor console.
visor> open -cpath=config/test-one.xml
Mar 31, 2016 10:12:06 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from URL
[file:/root/apache-ignite/config/test-one.xml]
Mar 31, 2016 10:12:06 AM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing
org.springframework.context.support.GenericApplicationContext@80cdf3:
startup date [Thu Mar 31 10:12:06 HKT 2016]; root of context hierarchy
[10:12:06] __________ ________________
[10:12:06] / _/ ___/ |/ / _/_ __/ __/
[10:12:06] _/ // (7 7 // / / / / _/
[10:12:06] /___/\___/_/|_/___/ /_/ /___/
[10:12:06]
[10:12:06] ver. 1.5.0-final#20151229-sha1:f1f8cda2
[10:12:06] 2015 Copyright(C) Apache Software Foundation
[10:12:06]
[10:12:06] Ignite documentation: http://ignite.apache.org
[10:12:06]
[10:12:06] Quiet mode.
[10:12:06] ^-- Logging to file
'/root/apache-ignite/work/log/ignite-dbaab967.0.log'
[10:12:06] ^-- To see **FULL** console log here add
-DIGNITE_QUIET=false or "-v" to ignite.{sh|bat}
[10:12:06]
[10:12:06] OS: Linux 4.3.4-200.fc22.i686+PAE i386
[10:12:06] VM information: OpenJDK Runtime Environment 1.8.0_71-b15
Oracle Corporation OpenJDK Server VM 25.71-b15
[10:12:06] Configured plugins:
[10:12:06] ^-- None
[10:12:06]
[10:12:07] Security status [authentication=off, tls/ssl=off]
[10:12:08] To start Console Management & Monitoring run
ignitevisorcmd.{sh|bat}
[10:12:08]
[10:12:08] Ignite node started OK (id=dbaab967)
Some useful commands:
+--------------------------------------------+
| Type 'top' | to see full topology. |
| Type 'node' | to see node statistics. |
| Type 'cache' | to see cache statistics. |
| Type 'tasks' | to see tasks statistics. |
| Type 'config' | to see node configuration. |
+--------------------------------------------+
Type 'help' to get help.
+-----------------------------------+
| Status | Connected |
| Grid name | <default> |
| Config path | config/test-one.xml |
| Uptime | 00:00:00 |
+-----------------------------------+
visor> cache
(wrn) <visor>: No caches found.
(wrn) <visor>: Type 'help cache' to see how to use this command.
visor> quit
[10:12:08] Ignite node stopped OK [uptime=00:00:00:217]
+----------------------------+
| Status | Disconnected |
| Grid name | <n/a> |
| Config path | <n/a> |
| Uptime | <n/a> |
+----------------------------+
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-script-with-visor-cli-tp3733p3803.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: How to script with visor cli?
Posted by Vasiliy Sisko <vs...@gridgain.com>.
You could try another variant of quoting that works in Ubuntu terminal:
./ignitevisorcmd.sh -e=\"open -cpath=config/test-one.xml;cache\"
Possible that article will useful for you:
http://wiki.bash-hackers.org/syntax/quoting
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-script-with-visor-cli-tp3733p3804.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: How to script with visor cli?
Posted by tracel <tr...@gmail.com>.
Thank Vasiliy, but I still got the same kind of error with it, have try both
signle quote and double quote:
# bin/ignitevisorcmd.sh -e='open -cpath=config/test-one.xml;cache'
OpenJDK Server VM warning: ignoring option MaxPermSize=128M; support was
removed in 8.0
___ _________________________ ________
__ | / /____ _/__ ___/__ __ \___ __ \
__ | / / __ / _____ \ _ / / /__ /_/ /
__ |/ / __/ / ____/ / / /_/ / _ _, _/
_____/ /___/ /____/ \____/ /_/ |_|
ADMIN CONSOLE
2015 Copyright(C) Apache Software Foundation
+----------------------------+
| Status | Disconnected |
| Grid name | <n/a> |
| Config path | <n/a> |
| Uptime | <n/a> |
+----------------------------+
Type 'help' for more information.
Type 'open' to join the grid.
Type 'quit' to quit form Visor console.
visor> open
Local configuration files:
+========================================================================================+
| # | Configuration File
|
+========================================================================================+
| 0 | config/default-config.xml
|
| 1 | (?) config/router/default-router.xml
|
| 2 | config/test-one.xml
|
| 3 | examples/config/example-cache.xml
|
| 4 | examples/config/example-default.xml
|
| 5 | (?) examples/config/example-ignite.xml
|
| 6 | examples/config/filesystem/example-igfs.xml
|
| 7 |
examples/src/main/java/org/apache/ignite/examples/misc/springbean/spring-bean.xml
|
| 8 | platforms/cpp/examples/config/example-cache.xml
|
| 9 | platforms/dotnet/examples/Config/example-cache-query.xml
|
| 10 | platforms/dotnet/examples/Config/example-cache-store.xml
|
| 11 | platforms/dotnet/examples/Config/example-cache.xml
|
| 12 | platforms/dotnet/examples/Config/example-compute.xml
|
+----------------------------------------------------------------------------------------+
Choose configuration file number ('c' to cancel) [0]: quit
(wrn) <visor>: Invalid selection: quit
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-script-with-visor-cli-tp3733p3776.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: How to script with visor cli?
Posted by Vasiliy Sisko <vs...@gridgain.com>.
Hello @tracel.
Virtual machine incorrectly recognize command line arguments. It divide it
to pair:
-e=open
-cpath=config/test-one.xml";"cache"
Visor console execute open command and quit command as last command of
script.
To pass your command it should be properly escaped. Use strong quoting with
single-quotes:
-e='open -cpath=examples/config/example-ignite.xml;cache'
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-script-with-visor-cli-tp3733p3774.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.