- Print
- PDF
Using CUBRID server images
- Print
- PDF
Available in Classic
About CUBRID Installer
This page describes the concept and basic structure of NAVER CLOUD CUBRID Installer.
"CUBRID" uses the nation's only open source relational database (RDBMS) called CUBRID.
CUBRID
It is the only open source DBMS (Database Management System: DBMS) in Korea, and is composed of database server, broker, and CUBRID Manager.
Like other DMBS, database server uses table and column unit structure to view/edit/add/delete data in record unit.
The broker is a CUBRID-specific middleware that relays communication between the server and external applications. It provides connection pooling, monitoring, log tracking, and analysis features.
CUBRID Manager (hereinafter CM) is a GUI tool that can remotely manage databases and brokers. The CUBRID Manager also provides a convenient query editor that allows users to perform SQL queries on the database server.
CUBRID released version CUBRID 2008 R1.0 in November 2008, released version 9.3 in 2014, and continues to evolve. CUBRID Installer provided by NAVER CLOUD supports CUBRID 9.2 version which has proven reliability.
NAVER CLOUD CUBRID Installer configuration
In the case of CUBRID Installer supported by NAVER CLOUD, CUBRID can be used immediately after installation.
The demodb server, which is the default database, and the broker that allows you to communicate with the server are running, so you can use the database server through the CUBRID Manager. In addition to the GUI tools provided by CUBRID, a CLI-based monitoring program is provided. For more information, you can see the details on the CUBRID site.
Manage CUBRID Installer
This section describes how to manage CUBRID in NAVER CLOUD CUBRID Installer.
Create CUBRID image server
When creating an instance server with CUBRID installed, DB server, broker, and CM will be provided with the following default settings.
The main parameters are explained below.
cubrid.conf
The parameters related to the DB server are described below.
(URL: http://www.cubrid.org/manual/ko/9.2.0/admin/config.html?cubrid-broker-conf#cubrid-conf)
Property | Description |
---|---|
data_buffer_size=512M | This parameter sets the size of the data buffer that the database server caches in memory. It is recommended to set it to 50% of the total memory. |
max_clients=100 | The number of concurrent connections that can connect to the database. It is recommended to set it not to exceed a maximum of 1023. |
log_max_archives=10 | This parameter sets the maximum number of archived log files to store. |
cubrid_broker.conf
The parameters related to the broker are described below.
( URL: http://www.cubrid.org/manual/ko/9.2.0/admin/config.html#broker-configuration)
Property | Description |
---|---|
BROKER_PORT = 30000 | This parameter specifies the port number of the broker. By default, the broker is running on port numbers 30000 and 33000. |
MIN_NUM_APPL_SERVER = 5 | This parameter sets the minimum number of CAS processes that are waiting by default even if there is no connection request to the broker. |
MAX_NUM_APPL_SERVER = 40 | This parameter sets the maximum number of concurrent CAS connections to the broker. |
LONG_QUERY_TIME = 1 | This parameter sets the query execution time to be determined as the long-term execution query. Queries performed beyond that time will remain in the log. |
cm.conf
Property | Description |
---|---|
cm_port=8001 | This parameter is used to specify the port number of the CM. The default is 8001. |
cm_process_monitor_interval=5 | This parameter sets the interval cycle for monitoring. |
support_mon_statistic=NO | Parameters related to whether resource monitoring is supported. The default is NO, and changing to YES requires a CM process restart. Some CPU usage and disk I/O can occur for resource collection. |
Directory configuration
The directories of data, log and conf files related to CUBRID are as follows.
Property | Description |
---|---|
DATADIR | /home1/cubrid/CUBRID/databases/demodb |
DB LOGDIR | /home1/cubrid/CUBRID/log/server |
BROKER LOGDIR | /home1/cubrid/CUBRID/log/broker/sql_log /home1/cubrid/CUBRID/log/broker/error_log |
CONF | /home1/cubrid/CUBRID/conf/cubrid.conf /home1/cubrid/CUBRID/conf/cubrid_broker.conf |
statdump.sh | /home1/cubrid/bin/statdump.sh |
Server creation procedure
Create server
This section describes how to create a server with CUBRID images installed.
Step 1. Connect to www.ncloud.com and log in
① Select Console at the top right to connect to nCloud Console.
Step 2. Create server
- Create server, referring to Server Creation Guide
① Click [Create server].
Step 3. Select server image
① After selecting the boot disk size, select [CUBRID] from Image Type.
② Click [Next] on the right side of the selected OS Version.
Step 4. Set server
① Set the desired server type.
② Enter the desired server name.
③ Click [Next].
Step 5. Set authentication key
In this step, you can create a new authentication key or use an existing one.
① If it is your first time, select Create a new authentication key and enter an authentication key name.
② We entered an authentication key called cubridncloudkey.
③ Click [Create & save auth key] and save the downloaded pem file in a safe place.
- This file is used to create a password for the server in the future.
- Even if you use the same pem file, different passwords will be created for each server.
④ Click [Next].
Step 6. Set firewall
In the firewall settings, Create an ACG (Access Control Group) or select an ACG you have.
① If it is your first time to create a server, click [Create ACG].
② ACG name
Enter a suitable name. We entered
③ Access source
Write the IP or band that you are trying to access. For example, enter 10.64.51.205 for a single IP and 10.64.51.0/24 for all accesses in the 10.64.51.XXX band. If the internal Private IP goes out via NAT, you must enter Public IP.
④ Allowed port
If you want to open a port individually, enter the required port number into the allowed port (service) and click [Add]. If you need more than one port, add a line to enter. To open all ports, enter 1-65535. However, in this case, the server becomes vulnerable
⑤ Click [Add] on the right.
⑥ Check the final settings of the server to be created.
⑦ Click [Create].
Step 7. Confirm
After going through the steps above, the pem key file should be kept in a safe place on my computer and you should remember the ACG settings. Please note that you cannot access the server you created if you do not have a pem key file.
① Click [Create server].
② Wait for the server to be created.
Server initial setting procedure
After creating the server, you need to set public IP or set port forwarding to access the server. To use CM, it is necessary to set public IP address.
Set public IP
To access the server created above from outside, public IP setting is required.
- Proceed by referring to Public IP User Guide.
① Click Public IP in the sidebar.
② Click [Allocated New IP].
- You can create as many public IPs as the number of servers you have.
③ Select the created server from the Select server drop-down list.
④ Click [Next].
⑤ Click [Create].
⑥ After a few minutes, an IP address is assigned.
- If a normal public IP is assigned, you can access the server directly by using the terminal program via 220.230.116.207:22.
Set port forwarding for terminal access
You must set port forwarding to connect to the server using the public IP for server connection, which is described in the port forwarding information.
- Proceed referring to Port Forwarding Guide.
① Select the server and click [Set port forwarding] at the top.
② Register the external port for ssh connection in the port forwarding setting in the screen below.
③ Select [Add].
④ Click [Apply].
Get server password
① Select the server you want.
② On the Manage servers menu, click [Get admin password].
③ Click [Drop files here or click to upload] to upload the pem file stored on your computer.
④ Click [Get admin password].
⑤ It shows the admin password provided at the time of initial creation.
- You can access using the above password when you log on for the first time, and change the password on the server for future management.
Connect to server using terminal
This section describes how to connect to the NAVER CLOUD Platform CUBRID from a server using a terminal.
Connect to server using public IP
① Enter the server connection information.
- Port: Default port number (22)
- Host Name (or IP address): Issued public IP (e.g.: 220.230.116.207)
② Click [Open] to connect.
③ Click [Yes] to connect.
④ Enter account name root and press the
⑤ Enter the admin password.
Connect to server using port forwarding
① Enter the server connection information.
- Port: Port number set by port forwarding (e.g.: 1234)
- Host Name (or IP address): Public IP for server connection shown on the port forwarding screen (e.g.: 1.255.57.22)
② Click [Open] to connect.
③ Click [Yes] to connect.
④ Enter the account name root and press the
⑤ Enter the admin password.
How to acccess using terminal
This section describes simple tips to connect/run/stop to CUBRID from terminal.
Connection using your CUBRID account
CUBRID DB was created in the cubrid account, not the root account, but the connection account.
Connect to the cubrid account with the following command.
[root@cubrid-ncloud ~]# sudo su - cubrid
[cubrid@cubrid-ncloud ~]$
Check CUBRID status
Check whether the CUBRID related process is running with the following command.
[cubrid@cubrid-ncloud ~]$ cubrid service status
Stop and start CUBRID
To stop and start CUBRID related processes, execute the following command.
[cubrid@cubrid-ncloud ~]$ cubrid service stop
[cubrid@cubrid-ncloud ~]$ cubrid service start
Connect to CUBRID DB and change password
To connect to CUBRID DB, execute the following command.
- A demodb created as the default DB is created.
- dba is created as the default account, and the dba account is the DB administrator account.
- The dba account does not have an initial password specified.
[cubrid@cubrid-ncloud ~]$ csql -u dba demodb
For security, we recommend changing your password on first login.
The password can be changed using the following command.
csql> alter user dba password 'password';
Use CLI-based monitoring tool (statdump.sh)
The CUBRID service provided by the NAVER CLOUD platform offers a CLI (Command Line Interface) monitoring program.
Overview
It is a program to view CUBRID DB status change.
It displays DB Status on the screen in 1 second increments so that you can monitor DB status change close to real-time.
How to use
Installation path: /home1/cubrid/bin/statdump.sh
How to use: statdump.sh dbname
User screen
Monitoring metrics description
Property | Description |
---|---|
SELECT | SELECT query count processed in the DB |
INSERT | INSERT query count processed in the DB |
UPDATE | UPDATE query count processed in the DB |
DELETE | DELETE query count processed in the DB |
FETCHES | Page count fetched from the DB |
IO READ | Page count read from the disk |
IO WRITE | Page count written in the disk |
Connect and operate using CM
It explains how to access NAVER CLOUD Platform CUBRID and simple operation method to server with Cubrid Manager (hereinafter CM) which is a GUI tool provided by CUBRID.
For detailed description, refer to the CM manual page. (http://www.cubrid.org/manual/ko/9.3.0/cm/index.html)
Download CM
Download the CM from the URL below, which is the official CUBRID website.
(Download URL: http://www.cubrid.org/?mid=downloads&item=cubrid_manager&os=detect )
Select the appropriate OS for your environment and download.
CM features description
Add connection information
① Click [Add Host].
② Enter the appropriate value.
- Host name: Enter the appropriate alias. We entered as cubrid-ncloud.
- Address: Enter the issued public IP. (e.g.: 220.230.116.207 )
- Port: Use the default port 8001.
- User name: Use "admin" which is a CM's default user.
- The "admin" is the CM administrator account, and DBA is the administrator account for each database.
- Password: Password for accessing CUBRID Manager server. It is admin for the first connection.
③ Click [Browse] to update the JDBC driver.
- When this operation is not performed, you may not be able to connect because there is no driver.
④ Click [Test Connection] to check if the CM is properly connected to the CUBRID DB.
⑤ Click [Add] to add it to the host list.
Change CM admin password
For security, we recommend changing your password on first login.
① Click [Users] from the top menu.
② Click Change Password.
① Enter the initial password, admin.
② Enter a password of at least 4 bytes, excluding spaces and admin.
③ Click [OK] to apply.
- You can reset the admin password, but be careful not to forget it.
① Click [Yes] to log in again with the new password.
- If you do not reconnect, database connection will not work properly due to permissions issue.
Check CUBRID status
① The green color in each metrics indicates that it is running.
- The demodb that is created by default DB is running.
- If it is stopped, it will be red.
Stop and run CUBRID
① Right-click the demodb database.
② You can use several menus to manage the database.
③ Click [Stop Database] to stop the database.
- The broker can be stopped and started in the same way.
Connect to CUBRID DB and change password
① Right-click the demodb database.
② Click [Login Database].
① The user name is the DB administrator account "dba." Leave the password blank.
- The dba is created as the default account, and no initial password is specified.
- For security, we recommend changing your password on first login.
② Perform Test Connection to check the connection status.
- If you do not reconnect after changing the admin password, you will not be able to connect normally.
- Reconnect and try again.
③ Click [OK].
① Right-click the demodb database.
② Click [New Query Editor].
① Use the following command to change the password for the dba account.
- To prevent unauthorized access, password must be changed at first connection.
alter user dba password 'password';
② Click the
This is a description of the query editor buttons.
Host dashboard
① Right-click the cubrid-ncloud server name.
② Click Show host dashboard.
- Database Volumes: You can check the volume usage by database.
- Brokers: Outputs ports and status information per broker process.
- System Status: Memory, CPU, TPS, and QPS information of the current server can be viewed for an average of 5 minutes. When you open the dashboard, it outputs the current status every second for 15 seconds, and every 30 seconds thereafter. If you click the refresh icon on the upper right corner, it will output the current status every second for 15 seconds again.
- Databases: You can check the operational status of each database.
- System Information: You can check the CUBRID version, Broker version, and server path.
Resource Monitoring
The resource monitoring of the CM calculates the information collected by the server on a daily, weekly, or monthly basis and shows it in graphs.
While it is easy to compare the status of servers, resource monitoring can cause some CPU usage and disk I/O.
The default setting is to not collect information, and you must restart the CM process after changing the value of support_mon_statistic to YES in the cm.conf file.
Preparation for resource monitoring
[cubrid@cubrid-ncloud ~]$ cd ~/CUBRID/conf
[cubrid@cubrid-ncloud conf]$ cat cm.conf | grep support_mon_statistic
#support_mon_statistic=NO
[cubrid@cubrid-ncloud conf]$ sed --in-place -e "s/#support_mon_statistic=NO/support_mon_statistic=YES/g" cm.conf
[cubrid@cubrid-ncloud conf]$ cat cm.conf | grep support_mon_statistic
support_mon_statistic=YES
[cubrid@cubrid-ncloud conf]$ cubrid manager stop
@ cubrid manager server stop
++ cubrid manager server stop: success
[cubrid@cubrid-ncloud conf]$ cubrid manager start
@ cubrid manager server start
++ cubrid manager server start: success
Add resource monitoring
① Click the Monitoring tab.
② Right-click and click [Add Resource Monitoring].
① Enter the dashboard name.
- Dashboard names must be in English letters/numbers and up to 33 characters long.
- We created as ncloudcubrid.
① Click [Go to Edit Mode].
① Click the [+] screen to add a graph.
② Click [Add Host].
① Enter the information you want to check with the monitoring metrics.
- Host Name: You can drop down the hosts registered in the host tab. Click Cubrid-ncloud.
- Data Type: You can select the database/volume/broker/OS type. Click Operating System.
- Time Type: You can select day/week/month/year. We selected day.
- Metric: Click the information you want to see. We selected OS Physic Memory Free.
② Click [OK].
① Click [Add Host] to add the OS Swap graph as well.
② Click [OK].
① You can click the + screen to add various graphs.
② When you have finished drawing the graph, click [Back to View Mode] to change the mode.
See also
You can see the related topics listed below.
- CUBRID 9.2 User Manual: http://www.cubrid.org/manual/en/9.2.0/
- CUBRID Driver Downloads: http://ftp.cubrid.org/CUBRID_Drivers/
- CUBRID Manager User Manual: http://www.cubrid.org/manual/ko/9.3.0/cm/index.html