:meta-keywords: cubrid server process, cub_server, cubrid broker, cubrid gateway,cubrid cas, cubrid manager server, cubrid HA, cubrid services, cubrid logging, cubrid errors, cubrid server access, cubrid status, cubrid manager, cubrid javasp, cub_javasp :meta-description: How to control and check CUBRID services and processes (server, broker, gateway), logging files, access, errors, CUBRID Manager and CUBRID Java SP Server. .. _control-cubrid-processes: Controlling CUBRID Processes ============================ CUBRID processes can be controlled by **cubrid** utility. Controlling CUBRID Service -------------------------- The following **cubrid** utility syntax shows how to control services registered in the configuration file. One of the following can be specified in . :: cubrid service : {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 **cubrid** utility syntax shows how to control database server process. :: cubrid server [database_name] : {start|stop|restart|status} One of the following can be specified in : * 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 **cubrid.conf**. :: # cubrid.conf [service] ... server=demodb,testdb ... :: % cubrid server start @ cubrid server start: demodb This may take a long time depending on the amount of recovery works to do. CUBRID 11.2 ++ cubrid server start: success @ cubrid server start: testdb This may take a long time depending on the amount of recovery works to do. CUBRID 11.2 ++ cubrid server start: success Controlling Broker ------------------ The following **cubrid** utility syntax shows how to control CUBRID broker process. :: cubrid broker : start |stop |restart |status [options] [broker_name_expr] |acl {status|reload} broker_name |on |off |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 Gateway ------------------- The following **cubrid** utility syntax shows how to control CUBRID gateway process. :: cubrid gateway : start |stop |restart |status [options] [gateway_name_expr] |acl {status|reload} gateway_name |on |off |reset gateway_name |info * start: start gateway processes. * stop: stop gateway processes. * restart: restart gateway processes. * status: check status of gateway processes. * acl: limit gateway access. * on/off: enable/disable the specified gateway. * reset: reset the connection to gateway. * info: display the gateway configuration information. Controlling CUBRID Manager Server --------------------------------- To use the CUBRID Manager, the Manager server must be running where database server is running. The following **cubrid** utility syntax shows how to control the CUBRID Manager processes. :: cubrid manager : {start|stop|status} * start: start manager server processes. * stop: stop manager server processes. * status: check the status of manager processes. Controlling CUBRID HA --------------------- The following **cubrid heartbeat** utility syntax shows how to use CUBRID HA. One of the following can be specified in *command*. :: cubrid heartbeat : {start|stop|copylogdb|applylogdb|reload|status} * start: start HA-related processes. * stop: stop HA-related processes. * copylogdb: start or stop copylogdb process. * applylogdb: start or stop applylogdb process. * reload: reload information on HA configuration. * status: check HA status. For details, see :ref:`cubrid-heartbeat`. Controlling CUBRID Java Stored Procedure Server ------------------------------------------------ The following **cubrid** utility syntax shows how to control CUBRID Java Stored Procedure server process. :: cubrid javasp [database_name] : {start|stop|restart|status} One of the following can be specified in : * 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 **status** command displays status information of the Java stored procedure server of every currently running database server. :: :: % cubrid javasp start demodb @ cubrid javasp start: demodb ++ cubrid javasp start: success .. _control-cubrid-services: CUBRID Services =============== Registering Services -------------------- You can register database servers, CUBRID brokers, CUBRID gateways, CUBRID Manager(s) or CUBRID HA as CUBRID service in the configuration file ( **cubrid.conf** ). To register services, you can input for each **server**, **broker**, **gateway**, **manager** or **heartbeat** as a parameter value, and it is possible to input several values by concatenating them in comma(,). 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 **cubrid** **service** utility once it is registered as CUBRID service. - For details on CUBRID HA configuration, see :ref:`cubrid-service-util`. The following example shows how to register database server and broker, gateway as service in the **cubrid.conf** file and enable databases ( *demodb* and *testdb* ) to start automatically at once when CUBRID server starts running. :: # cubrid.conf ... [service] # The list of processes to be started automatically by 'cubrid service start' command # Any combinations are available with server, broker, gateway, manager and heartbeat. service=server,broker,gateway # The list of database servers in all by 'cubrid service start' command. # This property is effective only when the above 'service' property contains 'server' keyword. server=demodb,testdb Starting Services ----------------- In Linux environment, you can enter the code below to start CUBRID after installation. If no server is registered in the configuration file, only master process (cub_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 CUBRID server by clicking its icon on the taskbar tray. :: % cubrid service start @ cubrid master start ++ cubrid master start: success The following message is returned if master process is already running. :: % cubrid service start @ cubrid master start ++ cubrid 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 **cubrid_port_id** parameter value specified in the cubrid.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/CUBRID1523 file and then restart the process. :: % cubrid service start @ cubrid master start cub_master: '/tmp/CUBRID1523' file for UNIX domain socket exist.... Operation not permitted ++ cubrid master start: fail After registering service as explained in :ref:`control-cubrid-services`, enter the code below to start the service. You can verify that database server process and broker, gateway as well as registered *demodb* and *testdb* are starting at once. :: % cubrid service start @ cubrid master start ++ cubrid master start: success @ cubrid server start: demodb This may take a long time depending on the amount of restore works to do. CUBRID 11.2 ++ cubrid server start: success @ cubrid server start: testdb This may take a long time depending on the amount of recovery works to do. CUBRID 11.2 ++ cubrid server start: success @ cubrid broker start ++ cubrid broker start: success @ cubrid gateway start ++ cubrid gateway start: success Stopping Services ----------------- Enter code below to stop CUBRID service. If no services are registered by a user, only master process stops and then restarts. :: % cubrid service stop @ cubrid master stop ++ cubrid master stop: success Enter code below to stop registered CUBRID service. You can verify that server process, broker process, gateway process and master process as well as *demodb* and *testdb* stop at once. :: % cubrid service stop @ cubrid server stop: demodb Server demodb notified of shutdown. This may take several minutes. Please wait. ++ cubrid server stop: success @ cubrid server stop: testdb Server testdb notified of shutdown. This may take several minutes. Please wait. ++ cubrid server stop: success @ cubrid broker stop ++ cubrid broker stop: success @ cubrid gateway stop ++ cubrid gateway stop: success @ cubrid master stop ++ cubrid master stop: success @ cubrid master stop ++ cubrid master stop: success Restarting Services ------------------- Enter code below to restart CUBRID service. If no services are registered by a user, only master process stops and then restarts. :: % cubrid service restart @ cubrid master stop ++ cubrid master stop: success @ cubrid master start ++ cubrid master start: success Enter code below to restart registered CUBRID service. You can verify that server process, broker process, gateway process and master process as well as *demodb* and *testdb* stop and then restart at once. :: % cubrid service restart @ cubrid server stop: demodb Server demodb notified of shutdown. This may take several minutes. Please wait. ++ cubrid server stop: success @ cubrid server stop: testdb Server testdb notified of shutdown. This may take several minutes. Please wait. ++ cubrid server stop: success @ cubrid broker stop ++ cubrid broker stop: success @ cubrid gateway stop ++ cubrid gateway stop: success @ cubrid master stop ++ cubrid master stop: success @ cubrid master start ++ cubrid master start: success @ cubrid server start: demodb This may take a long time depending on the amount of recovery works to do. CUBRID 11.2 ++ cubrid server start: success @ cubrid server start: testdb This may take a long time depending on the amount of recovery works to do. CUBRID 11.2 ++ cubrid server start: success @ cubrid broker start ++ cubrid broker start: success @ cubrid gateway start ++ cubrid gateway start: success Managing Service Status ----------------------- The following example shows how to check the status of master process and database server registered. :: % cubrid service status @ cubrid master status ++ cubrid master is running. @ cubrid server status Server testdb (rel 11.2, pid 31059) Server demodb (rel 11.2, pid 30950) @ cubrid broker status NAME PID PORT AS JQ TPS QPS SELECT INSERT UPDATE DELETE OTHERS LONG-T LONG-Q ERR-Q UNIQUE-ERR-Q #CONNECT #REJECT =========================================================================================================================================================================================================== * query_editor 10877 30000 5 0 0 0 0 0 0 0 0 0/60.0 0/60.0 0 0 0 0 * broker1 10889 33000 5 0 0 0 0 0 0 0 0 0/60.0 0/60.0 0 0 0 0 @ cubrid gateway status NAME PID PORT AS JQ TPS QPS SELECT INSERT UPDATE DELETE OTHERS LONG-T LONG-Q ERR-Q UNIQUE-ERR-Q #CONNECT #REJECT =========================================================================================================================================================================================================== * oracle_gateway 10903 53000 5 0 0 0 0 0 0 0 0 0/60.0 0/60.0 0 0 0 0 * mysql_gateway OFF @ cubrid manager server status ++ cubrid manager server is not running. The following message is returned if master process has stopped. :: % cubrid service status @ cubrid master status ++ cubrid master is not running. .. _cubrid-utility-logging: cubrid Utility Logging ---------------------- CUBRID supports a logging feature about cubrid utility's running result. **Logging contents** The following contents are written to the **$CUBRID/log/cubrid_utility.log** file. * All commands through cubrid utilities: only usage, version and parsing errors are not logged. * Execution results by cubrid utilities: success/failure. * An error message when failure. **Log file size** A size of **cubrid_utility.log** file is expanded by the size specified by **error_log_size** parameter in **cubrid.conf**; if this size is enlarged as the specified size, it is backed up as the **cubrid_utility.log.bak** file. **Log format** ::