运行Sumo Collector Docker容器时Wrapper异常停止求助
问题
按照Sumo Collector镜像指引执行启动命令:
docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name="sumo-logic-collector" sumologic/collector:latest AccessID AccessKey
容器启动后立即退出,日志输出如下:
Running SumoLogic Collector... wrapper | The version of the script (3.5.49.1) doesn't match the version of this Wrapper (3.5.49). This might cause some problems wrapper | --> Wrapper Started as Console ]0;Sumo Logic Collectorwrapper | Java Service Wrapper Standard Edition 64-bit 3.5.49 wrapper | Copyright (C) 1999-2022 Tanuki Software, Ltd. All Rights Reserved. wrapper | http://wrapper.tanukisoftware.com wrapper | Licensed to Sumo Logic Inc. for Collector wrapper | wrapper | Launching a JVM... jvm 1 | WrapperManager: Initializing... jvm 1 | . . . . . . . . . jvm 1 | .+'|=|`+. .+'| |`+. .+'|=|`+.=|`+. .+'|=|`+. jvm 1 | | | `+.| | | | | | | `+ | `+ | | | | | jvm 1 | | | . | | | | | | | | | | | | | | jvm 1 | `+.|=|`+. | | | | | | | | | | | | | | jvm 1 | . | | | | | | | | | | | | | | | | jvm 1 | |`+. | | | | | | | | | | | | | | | | jvm 1 | `+.|=|.+' `+.|=|.+' `+.| |.| |+' `+.|=|.+' jvm 1 | Sumo Logic Collector Version 19.461-1 jvm 1 | Sumo Logic Build Hash e948f52189e8 jvm 1 | current folder:/opt/SumoCollector jvm 1 | * See /opt/SumoCollector/./logs for more details. jvm 1 | WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release jvm 1 | WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release jvm 1 | WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release jvm 1 | WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release jvm 1 | ERROR StatusConsoleListener Appender Console cannot be located. Route ignored jvm 1 | ERROR StatusConsoleListener Appender Console cannot be located. Route ignored jvm 1 | usage: <program> jvm 1 | -b,--blades <arg> Deprecated. Equivalent jvm 1 | to sources option jvm 1 | (optional). jvm 1 | -c,--clobber If there is any jvm 1 | existing collector jvm 1 | with the same name, jvm 1 | that collector will be jvm 1 | deleted. jvm 1 | -category,--category <arg> Source category for jvm 1 | Collector (optional). jvm 1 | -cim,--instructionMode Auto start command jvm 1 | channel with service jvm 1 | on startup. jvm 1 | -description,--description <arg> Description for jvm 1 | Collector (optional). jvm 1 | -disableUpgrade,--disableUpgrade Collector rejects the jvm 1 | upgrade requests. jvm 1 | -enableActionSource,--enableActionSource Collector allows jvm 1 | script action source jvm 1 | -enableScriptSource,--enableScriptSource Collector allows jvm 1 | script source jvm 1 | -fields,--fields <arg> Fields for Collector jvm 1 | (optional). jvm 1 | -fipsJce,--fipsJce Collector will be use jvm 1 | FIPS-compliant JCE jvm 1 | Provider for jvm 1 | communicating with jvm 1 | Sumo. jvm 1 | -forwardingRules,--forwardingRules <arg> A JSON file describing jvm 1 | a set of destinations jvm 1 | and destination jvm 1 | forwarding rules. jvm 1 | (Optional) jvm 1 | -h,--home <arg> Collector home jvm 1 | (optional) jvm 1 | -hostName,--hostName <arg> Host name for jvm 1 | Collector (optional). jvm 1 | -i,--accessid <arg> Access id for jvm 1 | registration jvm 1 | (optional). jvm 1 | -k,--accesskey <arg> Access key for jvm 1 | registration jvm 1 | (optional). jvm 1 | -n,--name <arg> Name to register jvm 1 | collector as. jvm 1 | -proxyHost,--proxyHost <arg> Proxy host (optional). jvm 1 | -proxyNtlmDomain,--proxyNtlmDomain <arg> NTLM user jvm 1 | domain(optional). jvm 1 | -proxyPassword,--proxyPassword <arg> Proxy user jvm 1 | password(optional). jvm 1 | -proxyPort,--proxyPort <arg> Proxy port (optional). jvm 1 | -proxyUser,--proxyUser <arg> Proxy user (optional). jvm 1 | -r,--retry Registration of jvm 1 | collector will be jvm 1 | retried if it fails on jvm 1 | the first try. jvm 1 | -restForwardMetadata,--restForwardMetadata <arg> Add metadata to data jvm 1 | being forwarded to a jvm 1 | rest sink (optional). jvm 1 | -s,--sources <arg> A JSON file describing jvm 1 | file sources to jvm 1 | configure on jvm 1 | registration jvm 1 | (optional). jvm 1 | -skipAccessKeyRemoval,--skipAccessKeyRemoval Skip the removal of jvm 1 | access key from jvm 1 | user.properties jvm 1 | -syncSources,--syncSources <arg> A JSON file describing jvm 1 | file sources. Use this jvm 1 | option instead of jvm 1 | "sources" if you wish jvm 1 | the Collector to jvm 1 | continuously monitor jvm 1 | this file and jvm 1 | synchronize the jvm 1 | collector jvm 1 | configuration jvm 1 | according to changes jvm 1 | in this file. jvm 1 | (Optional) jvm 1 | -t,--ephemeral Collector will be jvm 1 | deleted after goes jvm 1 | offline for a certain jvm 1 | period of time. jvm 1 | -targetCPU,--targetCPU <arg> CPU target expressed jvm 1 | as a percentage jvm 1 | (optional). jvm 1 | -timeZone,--timeZone <arg> Time zone for jvm 1 | Collector (optional). jvm 1 | -token,--token <arg> Security token for jvm 1 | registration jvm 1 | (optional). jvm 1 | -u,--url <arg> URL to Sumo Service jvm 1 | (optional). jvm 1 | -z,--installerMode When in installer jvm 1 | mode, Collector will jvm 1 | provide feedback about jvm 1 | registration through jvm 1 | an installer results jvm 1 | file. wrapper | <-- Wrapper Stopped
已创建AccessID和AccessKey,其余配置使用默认值,询问是否遗漏关键配置。
解决方案
从日志中的usage: <program>输出可以明确,容器启动命令的参数格式错误,直接将AccessID和AccessKey放在镜像名后无法被Collector识别,导致程序输出帮助信息后退出。正确的做法是使用指定参数标识传递凭证:
- 正确的启动命令需要用
-i指定AccessID,-k指定AccessKey;如果需要采集Docker日志,还需挂载sources配置文件(默认配置可从SumoLogic官方渠道获取后保存到本地):
docker run -d \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /本地保存路径/sumo-sources.json:/etc/sumo-sources.json \ --name="sumo-logic-collector" \ sumologic/collector:latest \ -i 你的AccessID \ -k 你的AccessKey \ -s /etc/sumo-sources.json
- 核心问题:原命令未使用
-i和-k参数标识,Collector无法解析传入的凭证信息,这是容器启动后立即退出的根本原因。 - 可选调整:若无需自定义日志采集规则,可省略
-s参数,但挂载默认sources配置能确保Docker日志采集功能正常启用。
内容的提问来源于stack exchange,提问作者Vu Quang Thach
相关产品推荐
相关产品推荐

