I start a MemSQL 6.5 locally, 3306 as aggregator, 3307 as leaf. And i connect 3306 and run create table (using Golang), but I get this:
Error 1752: Creating a database on a leaf is forbidden. Instead call this on the master aggregator.
Creating database output:
Waiting for cluster to start…
Cluster started.
Elapsed Time: 6 seconds
Ready for connections, tailing master log.
04448707 2018-11-28 09:12:29.162 INFO: Thread 115077: SendFile: cluster
log: Sending file id 0x0 to node 2, starting offset 0x0, requested size 0xf000.
04448804 2018-11-28 09:12:29.162 INFO: Thread 115077: SendFile: cluster
log: Sending file id 0x0 to node 2, starting offset 0x0, actual size 0xf000.
04455687 2018-11-28 09:12:29.169 INFO: Thread 115077: operator(): cluster
log: Adding slave id 2, node id 2 at barrier number 1.
04455746 2018-11-28 09:12:29.169 INFO: Thread 115077: AddSlave: cluster
log: Addition mentioned above took effect at LSN 0xf.
05333473 2018-11-28 09:12:30.047 INFO: ADD LEAF _SYNC_PARTITION 14 finished
05333582 2018-11-28 09:12:30.047 INFO: Thread 100000: ShardingAddLeafNodeWrapped: Adding new of a leaf 127.0.0.1:3307 is performing attaching of partitions.
05333723 2018-11-28 09:12:30.047 INFO: Thread 100000: SaveState: Leaf 2 (127.0.0.1:3307) has transitioned from ‘attaching’ to ‘online’
05338071 2018-11-28 09:12:30.051 INFO: ADD LEAF _SYNC_PARTITION 16 started
05735823 2018-11-28 09:12:30.449 INFO: ADD LEAF _SYNC_PARTITION 16 finished
05736025 2018-11-28 09:12:30.449 INFO: Thread 100000: operator(): Done Adding new leaf node distributed@127.0.0.1:3307
Any suggestion is appreciated.Many thx
jack
November 28, 2018, 4:03pm
2
Can you grab the output of SHOW AGGREGATORS and SHOW LEAVES to check what the node types are?
mysql> show AGGREGATORS;
±----------±-----±-------±-------------------±-----------------------------±------------------±-------+
| Host | Port | State | Opened_Connections | Average_Roundtrip_Latency_ms | Master_Aggregator | NodeId |
±----------±-----±-------±-------------------±-----------------------------±------------------±-------+
| 127.0.0.1 | 3306 | online | 1 | NULL | 1 | 1 |
±----------±-----±-------±-------------------±-----------------------------±------------------±-------+
1 row in set (0.00 sec)
mysql>
mysql>
mysql> show LEAVES;
±----------±-----±-------------------±----------±----------±-------±-------------------±-----------------------------±-------+
| Host | Port | Availability_Group | Pair_Host | Pair_Port | State | Opened_Connections | Average_Roundtrip_Latency_ms | NodeId |
±----------±-----±-------------------±----------±----------±-------±-------------------±-----------------------------±-------+
| 127.0.0.1 | 3307 | 1 | NULL | NULL | online | 2 | 0.426 | 2 |
±----------±-----±-------------------±----------±----------±-------±-------------------±-----------------------------±-------+
1 row in set (0.00 sec)
thanks!
carl
November 30, 2018, 2:52am
4
Please verify that you are connecting to the Master Aggregator in your Go code. You can verify that create table is working via running it in the CLI. Note that only the Master Aggregator can create tables (and in general modify schema objects) - only DML can be run on Child Aggregators .
Hello I am new to MEMSQL …Please help as i am getting error like ERROR 1752 (HY000): Creating a database on a leaf is forbidden. Instead call this on the master aggregator.
Please help…!!
adam
February 16, 2020, 4:54am
6
Try out what Jack mentioned above. Run SHOW AGGREGATORS
and make sure your connecting to those hosts/ports when running queries. Leaves are internal nodes that MemSQL manages for you, you shouldn’t connect directly to them.