Versions available for this page: CUBRID 8.4.3 | CUBRID 9.0.0 |
Change shard.conf, the default configuration file, as shown below:
Caution: The port number and the shared memory identifier should be appropriately changed to the value which has not been assigned by the system.
[shard]
MASTER_SHM_ID =45501
ADMIN_LOG_FILE =log/broker/cubrid_broker.log
[%shard1]
SERVICE =ON
BROKER_PORT =45511
MIN_NUM_APPL_SERVER =1
MAX_NUM_APPL_SERVER =1
APPL_SERVER_SHM_ID =45511
LOG_DIR =log/broker/sql_log
ERROR_LOG_DIR =log/broker/error_log
SQL_LOG =ON
TIME_TO_KILL =120
SESSION_TIMEOUT =300
KEEP_CONNECTION =ON
MAX_PREPARED_STMT_COUNT =1024
SHARD_DB_NAME =shard1
SHARD_DB_USER =shard
SHARD_DB_PASSWORD =shard123
NUM_PROXY_MIN =1
NUM_PROXY_MAX =1
PROXY_LOG_FILE =log/broker/proxy_log
PROXY_LOG =ALL
MAX_CLIENT =10
METADATA_SHM_ID =45591
SHARD_CONNECTION_FILE =shard_connection.txt
SHARD_KEY_FILE =shard_key.txt
For CUBRID, the server port number is not separately configured in the shard_connection.txt but the cubrid_port_id parameter of the cubrid.conf configuration file is used. Therefore, set the cubrid_port_id parameter of the cubrid.conf identical to the server.
# TCP port id for the CUBRID programs (used by all clients).
cubrid_port_id=41523
Set shard_key.txt, the shard DB mapping configuration file, for the shard key hash value as follows:
[%shard_key]
#min max shard_id
0 63 0
64 127 1
128 191 2
192 255 3
Configure the shard_connection.txt file which is shard database configuration file, as follows:
# shard-id real-db-name connection-info
# * cubrid : hostname, hostname, ...
# * mysql : hostname:port
0 shard1 HostA
1 shard1 HostB
2 shard1 HostC
3 shard1 HostD