Appdynamics / Appdynamics/HA-toolkit

replicate.sh won't stop primary controller properly if it's ran via controller.sh

Open
#103 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
13
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Ran into a bug that prevents proper setup of DB slave on primary node. Steps to replicate

1. Primary controller installed with platform-admin
2. Install init services on primary node (`sudo ./install-init.sh -s`)
2. Run replicate.sh for the first time (`./replicate.sh -s node2 -e http://:`)
3. install_init.sh on the secondary node (`sudo ./install-init.sh -s`)
4. Run replicate.sh in "final" mode (`./replicate.sh -s node2 -e http://:`)

Results in:
```
-- setting up primary slave
ERROR 1794 (HY000) at line 1: Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MySQL error log.
-- copy controller.sh to secondary
-- disable secondary appserver
-- remove secondary master.info
-- start secondary database
Connection to node2 closed.
-- wait for secondary to start
-- setting up secondary slave
-- removing skip-slave-start from primary
-- removing skip-slave-start from secondary
-- start primary slave
ERROR 1794 (HY000) at line 1: Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MySQL error log.
-- start secondary slave
-- primary slave status
-- secondary slave status
Slave_IO_State: Connecting to master
Master_Host: node1
Seconds_Behind_Master: 0
Master_Server_Id: 0
```

What happens is - "stopping primary" step fails as script:

1. in `stop_appdynamics_services`, tries to run `service appdcontroller stop` and `service appdcontroller-db stop` which both return 0 code, but do nothing - controller wasn't started by them
2. when the `stop_appdynamics_services` function returns, it returns 0 - meaning that `stop_appdynamics_services || $APPD_ROOT/bin/controller.sh stop` doesn't enter the second branch, so the controller and DB are still running during replication, but what is more - DB is not bounced with new db.cnf, hence slave setup error.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.