**MNODE的选择:** TDengine逻辑上有管理节点,但没有单独的执行代码,服务器侧只有一套执行代码taosd。那么哪个数据节点会是管理节点呢?这是系统自动决定的,无需任何人工干预。原则如下:一个数据节点启动时,会检查自己的End Point, 并与获取的mnode EP List进行比对,如果在其中,该数据节点认为自己应该启动mnode模块,成为mnode。如果自己的EP不在mnode EP List里,则不启动mnode模块。在系统的运行过程中,由于负载均衡、宕机等原因,mnode有可能迁移至新的dnode,但一切都是透明的,无需人工干预,配置参数的修改,是mnode自己根据资源做出的决定。
snprintf(buffer,BUFFER_SIZE,"create table if not exists %s.%s%d %s;",winfo->db_name,superTblInfo->childTblPrefix,i,superTblInfo->colsOfCreatChildTable);
len+=snprintf(buffer+len,superTblInfo->maxSqlLen-len,"if not exists %s.%s%d using %s.%s tags %s ",winfo->db_name,superTblInfo->childTblPrefix,i,winfo->db_name,superTblInfo->sTblName,tagsValBuf);
len+=snprintf(pstr+len,superTblInfo->maxSqlLen-len,"insert into %s.%s%d using %s.%s tags %s values ",winfo->db_name,superTblInfo->childTblPrefix,tbl_id,winfo->db_name,superTblInfo->sTblName,tagsValBuf);
}else{
len+=snprintf(pstr+len,superTblInfo->maxSqlLen-len," %s.%s%d using %s.%s tags %s values ",winfo->db_name,superTblInfo->childTblPrefix,tbl_id,winfo->db_name,superTblInfo->sTblName,tagsValBuf);
len+=snprintf(pstr+len,
superTblInfo->maxSqlLen-len,
"insert into %s.%s%d using %s.%s tags %s values ",
len+=snprintf(pstr+len,superTblInfo->maxSqlLen-len,"insert into %s.%s%d using %s.%s tags %s values",winfo->db_name,superTblInfo->childTblPrefix,tID,winfo->db_name,superTblInfo->sTblName,tagsValBuf);
printf("====thread[%d] completed total inserted rows: %"PRId64", total affected rows: %"PRId64"====\n",winfo->threadID,totalRowsInserted,totalAffectedRows);
printf("====thread[%d] completed total inserted rows: %"PRId64", total affected rows: %"PRId64"====\n",
printf("####thread[%"PRId64"] complete all sqls to allocate all sub-tables[%d - %d] once queries duration:%.4fs\n\n",taosGetSelfPthreadId(),winfo->start_table_id,winfo->end_table_id,(double)(et-st)/1000.0);
printf("####thread[%"PRId64"] complete all sqls to allocate all sub-tables[%d - %d] once queries duration:%.4fs\n\n",
if $system_content != @{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep0,keep1,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","cachelast","precision","update","status"],"data":[],"rows":0}@ then
if $system_content != @{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep0,keep1,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","cachelast","precision","update","status"],"column_meta":[["name",8,32],["created_time",9,8],["ntables",4,4],["vgroups",4,4],["replica",3,2],["quorum",3,2],["days",3,2],["keep0,keep1,keep(D)",8,24],["cache(MB)",4,4],["blocks",4,4],["minrows",4,4],["maxrows",4,4],["wallevel",2,1],["fsync",4,4],["comp",2,1],["cachelast",2,1],["precision",8,3],["update",2,1],["status",8,10]],"data":[],"rows":0}@ then
if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1]],"rows":1}@ then
if $system_content != @{"status":"succ","head":["ts","speed"],"column_meta":[["ts",9,8],["speed",4,4]],"data":[["2017-12-25 21:28:41.022",1]],"rows":1}@ then
if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1]],"rows":1}@ then
if $system_content != @{"status":"succ","head":["ts","speed"],"column_meta":[["ts",9,8],["speed",4,4]],"data":[["2017-12-25 21:28:41.022",1]],"rows":1}@ then
system_content curl -u root:taosdata -d 'select * from db.sys_cpu_d_bbb_lga_1_web01' 127.0.0.1:7111/rest/sql/
print $system_content
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",18.000000000]],"rows":1}@ then
if $system_content != @{"status":"succ","head":["ts","value"],"column_meta":[["ts",9,8],["value",7,8]],"data":[["2012-09-05 20:00:00.000",18.000000000]],"rows":1}@ then
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",18.000000000],["2012-09-05 20:00:05.000",18.000000000]],"rows":2}@ then
if $system_content != @{"status":"succ","head":["ts","value"],"column_meta":[["ts",9,8],["value",7,8]],"data":[["2012-09-05 20:00:00.000",18.000000000],["2012-09-05 20:00:05.000",18.000000000]],"rows":2}@ then
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",8.000000000],["2012-09-05 20:00:05.000",9.000000000]],"rows":2}@ then
if $system_content != @{"status":"succ","head":["ts","value"],"column_meta":[["ts",9,8],["value",7,8]],"data":[["2012-09-05 20:00:00.000",8.000000000],["2012-09-05 20:00:05.000",9.000000000]],"rows":2}@ then