posted 7 years ago in CUBRID Life category by Esen Sagynov
In this post, I will briefly introduce the CUBRID Service Control. Before we go on, let's remember the Architecture of CUBRID. It consists of the following components:
- Database server – Stores the data.
- Broker – A middleware that connects CUBRID with AP.
- CUBRID Manager Server – Program that manages CUBRID and the Broker.
- Database server start/stop – cubrid server start <db_name>/cubrid server stop <db_name>
- Broker start/stop – cubrid broker start/cubrid broker stop
- CUBRID Manager Server start/stop – cubrid manager start/cubrid manager stop
Currently, you can use the “cubrid service start” command to start CUBRID services at once.
So, where the “cubrid service start” command is set?
The answer is in cubrid.conf. When you open cubrid.conf, you will see the following items.
# Service section - a section for 'cubrid service' command
# The list of processes to be started automatically by 'cubrid service start' command
# Any combinations are available with server, broker and manager.
The part indicated in red above is the one to be controlled by the “cubrid service” command. Server is a Database, broker is a middleware, and Manager is a CUBRID Manager Server. If you want to put the CUBRID Manager server out of control of the “cubrid service” command, remove it from the above service items. To run each service separately, set each as a comment (#).
When you run the services with “cubrid service start,” you will notice that something is missing. This is because it appears that all services have been started, but when you try to connect to the DB, you will get the message that the DB which has been created is not running. You might say to yourself, “I thought everything would be done at once…" There is a solution to this problem. Open cubrid.conf again and look at the contents below. You will see the following items:
# 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.
It is not difficult to find because this part is shown immediately below. Write the name of the newly created DB in the part indicated in red above. Of course, you should remove the comment (#). You can delete foo and bar because they are only samples. You can do the following to register demodb which is created by default during CUBRID installation.
Now, run the “cubrid service start” command. demodb will start as well. It will stop as well when you run the “cubrid service stop” command to stop the services. Now you can control CUBRID with a single command. If there are more DBs created, specify them in a row, separating them with commas (,).