> For the complete documentation index, see [llms.txt](https://docs.tibero.com/prosync/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tibero.com/prosync/installation/examples/cm-failover/cm-command.md).

# CM 명령어 모음

## cmrctl add

### cmrctl add group

그룹 리소스를 추가하기 위한 명령어이다. 그룹은 클러스터라는 환경 위에서 agent 서비스를 관리하기 위한 개념이다

```bash
cmrctl add group --name <group_name> --cname <cluster_name> 
--grptype <type> --failover <true|false>
```

<table><thead><tr><th width="98.33331298828125">Key</th><th width="137.33331298828125">Value Type</th><th>설명</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code></td><td>그룹 리소스 이름이다. (unique, 필수)</td></tr><tr><td><code>cname</code></td><td><code>string</code></td><td>해당 그룹 리소스가 속할 cluster 리소스 이름이다. (필수)</td></tr><tr><td><code>grptype</code></td><td><code>string</code></td><td>그룹의 종류를 나타내기 위한 용도이다. (필수)</td></tr><tr><td><code>failover</code></td><td><code>string</code></td><td>agent가 종료되었을때 failover 기능 사용 여부이다. <br>(default: true)</td></tr></tbody></table>

### cmrctl add agent

Agent 리소스를 추가하는 명령어이다.

```bash
cmrctl add agent --name <agent_name> --grpname <group_name> --script <directory_path>
--pubnet <public_network_resource_name> --retry_cnt <retry_cnt>
```

<table><thead><tr><th width="113.66668701171875">Key</th><th width="231">Value Type</th><th>설명</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code></td><td>agent 리소스 이름이다. (unique, 필수)</td></tr><tr><td><code>grpname</code></td><td><code>string</code></td><td>agent 리소스가 속할 그룹 리소스 이름이다 (필수)</td></tr><tr><td><code>script</code></td><td><code>string(directory path)</code></td><td>agent cmd를 실행시킬 script가 위치한 절대경로이다 (필수)</td></tr><tr><td><code>pubnet</code></td><td><code>string</code></td><td>public 용도로 사용할 네트워크 리소스 이름이다. dependency를 추가하려면 입력해야한다.</td></tr><tr><td><code>retry_cnt</code></td><td><code>integer</code></td><td>최대 retry 시도 횟수이다. (default: 3)</td></tr></tbody></table>

###

***

## **cmrctl del**

특정 리소스를 삭제하기 위한 명령어이며, DOWN 또는 DEACT 상태의 리소스만 삭제 가능하다.

```bash
$ cmrctl del <resource_type> --name <resource_name>
```

{% hint style="warning" %}
**주의**

모든 agent가 down된 상태이면, group을 삭제할 경우 agent도 같이 삭제된다.
{% endhint %}

###

***

## **cmrctl show**

CM에 등록된 리소스의 정보를 확인하기 위한 명령어이다.

```bash
$ cmrctl show <resource_type> --name <resource_name>
```

{% hint style="info" %}
**참고**

`cmrctl show all`을 입력하는 경우 같은 cm group의 모든 정보를 확인할 수 있다.
{% endhint %}

###

***

## **cmrctl start**

리소스를 시작하기 위한 명령어이다. 그룹 리소스를 start하는 경우 해당 그룹에 속한 모든 agent를 기동시킨다.

```bash
$ cmrctl start <resource_type> --name <resource_name>
```

###

***

## **cmrctl stop**

리소스를 중지하기 위한 명령어이다. 그룹 리소스를 stop하는 경우 해당 그룹에 속한 모든 agent를 중지시킨다.

```bash
$ cmrctl stop <resource_type> --name <resource_name>
```

###

***

## c**mrctl act**

다음의 이유로 인해 deactivate된 리소스를 다시 activate시켜주기 위한 명령어이다.

* agent를 추가할 때 입력한 retry\_cnt(기본값: 3) 이상 start를 수행했는데도 실패한 경우
* 사용자가 cmrctl deact 명령어를 명시적으로 사용하여 비활성화시킨 경우
* agent를 추가할 때 입력한 script에 문제가 있는 경우
  * 위치에 script가 없는 경우
  * script의 권한이 없는 경우
  * script가 문제가 생겨 timeout될 경우

```bash
$ cmrctl act <resource_type> --name <resource_name>
```

###

***

## c**mrctl deact**

리소스를 deactivate시켜주기 위한 명령어이다. deact되어 있는 동안 agent는 script를 수행시키지 않는다.

```bash
$ cmrctl deact <resource_type> --name <resource_name>
```

###

***

## c**mrctl modify**

그룹 리소스의 failover 기능 사용 여부를 수정하기 위한 명령어이다.

```bash
$ cmrctl modify group --name <group_name> --failover <true|false>
```

###


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tibero.com/prosync/installation/examples/cm-failover/cm-command.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
