Skip to content

orion-ops 执行安装操作时失败怎么办?

手动启动:

shell
bash -l $HOME/orion-ops/plugins/start-machine-monitor-agent.sh

如果启动脚本不存在则需要手动安装步骤:

  1. 在机器列表中找到失败的机器 点击详情 记录机器id
  2. 将 orion-ops 部署机器下的 agent 包复制到需要手动启动的机器上
  3. 创建启动脚本
  4. 执行启动脚本
shell
#!/bin/bash
machineId=刚刚记录的机器id
agentJarPath=agent文件路径
AGENT_PROCESS=machine-monitor-agent
STARTED=$(ps -ef | grep $AGENT_PROCESS | grep '.jar' | grep -v grep | wc -l)
PIDS=$(ps -ef | grep $AGENT_PROCESS | grep '.jar' | grep -v grep | awk '{print $2}')

# KILL
if [ $STARTED -eq 0 ]
then
    echo "Agent is not running."
else
    echo "Killing agent with PID(s): $PIDS"
    for PID in $PIDS; do
        kill -9 $PID
    done
fi
echo 'Agent starting...'

# START
nohup java -jar -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx128m -Xmn32m -Xss256k -XX:SurvivorRatio=8 -XX:+UseG1GC ${agentJarPath} --machineId=${machineId} --spring.profiles.active=prod >/dev/null 2>&1 &

# CHECK
sleep 2
NEW_STARTED=$(ps -ef | grep $AGENT_PROCESS | grep '.jar' | grep -v grep | wc -l)
if [ $NEW_STARTED -eq 0 ]; then
    echo "Failed to start agent."
else
    echo "Agent started successfully."
fi

调用 orion-ops 的通知服务失败怎么办?

检查 agent 包的配置 orion.ops.access.host orion.ops.access.secret 是否正确
检查 orion-ops 包的配置 expose.api.access.secret 和agent 包的配置 orion.ops.access.secret 是否匹配

orion-ops 提示 api调用异常怎么办?

提示 api调用异常 的主要原因是 orion-ops 调用 agent 的 http api 失败

  1. 点击插件配置 检查 urlaccessToken 是否正确
  2. 进入机器终端, 使用 ps -ef | grep java 检查 agent 进程是否启动
  3. 进入机器终端, 使用 curl localhost:9220 检查 agent 进程是否有效
  4. 进入 orion-ops 终端, 使用 curl ip:9220 检查 agent 进程是否有效
  5. 如果 agent 正常启动, 需要考虑 orion-ops 的部署机器的防火墙

Released under the Apache 2.0 License.