Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
Make it possible to have two cluster running on the same machine (#704)
Browse files Browse the repository at this point in the history
* Add port number to pd service name

* make mesh port of alertmanager configurable
  • Loading branch information
benpigchu authored and liubo0127 committed Mar 14, 2019
1 parent d8f63c9 commit ec3e045
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion graceful_stop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
when: process_supervision == 'supervise'

- name: stop PD by systemd
systemd: name=pd.service state=stopped
systemd: name=pd-{{ pd_client_port }}.service state=stopped
become: true
when: process_supervision == 'systemd'

Expand Down
1 change: 1 addition & 0 deletions group_vars/alertmanager_servers.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---

alertmanager_port: 9093
alertmanager_mesh_port: 9094
3 changes: 2 additions & 1 deletion roles/alertmanager/templates/run_alertmanager_binary.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ exec bin/alertmanager \
--storage.path="{{ alertmanager_data_dir }}" \
--data.retention=120h \
--log.level="{{ alertmanager_log_level }}" \
--web.listen-address=":{{ alertmanager_port }}"
--web.listen-address=":{{ alertmanager_port }}" \
--mesh.listen-address=":{{ alertmanager_mesh_port }}"
2 changes: 2 additions & 0 deletions roles/alertmanager/templates/run_alertmanager_docker.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DEPLOY_DIR={{ deploy_dir }}
cd "${DEPLOY_DIR}" || exit 1

exec docker run -p {{ alertmanager_port }}:9093 \
-p {{ alertmanager_mesh_port }}:9094
-v /etc/localtime:/etc/localtime:ro \
-v "{{ alertmanager_data_dir }}:/alertmanager" \
-v "{{ deploy_dir }}/conf/alertmanager.yml:/etc/alertmanager/config.yml" \
Expand All @@ -18,3 +19,4 @@ exec docker run -p {{ alertmanager_port }}:9093 \
--storage.path="/alertmanager" \
--data.retention=120h \
--log.level="{{ alertmanager_log_level }}"
--mesh.listen-address=":9094"
2 changes: 1 addition & 1 deletion roles/pd/tasks/supervise_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
name: supervise
vars:
this_role_name: pd
service_name: pd
service_name: pd-{{ pd_client_port }}
2 changes: 1 addition & 1 deletion roles/pd/tasks/systemd_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
name: systemd
vars:
this_role_name: pd
service_name: pd
service_name: pd-{{ pd_client_port }}
6 changes: 3 additions & 3 deletions rolling_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
when: process_supervision == 'supervise'

- name: stop PD by systemd
systemd: name=pd.service state=stopped
systemd: name=pd-{{ pd_client_port }}.service state=stopped
become: true
when: process_supervision == 'systemd'

Expand All @@ -93,7 +93,7 @@
when: process_supervision == 'supervise'

- name: start PD by systemd
systemd: name=pd.service state=started
systemd: name=pd-{{ pd_client_port }}.service state=started
become: true
when: process_supervision == 'systemd'

Expand Down Expand Up @@ -263,7 +263,7 @@
port: "{{ pump_port }}"
state: stopped
msg: "the pump port {{ pump_port }} is not down"
when:
when:
- enable_binlog|default(false)
- binlog_version == "cluster"

Expand Down
2 changes: 1 addition & 1 deletion start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
- pd

- name: start PD by systemd
systemd: name=pd.service state=started enabled=no
systemd: name=pd-{{ pd_client_port }}.service state=started enabled=no
become: true
when: process_supervision == 'systemd'

Expand Down
2 changes: 1 addition & 1 deletion stop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
- pd

- name: stop PD by systemd
systemd: name=pd.service state=stopped
systemd: name=pd-{{ pd_client_port }}.service state=stopped
become: true
when: process_supervision == 'systemd'

Expand Down
2 changes: 1 addition & 1 deletion unsafe_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
become: true
when: process_supervision == 'systemd'
with_items:
- pd.service
- pd-{{ pd_client_port }}.service

- hosts: grafana_servers
tasks:
Expand Down
2 changes: 1 addition & 1 deletion unsafe_cleanup_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
- pd

- name: stop PD by systemd
systemd: name=pd.service state=stopped
systemd: name=pd-{{ pd_client_port }}.service state=stopped
become: true
when: process_supervision == 'systemd'

Expand Down

0 comments on commit ec3e045

Please sign in to comment.