Menu

MySQL and MongoDB

Help
2019-10-18
2019-10-24
  • Eugen Trach

    Eugen Trach - 2019-10-18

    Hi, i configured symmetricds and pass from MySQL to mongoDB using instructions
    https://github.com/dinkarthakur/symmetric-mongo

    I want mongoDB to have a database with a name like in sym_router (TARGET_CATALOG_NAME), for some tables different databases
    but SymmetricDS creates with the name "default".
    It saves all tables in one database(default), ignoring tartget_catalog_name.

    My configuration for table MY_TABLE

    INSERT INTO `Symmetric`.`sym_channel` (`channel_id`, `processing_order`, `max_batch_size`, `max_batch_to_send`, `max_data_to_route`, `extract_period_millis`, `enabled`,
     `use_old_data_to_route`, `use_row_data_to_route`, `use_pk_data_to_route`, `reload_flag`, `file_sync_flag`, `contains_big_lob`, `batch_algorithm`, `data_loader_type`,
     `description`, `queue`, `max_network_kbps`, `data_event_action`, `create_time`, `last_update_by`, `last_update_time`) VALUES ('TEST_channel',
      '99999', '1000', '50', '10000', '0', '1', '1', '1', '1', '1', '0', '0', 'default', 'mongodb', NULL, 'default', '0.000', NULL, NOW(), NULL, NOW());
    
    
     INSERT INTO `Symmetric`.`sym_router` (`router_id`, `target_catalog_name`, `target_schema_name`,
      `target_table_name`, `source_node_group_id`, `target_node_group_id`, `router_type`, `router_expression`,
       `sync_on_update`, `sync_on_insert`, `sync_on_delete`, `use_source_catalog_schema`, `create_time`, `last_update_by`,
        `last_update_time`, `description`) VALUES ('TEST_router', 'TARGET_CATALOG_NAME', NULL, NULL,
         'PRIMARY', 'TEST', 'default', NULL, '1', '1', '1', '0',NOW(), NULL,NOW(), NULL);
    
       INSERT INTO `Symmetric`.`sym_trigger` (`trigger_id`, `source_catalog_name`, `source_schema_name`, `source_table_name`, `channel_id`, `reload_channel_id`, `sync_on_update`, `sync_on_insert`,
        `sync_on_delete`, `sync_on_incoming_batch`, `name_for_update_trigger`, `name_for_insert_trigger`, `name_for_delete_trigger`, `sync_on_update_condition`, `sync_on_insert_condition`,
         `sync_on_delete_condition`, `custom_before_update_text`, `custom_before_insert_text`, `custom_before_delete_text`, `custom_on_update_text`, `custom_on_insert_text`, `custom_on_delete_text`,
          `external_select`, `tx_id_expression`, `channel_expression`, `excluded_column_names`, `included_column_names`, `sync_key_names`, `use_stream_lobs`, `use_capture_lobs`, `use_capture_old_data`,
           `use_handle_key_updates`, `stream_row`, `create_time`, `last_update_by`, `last_update_time`, `description`) VALUES ('TEST_trigger', 'SRC_TABLE_NAME',
            NULL, 'MY_TABLE', 'TEST_channel', 'TEST_channel', '0', '1', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '0', '1', '1', '0', NOW(), NULL, NOW(), NULL);
    
    
       INSERT INTO `Symmetric`.`sym_trigger_router` (`trigger_id`, `router_id`, `enabled`, `initial_load_order`, `initial_load_select`, `initial_load_delete_stmt`, `ping_back_enabled`, `create_time`,
            `last_update_by`, `last_update_time`, `description`) VALUES ('TEST_trigger', 'TEST_router', '1', '1', NULL, NULL, '0',NOW(), NULL,
             NOW(), NULL);
    
    
               INSERT INTO `Symmetric`.`sym_table_reload_request` (`target_node_id`, `source_node_id`, `trigger_id`, `router_id`, `create_time`, `create_table`, `delete_first`, `reload_select`, `before_custom_sql`,
      `reload_time`, `load_id`, `processed`, `channel_id`, `last_update_by`, `last_update_time`) VALUES ('TEST', 'CENTRALANALYTICS', 
      'TEST_trigger',
       'TEST_router', NOW(), '1', '0', NULL, NULL, NULL, NULL, '0', 'TEST_channel', NULL, NOW());
    
     

    Last edit: Eugen Trach 2019-10-18
  • Josh Hicks

    Josh Hicks - 2019-10-23

    It does not use the router target catalog and schema (as the documentation states). It uses a single property mongodb.default.databasename. You could add an issue to the tracker to have this feature added fully.

     
  • Eugen Trach

    Eugen Trach - 2019-10-24

    ok, thank you

     

Log in to post a comment.