---
title: "Controlling CoraDB processes: coradb service, server, broker"
description: "Start, stop and check CoraDB with the coradb utility: the service, database servers, brokers, CMS and the Java SP server."
url: "https://www.coradb.ai/manual/admin/control.html"
markdown_url: "https://www.coradb.ai/manual/markdown/admin/control.md"
product: "CoraDB"
version: "1.0"
keywords: "coradb service start, coradb server start, coradb broker start, coradb javasp, coradb manager, coradb service status, coradb utility log, start coradb, stop coradb"
---

# Controlling CoraDB processes: coradb service, server, broker

CoraDB runs as several processes — the master, database servers, brokers with their CAS processes, the CoraDB Manager Server (CMS) and the Java SP server — all controlled with the **coradb** utility. This page gives the commands for each and describes the CoraDB service; the processes are described in detail on their own pages: [Database server](https://www.coradb.ai/manual/admin/control_server.html), [Broker](https://www.coradb.ai/manual/admin/control_broker.html), [CMS](https://www.coradb.ai/manual/admin/control_manager.html) and [Java SP server](https://www.coradb.ai/manual/admin/control_javasp.html).

## Controlling CoraDB service

The following **coradb** utility syntax shows how to control services registered in the configuration file. One of the following can be specified in \<command\>.

``` bash
coradb service <command>
<command>: {start|stop|restart|status}
```

- start: start services.
- stop: stop services.
- restart: restart services.
- status: check status.

No additional options or arguments are required.

## Controlling database server

The following **coradb** utility syntax shows how to control database server process.

``` bash
coradb server <command> [database_name]
<command>: {start|stop|restart|status}
```

One of the following can be specified in \<command\>:

- start: start a database server process.
- stop: stop a database server process.
- restart: restart a database server process.
- status: check status of a database server process.

Every command can specify a database name (**\[database_name\]**) as an argument.  
If the database name is not specified, the **status** command displays the currently running database servers' information, and the commands except **status** refer to the database names in the **server** property of the **\[service\]** section of **coradb.conf**.

``` text
# coradb.conf

[service]

...

server=e-commerce,testdb

...
```

``` bash
% coradb server start

@ coradb server start: e-commerce

This may take a long time depending on the amount of recovery works to do.

CoraDB 1.0

++ coradb server start: success

@ coradb server start: testdb

This may take a long time depending on the amount of recovery works to do.

CoraDB 1.0

++ coradb server start: success
```

## Controlling broker

The following **coradb** utility syntax shows how to control CoraDB broker process.

``` bash
coradb broker <command> 
<command>: start
           |stop
           |restart
           |status [options] [broker_name_expr]
           |acl {status|reload} broker_name
           |on <broker_name> |off <broker_name>
           |reset broker_name 
           |info
```

- start: start broker processes.
- stop: stop broker processes.
- restart: restart broker processes.
- status: check status of broker processes.
- acl: limit broker access.
- on/off: enable/disable the specified broker.
- reset: reset the connection to broker.
- info: display the broker configuration information.

## Controlling CMS

CMS runs on the database host and lets administration clients manage databases and brokers remotely. The following **coradb** utility syntax controls the CMS processes.

``` bash
coradb manager <command>
<command>: {start|stop|status}
```

- start: start CMS processes.
- stop: stop CMS processes.
- status: check the status of manager processes.

## Controlling CoraDB Java stored procedure server

The following **coradb** utility syntax shows how to control CoraDB Java Stored Procedure server process.

``` bash
coradb javasp <command> [database_name]
<command>: {start|stop|restart|status}
```

One of the following can be specified in \<command\>:

- start: start a Java Stored Procedure server process.
- stop: stop a Java Stored Procedure server process.
- restart: restart a Java Stored Procedure server process.
- status: check status of a Java Stored Procedure server process.

Every command can specify a database name (**\[database_name\]**) as an argument. If the database name is not specified, the command is executed by referring to the database names in the **server** property of the **\[service\]** section of **coradb.conf**.

``` text
# coradb.conf

[service]

...

server=e-commerce,testdb

...
```

``` bash
% coradb javasp start

@ coradb javasp start: e-commerce
++ coradb javasp start: success

@ coradb javasp start: testdb
++ coradb javasp start: success
```


## Registering services

If you do not register any service, only master process is registered by default. It is convenient for you to view status of all related processes at a glance or start and stop the processes at once with the **coradb** **service** utility once it is registered as CoraDB service.

- For details on CoraDB Java Stored Procedure server configuration, see [Configuring for CoraDB Java SP server](https://www.coradb.ai/manual/admin/control_javasp.html#configuring-for-coradb-java-sp-server).

The following example shows how to register database server and broker as service in the **coradb.conf** file and enable databases ( *e-commerce* and *testdb* ) to start automatically at once when CoraDB server starts running.

``` text
# coradb.conf
... 

[service]

# The list of processes to be started automatically by 'coradb service start' command
service=server,broker

# The list of database servers in all by 'coradb service start' command.
# This property is effective only when the above 'service' property contains 'server' or 'javasp' keyword.
server=e-commerce,testdb
```

## Starting services

In Linux environment, you can enter the code below to start CoraDB after installation. If no server is registered in the configuration file, only master process (cora_master) runs by default.

In the Windows environment, the code below is normally executed only if a user with system permission has logged in. An administrator or general user can start or stop the CoraDB server by clicking its icon on the taskbar tray.

``` bash
% coradb service start

@ coradb master start
++ coradb master start: success
```

The following message is returned if master process is already running.

``` bash
% coradb service start

@ coradb master start
++ coradb master is running.
```

The following message is returned if master process fails to run. The example shows that service fails to start due to conflicts of the **coradb_port_id** parameter value specified in the coradb.conf file. In such a case, you can resolve the problem by changing the port. If it fails to start even though no port is occupied by process, delete /tmp/CoraDB1523 file and then restart the process.

``` bash
% coradb service start

@ coradb master start
cora_master: '/tmp/CoraDB1523' file for UNIX domain socket exist.... Operation not permitted
++ coradb master start: fail
```

After registering service as explained in [CoraDB services](https://www.coradb.ai/manual/admin/control.html#coradb-services), enter the code below to start the service. You can verify that database server process and broker as well as registered *e-commerce* and *testdb* are starting at once.

``` bash
% coradb service start

@ coradb master start
++ coradb master start: success
@ coradb server start: e-commerce

This may take a long time depending on the amount of restore works to do.
CoraDB 1.0

++ coradb server start: success
@ coradb server start: testdb

This may take a long time depending on the amount of recovery works to do.
CoraDB 1.0

++ coradb server start: success
@ coradb broker start
++ coradb broker start: success
```

## Stopping services

Enter code below to stop CoraDB service. If no services are registered by a user, only master process stops and then restarts.

``` bash
% coradb service stop
@ coradb master stop
++ coradb master stop: success
```

Enter code below to stop registered CoraDB service. You can verify that server process, broker process, and master process as well as *e-commerce* and *testdb* stop at once.

``` bash
% coradb service stop
@ coradb server stop: e-commerce

Server e-commerce notified of shutdown.
This may take several minutes. Please wait.
++ coradb server stop: success
@ coradb server stop: testdb
Server testdb notified of shutdown.
This may take several minutes. Please wait.
++ coradb server stop: success
@ coradb broker stop
++ coradb broker stop: success
@ coradb master stop
++ coradb master stop: success
```

## Restarting services

Enter code below to restart CoraDB service. If no services are registered by a user, only master process stops and then restarts.

``` bash
% coradb service restart

@ coradb master stop
++ coradb master stop: success
@ coradb master start
++ coradb master start: success
```

Enter code below to restart registered CoraDB service. You can verify that server process, broker process, and master process as well as *e-commerce* and *testdb* stop and then restart at once.

``` bash
% coradb service restart

@ coradb server stop: e-commerce
Server e-commerce notified of shutdown.
This may take several minutes. Please wait.
++ coradb server stop: success
@ coradb server stop: testdb
Server testdb notified of shutdown.
This may take several minutes. Please wait.
++ coradb server stop: success
@ coradb broker stop
++ coradb broker stop: success
@ coradb master stop
++ coradb master stop: success
@ coradb master start
++ coradb master start: success
@ coradb server start: e-commerce

This may take a long time depending on the amount of recovery works to do.

CoraDB 1.0

++ coradb server start: success
@ coradb server start: testdb

This may take a long time depending on the amount of recovery works to do.

CoraDB 1.0

++ coradb server start: success
@ coradb broker start
++ coradb broker start: success
```

## Managing service status

The following example shows how to check the status of master process and database server registered.

``` bash
% coradb service status

@ coradb master status
++ coradb master is running.
@ coradb server status

Server testdb (rel 1.0, pid 31059)
Server e-commerce (rel 1.0, pid 30950)

@ coradb broker status
% query_editor
----------------------------------------
ID   PID   QPS   LQS PSIZE STATUS
----------------------------------------
 1 15465     0     0 48032 IDLE
 2 15466     0     0 48036 IDLE
 3 15467     0     0 48036 IDLE
 4 15468     0     0 48036 IDLE
 5 15469     0     0 48032 IDLE

% broker1 OFF

@ coradb manager server status
++ coradb manager server is not running.
```

The following message is returned if master process has stopped.

``` bash
% coradb service status
@ coradb master status    
++ coradb master is not running.
```


## coradb utility logging

CoraDB supports a logging feature about coradb utility's running result.

**Logging contents**

The following contents are written to the **\$CORADB/log/coradb_utility.log** file.

- All commands through coradb utilities: only usage, version and parsing errors are not logged.
- Execution results by coradb utilities: success/failure.
- An error message when failure.

**Log file size**

A size of **coradb_utility.log** file is expanded by the size specified by **error_log_size** parameter in **coradb.conf**; if this size is enlarged as the specified size, it is backed up as the **coradb_utility.log.bak** file.

**Log format**

``` text
<time> (coradb PID) <contents>
```

The following is an example of printing the log file.

``` text
13-11-19 15:27:19.426 (17724) coradb manager stop
13-11-19 15:27:19.430 (17724) FAILURE: ++ coradb manager server is not running.
13-11-19 15:27:19.434 (17726) coradb service start
13-11-19 15:27:19.439 (17726) FAILURE: ++ coradb master is running.
13-11-19 15:27:22.931 (17726) SUCCESS
13-11-19 15:27:22.936 (17756) coradb service restart
13-11-19 15:27:31.667 (17756) SUCCESS
13-11-19 15:27:31.671 (17868) coradb service stop
13-11-19 15:27:34.909 (17868) SUCCESS
```

However, in Windows, some **coradb** commands are executed through a service process; therefore, a duplicated information can be displayed again.

``` text
13-11-13 17:17:47.638 ( 3820) coradb service stop
13-11-13 17:17:47.704 ( 7848) d:\CoraDB\bin\coradb.exe service stop --for-windows-service
13-11-13 17:17:56.027 ( 7848) SUCCESS
13-11-13 17:17:57.136 ( 3820) SUCCESS
```

And, in Windows, a process run through the service process cannot print out an error message; therefore, for error messages related to the service start, you should definitely check them in the **coradb_utility.log** file.
