[jbosstools-issues] [JBoss JIRA] (JBIDE-15484) Provide support for scaled app when tailing log files
Andre Dietisheim (JIRA)
jira-events at lists.jboss.org
Wed Sep 25 10:16:03 EDT 2013
[ https://issues.jboss.org/browse/JBIDE-15484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12807338#comment-12807338 ]
Andre Dietisheim commented on JBIDE-15484:
------------------------------------------
When inspecting the whole thing in all details we found out that the current implementation is wrong/not working. We add in the *--gears* option in Eclipse to the tail command which is wrong and has no effect.
The *--gears* option in the *rhc* command line utility is consumbed by the command line utility, not the tail command that it sends to the backend(s).
When using the *rhc* cmd line you're giving the *--gears* option to the rhc ruby client:
{code}
rhc ssh --gears 'tail -f jbosseap/logs/*';
{code}
The ruby client then opens concurrent connections to all gears of the given application and concatenates the outputs to a single stream:
{code:title=rhc/lib/rhc/commands/ssh.rb}
if options.gears
groups = rest_client.find_application_gear_groups(options.namespace, app_name)
run_on_gears(command.join(' '), groups)
0
{code}
{code:title=rhc/lib/rhc/ssh_helpers.rb}
def run_on_gears(command, gears, opts={}, &block)
debug "Executing #{command} on each of #{gears.inspect}"
MultipleGearTask.new(command, gears, {:limit => options.limit, :always_prefix => options.always_prefix, :raw => options.raw}.merge(opts)).run(&block)
end
{code}
{code:title=rhc/lib/rhc/ssh_helpers.rb}
def run(&block)
out = nil
Net::SSH::Multi.start(
:concurrent_connections => @opts[:limit],
:on_error => lambda{ |server| $stderr.puts "Unable to connect to gear #{server}" }
) do |session|
{code}
Our implementation should do the same. It should go and get all gears and run tail on each gear, eventually having consoles for each gear.
> Provide support for scaled app when tailing log files
> -----------------------------------------------------
>
> Key: JBIDE-15484
> URL: https://issues.jboss.org/browse/JBIDE-15484
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.1.0.Final
> Reporter: Xavier Coulon
> Assignee: Xavier Coulon
> Fix For: 4.1.1.Alpha2, 4.2.0.Alpha1
>
>
> Seems like it's simply a matter of adding a '--gears' parameter in the ssh command when the application is scalable.
> The dialog could provide a checkbox (enabled by default) to let the user choose whether she wants to grab all logs or just those on the HA-Proxy
> See [~lincolnthree]'s blog post on the subject: http://ocpsoft.org/jboss/openshift-pro-tip-scaling-tail-server-logs-on-all-gears-of-your-app-at-once/
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list