我正在使用SSM文档,该文档预期每晚2h运行。我的时间表是这样的:cron(0 0 2 * * ?)
它与自动缩放组中的实例相关联。但是,每次创建一个新实例时,它也会启动SSM-Agent。在代理启动期间,它会执行我的SSM文档,而不会遵守计划。
您知道为什么在启动过程中会触发文档执行吗?
SSM代理的部分日志可以在下面找到:
2019-01-04 08:58:40 INFO Entering SSM Agent hibernate - NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2019-01-04 09:00:36 INFO Got signal:terminated value:0xb93040
2019-01-04 09:00:36 INFO Stopping agent
2019-11-19 17:16:21 INFO Create new startup processor
2019-11-19 17:16:21 INFO [LongRunningPluginsManager] registered plugins: {}
2019-11-19 17:16:22 INFO Initializing bookkeeping folders
2019-11-19 17:16:22 INFO removing the completed state files
2019-11-19 17:16:22 INFO Initializing bookkeeping folders for long running plugins
2019-11-19 17:16:22 INFO Initializing replies folder for MDS reply requests that couldn't reach the service
2019-11-19 17:16:22 INFO Initializing healthcheck folders for long running plugins
2019-11-19 17:16:22 INFO Initializing locations for inventory plugin
2019-11-19 17:16:22 INFO Initializing default location for custom inventory
2019-11-19 17:16:22 INFO Initializing default location for file inventory
2019-11-19 17:16:22 INFO Initializing default location for role inventory
2019-11-19 17:16:22 INFO Init the cloudwatchlogs publisher
2019-11-19 17:16:22 INFO Starting Agent: amazon-ssm-agent - v2.3.228.0
2019-11-19 17:16:22 INFO OS: linux, Arch: amd64
2019-11-19 17:16:22 INFO [MessagingDeliveryService] Starting document processing engine...
2019-11-19 17:16:22 INFO [OfflineService] [EngineProcessor] Starting
2019-11-19 17:16:22 INFO [OfflineService] [EngineProcessor] Initial processing
2019-11-19 17:16:22 INFO [instanceID=i-01b486f1e02679260] Starting association polling
2019-11-19 17:16:22 INFO [LongRunningPluginsManager] There are no long running plugins currently getting executed - skipping their healthcheck
2019-11-19 17:16:22 INFO [MessagingDeliveryService] [Association] [EngineProcessor] Starting
2019-11-19 17:16:22 INFO [MessagingDeliveryService] [Association] Launching response handler
2019-11-19 17:16:22 INFO [MessagingDeliveryService] [Association] [EngineProcessor] Initial processing
2019-11-19 17:16:22 INFO [MessagingDeliveryService] [Association] Initializing association scheduling service
2019-11-19 17:16:22 INFO [MessagingDeliveryService] [Association] Association scheduling service initialized
2019-11-19 17:16:22 INFO [OfflineService] Starting message polling
2019-11-19 17:16:22 INFO [OfflineService] Starting send replies to MDS
2019-11-19 17:16:22 INFO [StartupProcessor] Executing startup processor tasks
2019-11-19 17:16:22 INFO [StartupProcessor] Write to serial port: Amazon SSM Agent v2.3.228.0 is running
2019-11-19 17:16:22 INFO [StartupProcessor] Write to serial port: OsProductName: Amazon Linux
2019-11-19 17:16:22 INFO [StartupProcessor] Write to serial port: OsVersion: 2
2019-11-19 17:16:22 INFO [MessageGatewayService] Successfully created ssm-user
2019-11-19 17:16:22 INFO [MessageGatewayService] Successfully created file /etc/sudoers.d/ssm-agent-users
2019-11-19 17:16:22 INFO [MessageGatewayService] Successfully changed mode of /etc/sudoers.d/ssm-agent-users to 288
2019-11-19 17:16:22 INFO [MessageGatewayService] [EngineProcessor] Initial processing
2019-11-19 17:16:22 INFO [MessageGatewayService] SSM Agent is trying to setup control channel for Session Manager module.
2019-11-19 17:16:22 INFO [MessageGatewayService] Setting up websocket for controlchannel for instance: i-01b486f1e02679260, requestId: 2ea221ae-0ead-4bb9-a384-d7835c0cccab
2019-11-19 17:16:22 INFO [MessageGatewayService] listening reply.
2019-11-19 17:16:22 INFO [MessageGatewayService] Opening websocket connection to: %!(EXTRA string=wss://ssmmessages.eu-west-1.amazonaws.com/v1/control-channel/i-01b486f1e02679260?role=subscribe&stream=input)
2019-11-19 17:16:22 INFO [MessageGatewayService] Successfully opened websocket connection to: %!(EXTRA string=wss://ssmmessages.eu-west-1.amazonaws.com/v1/control-channel/i-01b486f1e02679260?role=subscribe&stream=input)
2019-11-19 17:16:22 INFO [MessageGatewayService] Starting receiving message from control channel
2019-11-19 17:16:34 INFO [MessagingDeliveryService] [messageID=aws.ssm.284d538b-305b-4db2-a337-2239cc2e88bf.i-01b486f1e02679260] Validating SSM parameters
2019-11-19 17:16:34 INFO [MessagingDeliveryService] Sending reply {
"additionalInfo": {
"agent": {
"lang": "en-US",
"name": "amazon-ssm-agent",
"os": "",
"osver": "1",
"ver": ""
},
"dateTime": "2019-11-19T17:16:34.069Z",
"runId": "",
"runtimeStatusCounts": null
},
"documentStatus": "InProgress",
"documentTraceOutput": "",
"runtimeStatus": null
}
2019-11-19 17:16:34 INFO [MessagingDeliveryService] SendReply Response{
Description: "Reply 663003e5-2cf1-4d1a-89c6-782927c26b0b was successfully sent.",
MessageId: "aws.ssm.284d538b-305b-4db2-a337-2239cc2e88bf.i-01b486f1e02679260",
ReplyId: "663003e5-2cf1-4d1a-89c6-782927c26b0b",
ReplyStatus: "QUEUED"
}
2019-11-19 17:16:34 INFO [MessagingDeliveryService] [EngineProcessor] [OutOfProcExecuter] [284d538b-305b-4db2-a337-2239cc2e88bf] failed to read the default channel root directory: open /var/lib/amazon/ssm/i-01b486f1e02679260/channels: no such file or directory, creating a new Channel
2019-11-19 17:16:34 INFO [MessagingDeliveryService] [EngineProcessor] [OutOfProcExecuter] [284d538b-305b-4db2-a337-2239cc2e88bf] inter process communication started
2019-11-19 17:16:35 INFO [ssm-document-worker] [284d538b-305b-4db2-a337-2239cc2e88bf] document: 284d538b-305b-4db2-a337-2239cc2e88bf worker started
2019-11-19 17:16:35 INFO [ssm-document-worker] [284d538b-305b-4db2-a337-2239cc2e88bf] channel: 284d538b-305b-4db2-a337-2239cc2e88bf found
2019-11-19 17:16:35 INFO [ssm-document-worker] [284d538b-305b-4db2-a337-2239cc2e88bf] inter process communication started
2019-11-19 17:16:35 INFO [ssm-document-worker] [284d538b-305b-4db2-a337-2239cc2e88bf] [DataBackend] received plugin config message
2019-11-19 17:16:35 INFO [ssm-document-worker] [284d538b-305b-4db2-a337-2239cc2e88bf] [DataBackend] {"DocumentInformation":.....
2019-11-19 17:16:35 INFO [ssm-document-worker] [284d538b-305b-4db2-a337-2239cc2e88bf] [DataBackend] Running plugin aws:runShellScript
2019-11-19 17:16:35 INFO [ssm-document-worker] [284d538b-305b-4db2-a337-2239cc2e88bf] [DataBackend] [pluginName=aws:runShellScript] aws:runShellScript started with configuration {<nil> map[runCommand:[....... }