.. _controlcenterquickstart: |c3-short| Quick Start ====================== With this quick start you will set up and configure, `ZooKeeper `_, `Kafka `_, `Kafka Connect `_, and |c3-short|. You will then read and write data to and from Kafka. .. contents:: Contents :depth: 3 :local: .. _controlcenter_metrics_reporter_config: .. include:: includes/c3_installation.rst :start-line: 9 :end-line: 67 Configure and Start |c3-short| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ **Tip:** Start |c3-short| in its own terminal since this is a long running process. #. Define the number of partitions (````) and replication (````) settings for |c3-short| by adding these lines to your properties file (``/etc/confluent-control-center/control-center.properties``). .. sourcecode:: bash # Quick start partition and replication values confluent.controlcenter.internal.topics.partitions=1 confluent.controlcenter.internal.topics.replication=1 confluent.controlcenter.command.topic.replication=1 confluent.monitoring.interceptor.topic.partitions=1 confluent.monitoring.interceptor.topic.replication=1 confluent.metrics.topic.partitions=1 confluent.metrics.topic.replication=1 #. Start |c3-short| with your properties file specified. .. sourcecode:: bash $ /bin/control-center-start /etc/confluent-control-center/control-center.properties You can navigate to the |c3-short| web interface at http://localhost:9021/. .. figure:: images/c3home.png To use |c3-short|, users must have access the host that runs the application. (You can :ref:`configure ` the network port that |c3| uses to serve data.) Because |c3| is a web application, you may use a proxy to control and secure access to it. Setup stream monitoring ^^^^^^^^^^^^^^^^^^^^^^^ Now that you have all of the services running, you can start building a data pipeline. As an example, you can create a small job to create data. #. Open an editor and enter the following text (our apologies to William Carlos Williams), and save this as ``totail.sh``. .. sourcecode:: bash cat < totail.sh #!/usr/bin/env bash file=/tmp/totail.txt while true; do echo This is just to say >> \${file} echo >> \${file} echo I have eaten >> \${file} echo the plums >> \${file} echo that were in >> \${file} echo the icebox >> \${file} echo >> \${file} echo and which >> \${file} echo you were probably >> \${file} echo saving >> \${file} echo for breakfast >> \${file} echo >> \${file} echo Forgive me >> \${file} echo they were delicious >> \${file} echo so sweet >> \${file} echo and so cold >> \${file} sleep 1 done EOF #. Start this script. It writes the poem to ``/tmp/totail.txt`` once per second. Kafka Connect is used to load that into a Kafka topic. #. Run ``chmod`` to grant user execution permissions. .. sourcecode:: bash $ chmod u+x totail.sh #. Run the script. .. sourcecode:: bash $ ./totail.sh #. Use the Kafka Topics tool to create a new topic: .. sourcecode:: bash $ /bin/kafka-topics --zookeeper localhost:2181 --create --topic poem \ --partitions 1 --replication-factor 1 #. From the |c3-short| web interface `http://localhost:9021/ `__, click on the **Kafka Connect** button on the left side of the web interface. On this page you can see a list of sources that have been configured - by default it will be empty. Click the **New source** button. .. figure:: images/c3newsource.png #. From the **Connector Class** drop-down menu select `FileStreamSourceConnector`. Specify the **Connection Name** as `Poem-File-Source`. Once you have specified a name for the connection a set of other configuration options will appear. .. figure:: images/c3filestreamsourceconnector.png #. In the *General* section specify the **file** as ``/tmp/totail.txt`` and the **topic** as `poem`. .. figure:: images/c3specifypoem.png #. Click **Continue**, verify your settings, and then **Save & Finish** to apply the new configuration. .. figure:: images/c3verifyfinal.png #. Create a new sink. #. From the Kafka Connect tab, click the **Sinks** tab and then **New sink**. .. figure:: images/c3newsink.png #. From the **Topics** drop-down list, choose **poem** and click **Continue**. .. figure:: images/c3poemsink.png #. In the **Sinks** tab, set the Connection Class to ``FileStreamSinkConnector``, specify the Connection Name as `Poem-File-Sink`, and in the *General* section specify the **file** as ``/tmp/sunk.txt``. .. figure:: images/filestreamsinkconnector.png #. Click **Continue**, verify your settings, and then **Save & Finish** to apply the new configuration. .. figure:: images/c3poemfilesink.png Now that you have data flowing into and out of Kafka, let's monitor what's going on! #. Click the **Data Streams** tab and you will see a chart that shows the total number of messages produced and consumed on the cluster. If you scroll down, you will see more details on the consumer group for your sink. Depending on your machine, this chart may take a few minutes to populate. .. figure:: images/c3qsfinalview.png This quick start described Kafka, Kafka Connect, and Control Center. For component-specific quick start guides, see the documentation: * :ref:`Kafka Streams Quick Start` * :ref:`Kafka Connect Quick Start` * :ref:`Kafka REST Proxy Quick Start`