LoginSignup
2
0

More than 5 years have passed since last update.

Mackerelを別サーバへ引っ越す

Posted at

Mackerel-agentを停止する

sudo /etc/init.d/mackerel-agent stop

サーバ起動時設定からMackerelをはずす

サーバ起動時に自動で上がるサービスの一覧を確認する

$ chkconfig --list
(略)
mackrel-agent       0:off   1:off   2:off   3:off   4:off   5:off   6:off

該当する設定をはずす

$  chkconfig --del mackrel-agent

サーバ発行のIDファイルを削除

rm /var/lib/mackerel-agent/id

移行する先のMackerelのAPI KEYを取得

DashboardのOverview>詳細にあります。
APIKEY

移行先にMackerel-agentをインストール

Hostの設定からエージェントのインストール方法が出ています(下図参照)。GCPのRedhatサーバだと以下の通り。

新規ホストの登録

curl -fsSL https://mackerel.io/file/script/setup-all-yum.sh | MACKEREL_APIKEY='xxx' sh

必要に応じてプラグインをインストールします(以下参照)。
https://qiita.com/hardreggaecafe/items/f7af6a5d98028bda13c8

(プラグインインストール後)mackerel-agent.confのapikeyより下をコピーして書き換え

apikey = "xxx" # エージェントインストールで勝手に追加される
# pidfile = "/var/run/mackerel-agent.pid"
# root = "/var/lib/mackerel-agent"
# verbose = false
(略)
[plugin.checks.check_httpd]
command = "check-procs --pattern httpd"
[plugin.checks.mysql_connection]
command = "check-mysql connection --host=xxx --port=3306 --user=xxx --password=xxx --warning=250 -- critical=280"

Mackerel-agentを再起動

sudo /etc/init.d/mackerel-agent restart

移行完了

うまくいくとホストが登録されて以下のように各種メトリクスが計測できるようになります。
mackerel.png

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0