DC/OS Poststart Checks 超时报错

报错:

{{{}}
{{ "error": "One or more requested checks failed to execute.",}}
{{ "checks": [}}
{{ "mesos_agent_registered_with_masters: signal: killed"}}
{{ ]}}
}

在企业版DC/OS1.11.3,开源版1.11.6以后已经对超时时间进行了优化,具体可以比较

/opt/mesosphere/lib/python3.6/site-packages/gen/calc.py

老版:


def calculate_check_config(check_time):
    check_config = {
        'node_checks': {
            'checks': {
                'components_master': {
                    'description': 'All DC/OS components are healthy.',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', '--role', 'master', 'components',
                            '--exclude=dcos-checks-poststart.timer,dcos-checks-poststart.service'],
                    'timeout': '3s',
                    'roles': ['master']
                },
                'components_agent': {
                    'description': 'All DC/OS components are healthy',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', '--role', 'agent', 'components', '--port', '61001',
                            '--exclude=dcos-checks-poststart.service,dcos-checks-poststart.timer'],
                    'timeout': '3s',
                    'roles': ['agent']
                },
                'xz': {
                    'description': 'The xz utility is available',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'executable', 'xz'],
                    'timeout': '1s'
                },
                'tar': {
                    'description': 'The tar utility is available',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'executable', 'tar'],
                    'timeout': '1s'
                },
                'curl': {
                    'description': 'The curl utility is available',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'executable', 'curl'],
                    'timeout': '1s'
                },
                'unzip': {
                    'description': 'The unzip utility is available',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'executable', 'unzip'],
                    'timeout': '1s'
                },
                'ip_detect_script': {
                    'description': 'The IP detect script produces valid output',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'ip'],
                    'timeout': '1s'
                },
                'mesos_master_replog_synchronized': {
                    'description': 'The Mesos master has synchronized its replicated log',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', '--role', 'master', 'mesos-metrics'],
                    'timeout': '1s',
                    'roles': ['master']
                },
                'mesos_agent_registered_with_masters': {
                    'description': 'The Mesos agent has registered with the masters',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', '--role', 'agent', 'mesos-metrics'],
                    'timeout': '1s',
                    'roles': ['agent']
                },
                'journald_dir_permissions': {
                    'description': 'Journald directory has the right owners and permissions',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'journald'],
                    'timeout': '1s',
                },
            },
            'prestart': [],
            'poststart': [
                'components_master',
                'components_agent',
                'xz',
                'tar',
                'curl',
                'unzip',
                'ip_detect_script',
                'mesos_master_replog_synchronized',
                'mesos_agent_registered_with_masters',
                'journald_dir_permissions',
            ],
        },
    }

    if check_time == 'true':
        # Add the clock sync check.
        clock_sync_check_name = 'clock_sync'
        check_config['node_checks']['checks'][clock_sync_check_name] = {
            'description': 'System clock is in sync.',
            'cmd': ['/opt/mesosphere/bin/dcos-checks', 'time'],
            'timeout': '1s'
        }
        check_config['node_checks']['poststart'].append(clock_sync_check_name)

    return json.dumps(check_config)

新版:

def calculate_check_config(check_time):
    check_config = {
        'node_checks': {
            'checks': {
                'components_master': {
                    'description': 'All DC/OS components are healthy.',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', '--role', 'master', 'components',
                            '--exclude=dcos-checks-poststart.timer,dcos-checks-poststart.service'],
                    'timeout': '30s',
                    'roles': ['master']
                },
                'components_agent': {
                    'description': 'All DC/OS components are healthy',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', '--role', 'agent', 'components', '--port', '61001',
                            '--exclude=dcos-checks-poststart.service,dcos-checks-poststart.timer'],
                    'timeout': '30s',
                    'roles': ['agent']
                },
                'xz': {
                    'description': 'The xz utility is available',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'executable', 'xz'],
                    'timeout': '3s'
                },
                'tar': {
                    'description': 'The tar utility is available',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'executable', 'tar'],
                    'timeout': '3s'
                },
                'curl': {
                    'description': 'The curl utility is available',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'executable', 'curl'],
                    'timeout': '3s'
                },
                'unzip': {
                    'description': 'The unzip utility is available',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'executable', 'unzip'],
                    'timeout': '3s'
                },
                'ip_detect_script': {
                    'description': 'The IP detect script produces valid output',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'ip'],
                    'timeout': '3s'
                },
                'mesos_master_replog_synchronized': {
                    'description': 'The Mesos master has synchronized its replicated log',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', '--role', 'master', 'mesos-metrics'],
                    'timeout': '30s',
                    'roles': ['master']
                },
                'mesos_agent_registered_with_masters': {
                    'description': 'The Mesos agent has registered with the masters',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', '--role', 'agent', 'mesos-metrics'],
                    'timeout': '30s',
                    'roles': ['agent']
                },
                'journald_dir_permissions': {
                    'description': 'Journald directory has the right owners and permissions',
                    'cmd': ['/opt/mesosphere/bin/dcos-checks', 'journald'],
                    'timeout': '3s',
                },
            },
            'prestart': [],
            'poststart': [
                'components_master',
                'components_agent',
                'xz',
                'tar',
                'curl',
                'unzip',
                'ip_detect_script',
                'mesos_master_replog_synchronized',
                'mesos_agent_registered_with_masters',
                'journald_dir_permissions',
            ],
        },
    }

    if check_time == 'true':
        # Add the clock sync check.
        clock_sync_check_name = 'clock_sync'
        check_config['node_checks']['checks'][clock_sync_check_name] = {
            'description': 'System clock is in sync.',
            'cmd': ['/opt/mesosphere/bin/dcos-checks', 'time'],
            'timeout': '3s'
        }
        check_config['node_checks']['poststart'].append(clock_sync_check_name)

return json.dumps(check_config)

在线节点可以修改配置文件后,重启dcos-diagnostics服务即可

/opt/mesosphere/etc/dcos-diagnostics-runner-config.json

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

snipercai

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值