Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster: support alertmanager configuration Listen Host #1665

Merged
merged 3 commits into from
Dec 13, 2021

Conversation

srstack
Copy link
Collaborator

@srstack srstack commented Dec 10, 2021

What problem does this PR solve?

close #1633

What is changed and how it works?

support alertmanager configuration Listen Host

add new field listen_host to Alertmanager

alertmanager_servers:
  # # The ip address of the Alertmanager Server.
  - host: 172.16.7.147
    listen_host: 0.0.0.0
    # # SSH port of the server.
    ssh_port: 22

if set listen_host: 0.0.0.0
run script

cat run_alertmanager.sh 
#!/bin/bash
set -e

DEPLOY_DIR=/home/tidb-deploy/alertmanager-9093
cd "${DEPLOY_DIR}" || exit 1

# WARNING: This file was auto-generated. Do not edit!
#          All your edit might be overwritten!

exec > >(tee -i -a "/home/tidb-deploy/alertmanager-9093/log/alertmanager.log")
exec 2>&1
exec bin/alertmanager/alertmanager \
    --config.file="conf/alertmanager.yml" \
    --storage.path="/home/tidb-data/alertmanager-9093" \
    --data.retention=120h \
    --log.level="info" \
    --web.listen-address="172.16.7.147:9093" \
    --web.external-url="http://172.16.7.147:9093" \
    --cluster.peer="172.16.7.147:9094" \
    --cluster.listen-address="0.0.0.0:9094"

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Code changes

  • Has exported function/method change
  • Has interface methods change
  • Has persistent data change

Side effects

Related changes

  • Need to update the documentation

Release notes:

NONE

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 10, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nexustar

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 10, 2021
@srstack srstack self-assigned this Dec 10, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2021

Codecov Report

Merging #1665 (d9cab3f) into master (0de8baf) will increase coverage by 34.51%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1665       +/-   ##
===========================================
+ Coverage        0   34.51%   +34.51%     
===========================================
  Files           0      233      +233     
  Lines           0    21956    +21956     
===========================================
+ Hits            0     7579     +7579     
- Misses          0    13250    +13250     
- Partials        0     1127     +1127     
Flag Coverage Δ
cluster 34.51% <100.00%> (?)
integrate 34.51% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/cluster/spec/alertmanager.go 63.88% <100.00%> (ø)
pkg/cluster/spec/spec.go 70.99% <100.00%> (ø)
pkg/cluster/template/scripts/alertmanager.go 81.39% <100.00%> (ø)
pkg/cluster/manager/show_config.go 0.00% <0.00%> (ø)
pkg/crypto/keys.go 25.00% <0.00%> (ø)
pkg/cluster/template/config/blackbox.go 65.21% <0.00%> (ø)
pkg/cluster/ctxt/event_bus.go 80.00% <0.00%> (ø)
pkg/cluster/task/rmdir.go 0.00% <0.00%> (ø)
pkg/cluster/task/shell.go 66.66% <0.00%> (ø)
pkg/cluster/task/func.go 40.00% <0.00%> (ø)
... and 226 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0de8baf...d9cab3f. Read the comment docs.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 13, 2021
@AstroProfundis
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: d9cab3f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 13, 2021
@AstroProfundis AstroProfundis added this to the v1.9.0 milestone Dec 13, 2021
@ti-chi-bot ti-chi-bot merged commit b01e507 into pingcap:master Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use Tiup deploy alertmanager component,But listening on a specific IP
5 participants