5.4.5. MySQL 인스턴스 매니저 상태 모니터링
서버의 상태를 모니터 하기 위해서, MySQL 인스턴스 매니저는 check_connection에 대한 패스워드를 가지고 있는 MySQL_Instance_Manager@localhost 사용자 계정을 사용해서 정상 인터벌 (regular interval) 동안 MySQL 서버 인스턴스에 접속을 시도한다.
MySQL 서버를 위해서는 이 계정을 만들 필요는 없다; 실제로는, 이 계정이 없을 것으로 간주한다. 인스턴스 매니저는, 서버에 연결을 시도할 때 계정에 로그인이 실패하였다는 결과가 나오면, 서버는 동작 중이라고 판단한다. 하지만, 만약에 계정이 존재하지 않으면, 서버는 연결 실패를 자신의 일반 쿼리 로그에 기록한다.
여러분이 SHOW INSTANCES 또는 SHOW INSTANCE STATUS 명령어를 사용하면, 인스턴스 매니저는 보호 받지 않는 서버 인스턴스에 대해서도 연결을 시도한다. 이것이 보호 받지 않는 인스턴스에 대해서 실행되는 유일한 상태 모니터링이다.
인스턴스 매니저는 스타트업 시점에 서버 인스턴스를 정상적으로 시작하였는지 알고 있다. 시작은 정상적으로 하였지만 나중에 깨진 인스턴스의 경우에는 인스턴스 매니저에 특정 신호가 전달된다.
MySQL 5.1.12 버전 이후부터, 인스턴스 매니저는 각각의 인스턴스가 사용할 수 있는 명령어에는 어떤 것들이 있는지 판단하기 위해 인스턴스 상태를 추적한다. 예를 들면, 인스턴스의 구성을 수정하는 명령어는 인스턴스가 오프라인 상태일 경우에만 사용할 수 있는 것이다.
각각의 인스턴스는 아래에 있는 테이블 상태 중의 하나가 된다. 보호 받는 인스턴스는 어떤 상태도 될 수가 있다.보호 받지 못한 인스턴스는 온라인 또는 오프라인 중의 하나만 될 수 있다. 인스턴스 상태 정보는 SHOW INSTANCES 및 SHOW INSTANCE STATUS 명령어의 status 컬럼에 표시가 된다.
|
State |
Meaning |
|
offline |
The instance has not been started and is not running. |
|
starting |
The instance is starting (initializing). Nonguarded instances cannot be in this state. A nonguarded instance goes directly from offline to online. |
|
stopping |
The instance is stopping. Nonguarded instances cannot be in this state. A nonguarded instance goes directly from online to offline, or stays offline if startup fails. |
|
online |
The instance has started and is running. |
|
failed |
The instance was online but it crashed and is being restarted by Instance Manager, or else the instance failed to start at all and Instance Manager is again attempting to start it. Nonguarded instances cannot be in this state. |
|
crashed |
Instance Manager failed to start the instance after several attempts. (Instance Manager will try again later.) Nonguarded instances cannot be in this state. |
|
abandoned |
Instance Manager was not able to start the instance, has given up, and will make no further attempts until instructed otherwise. To tell Instance Manager to try again, you must first use STOP INSTANCE to put the instance in offline state, and then use START INSTANCE to start the instance. If it is necessary to make configuration changes for the instance, you must do so after putting the instance offline and before starting it. (Instance Manager accepts configuration-changing commands only for offline instances.) Nonguarded instances cannot be in this state. |