Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register


0
(click on this box to dismiss)

can't make cubrid shard work

Hi,

 

I'm trying your sample found at http://www.cubrid.org/manual/92/en/shard.html#quick-start but can't make it work with shard_key.txt filled :(

Here is my configuration :

#conf/shard_key.txt 

[%shard_key]

#min max shard_id

#0 255 0

#256 511 1

#512 767 0

#768 1024 1

 

#conf/shard_connection.txt 

0 sharddb node1:3306

1 sharddb node2:3306

#conf/cubrid_broker.conf   

[broker]

MASTER_SHM_ID           =45001

ADMIN_LOG_FILE          =log/broker/cubrid_broker.log

 

[%sharddb]

SERVICE                 =ON

BROKER_PORT             =45011

MIN_NUM_APPL_SERVER     =6

MAX_NUM_APPL_SERVER     =12

APPL_SERVER_SHM_ID      =45011

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

SHARD                   =ON

SHARD_DB_NAME           =sharddb

SHARD_DB_USER           =shard

SHARD_DB_PASSWORD       =shard123

SHARD_NUM_PROXY         =1

SHARD_PROXY_LOG_DIR     =log/broker/proxy_log

SHARD_PROXY_LOG         =ERROR

SHARD_MAX_CLIENTS       =256

SHARD_PROXY_SHM_ID      =36090

SHARD_CONNECTION_FILE   =shard_connection.txt

SHARD_KEY_FILE          =shard_key.txt

APPL_SERVER             =CAS_MYSQL

 

$ cubrid service status

@ cubrid broker status

% sharddb

----------------------------------------------------------------------

        ID   PID                  QPS        LQS   PSIZE STATUS       

----------------------------------------------------------------------

     1-0-1 10518                 1028          0   41676 IDLE         

     1-0-2 10519                    0          0   41544 IDLE         

     1-0-3 10520                    0          0   41544 IDLE         

     1-1-1 10521                 1025          0   41548 IDLE         

     1-1-2 10522                    0          0   41544 IDLE         

     1-1-3 10523                    0          0   41544 IDLE         

 

root@node2:/opt/cubrid/conf# cubrid service status

@ cubrid master status

++ cubrid master is not running.

@ cubrid server status

++ cubrid master is not running.

@ 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 

============================================================================

* sharddb              10516 45011     6    0                 2056                 2053        0     2053        0        0        0     0/60.0     0/60.0             3             0         0 

@ cubrid manager server status

 

++ cubrid manager server is not running.

$ cubrid broker status -f

@ cubrid broker status

% sharddb

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

        ID   PID                  QPS        LQS   PSIZE STATUS          LAST ACCESS TIME               DB             HOST   LAST CONNECT TIME       CLIENT IP      CLIENT VERSION    SQL_LOG_MODE   TRANSACTION STIME  #CONNECT  #RESTART 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

     1-0-1 10518                 1028          0   41676 IDLE         2014/01/28 16:51:54          sharddb sharddb:node1:33 2014/01/28 16:40:43         0.0.0.0                                   -                   -         0         0 

     1-0-2 10519                    0          0   41544 IDLE         2014/01/28 16:40:43          sharddb sharddb:node1:33 2014/01/28 16:40:43         0.0.0.0                                   -                   -         0         0 

     1-0-3 10520                    0          0   41544 IDLE         2014/01/28 16:40:43          sharddb sharddb:node1:33 2014/01/28 16:40:43         0.0.0.0                                   -                   -         0         0 

     1-1-1 10521                 1025          0   41548 IDLE         2014/01/28 16:51:05          sharddb sharddb:node2:33 2014/01/28 16:40:43         0.0.0.0                                   -                   -         0         0 

     1-1-2 10522                    0          0   41544 IDLE         2014/01/28 16:40:43          sharddb sharddb:node2:33 2014/01/28 16:40:43         0.0.0.0                                   -                   -         0         0 

 

     1-1-3 10523                    0          0   41544 IDLE         2014/01/28 16:40:43          sharddb sharddb:node2:33 2014/01/28 16:40:43         0.0.0.0                                   -                   -         0         0 

 

If I try to fill shard_key.txt:

 

#conf/shard_key.txt 

[%shard_key]

#min max shard_id

0 255 0

256 511 1

512 767 0

768 1024 1

 

I get :

$ cubrid broker stop

@ cubrid broker stop

++ cubrid broker stop: success

 

$ cubrid broker start

@ cubrid broker start

failed to metadata validate check [sharddb]

sharddb: failed to initialize proxy shared memory.

++ cubrid broker start: fail

Is there anything wrong in our configuration file ?

 

 

Another question is concerning csql. Can we use it to access our mysql shard ? If I try to use it I get an error :

 

$ csql -C -u shard -p 'shard123' sharddb@localhost -c "select * from student"

Cannot make connection to master server on host "localhost".... No such file or directory

Failed to connect to database server, 'sharddb', on the following host(s): localhost

ERROR: Failed to connect to database server, 'sharddb', on the following host(s): localhost

But I don't have any error in broker log. Does it use the broker ? I tried with mysql and the broker port but it's stalled and does not print anything
Thanks
link comment (0)
asked 7 months ago
cscetbon
15
No answers




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: