.. _map-r-d-b-sink-connector: MapR DB Sink Connector for |cp| =============================== The |kconnect-long| MapR DB Connector provides a way to export data from a |ak-tm| topic and write data to a MapR DB cluster. Prerequisites ------------- The following are required to run the |kconnect-long| MapR DB Sink Connector: * Kafka Broker: |cp| 3.3.0 or above, or |ak| 0.11.0 or above * |kconnect|: |cp| 4.1.0 or above, or |ak| 1.1.0 or above (requires header support in Connect) * MapR DB 5.x or higher * MapR DB (Installed locally in `opt/mapr`) * Java 1.8 Install the MapR DB Connector ----------------------------- Prerequisite This connector requires that the MapR Client is installed and working properly on the host running the connect worker process. The |kconnect-long| worker process must be started with this command: .. codewithvars:: bash -Dmapr.home.dir=/opt/mapr -Dmapr.library.flatclass You can do this by exporting the KAFKA_OPTS environment variable before starting |kconnect-long|. For example: .. codewithvars:: bash export KAFKA_OPTS="-Dmapr.home.dir=/opt/mapr -Dmapr.library.flatclass" .. include:: ../includes/connector-install.rst .. include:: ../includes/connector-install-hub.rst .. codewithvars:: bash confluent-hub install confluentinc/kafka-connect-maprdb:latest .. include:: ../includes/connector-install-version.rst .. codewithvars:: bash confluent-hub install confluentinc/kafka-connect-maprdb:1.0.0-preview -------------------------- Install Connector Manually -------------------------- `Download and extract the ZIP file `_ for your connector and then follow the manual connector installation :ref:`instructions `. License ------- .. include:: ../includes/enterprise-license.rst See :ref:`map-r-d-b-sink-connector-license-config` for license properties and :ref:`map-r-d-b-sink-license-topic-configuration` for information about the license topic. Usage Notes ----------- The table on the MapR DB cluster is selected based on the topic name. If you need to change this take a look at the :ref:`RegexRouter ` transformation which can be used to change the topic name before it's sent to MapR DB. Examples -------- ---------------------- Property-based example ---------------------- This configuration is used typically along with :ref:`standalone workers `. .. codewithvars:: properties :emphasize-lines: 4 name=MapRDBSinkConnector1 connector.class=io.confluent.connect.mapr.db.MapRDBSinkConnector tasks.max=1 topics=< Required Configuration > ------------------ REST-based example ------------------ This configuration is used typically along with :ref:`distributed workers `. Write the following json to `connector.json`, configure all of the required values, and use the command below to post the configuration to one the distributed connect worker(s). Check here for more information about the |kconnect-long| :ref:`REST API ` **Connect Distributed REST example:** .. codewithvars:: json :emphasize-lines: 6 { "config" : { "name" : "MapRDBSinkConnector1", "connector.class" : "io.confluent.connect.mapr.db.MapRDBSinkConnector", "tasks.max" : "1", "topics" : "< Required Configuration >" } } Use curl to post the configuration to one of the |kconnect-long| Workers. Change `http://localhost:8083/` the endpoint of one of your |kconnect-long| worker(s). **Create a new connector:** .. codewithvars:: bash curl -s -X POST -H 'Content-Type: application/json' --data @connector.json http://localhost:8083/connectors **Update an existing connector:** .. codewithvars:: bash curl -s -X PUT -H 'Content-Type: application/json' --data @connector.json http://localhost:8083/connectors/MapRDBSinkConnector1/config Additional documentation ------------------------ .. toctree:: :maxdepth: 1 map_r_d_b_sink_connector_config map_r_d_b_sink_connector_example