<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 1. 啟動Kafka集群 若Maxwell發送數據的目的地為Kafka集群,則需要先確保Kafka集群為啟動狀態。 # 2. Maxwell啟停 ## 1. 啟動Maxwell ``` /opt/module/maxwell/bin/maxwell --config /opt/module/maxwell/config.properties --daemon ``` ## 2. 停止Maxwell ``` ps -ef | grep maxwell | grep -v grep | grep maxwell | awk '{print $2}' | xargs kill -9 ``` ## 3. Maxwell啟停腳本 1)創建并編輯Maxwell啟停腳本 ``` cd /home/atguigu/bin vim mxw.sh ``` 2)腳本內容如下 ``` #!/bin/bash MAXWELL_HOME=/opt/module/maxwell status_maxwell(){ result=`ps -ef | grep com.zendesk.maxwell.Maxwell | grep -v grep | wc -l` return $result } start_maxwell(){ status_maxwell if [[ $? -lt 1 ]]; then echo "啟動Maxwell" $MAXWELL_HOME/bin/maxwell --config $MAXWELL_HOME/config.properties --daemon else echo "Maxwell正在運行" fi } stop_maxwell(){ status_maxwell if [[ $? -gt 0 ]]; then echo "停止Maxwell" ps -ef | grep com.zendesk.maxwell.Maxwell | grep -v grep | awk '{print $2}' | xargs kill -9 else echo "Maxwell未在運行" fi } case $1 in start ) start_maxwell ;; stop ) stop_maxwell ;; restart ) stop_maxwell start_maxwell ;; esac ``` 3) 添加執行權限 ``` chmod +x mxw.sh ``` # 3. 增量數據同步 ## 1. 啟動Kafka消費者 ``` bin/kafka-console-consumer.sh --bootstrap-server node1:9092 --topic maxwell ``` ## 2. 模擬生成數據 java -jar gmall2020-mock-db-2021-01-22.jar ## 3. 觀察Kafka消費者 # 4. 歷史數據全量同步 ## 1. Maxwell-bootstrap Maxwell提供了bootstrap功能來進行歷史數據的全量同步,命令如下: ``` #只執行一次,必須maxwell后臺運行 /opt/module/maxwell/bin/maxwell-bootstrap --database gmall --table user_info --config /opt/module/maxwell/config.properties ``` 2 boostrap數據格式 采用bootstrap方式同步的輸出數據格式如下: ``` { "database": "fooDB", "table": "barTable", "type": "bootstrap-start", "ts": 1450557744, "data": {} } { "database": "fooDB", "table": "barTable", "type": "bootstrap-insert", "ts": 1450557744, "data": { "txt": "hello" } } { "database": "fooDB", "table": "barTable", "type": "bootstrap-insert", "ts": 1450557744, "data": { "txt": "bootstrap!" } } { "database": "fooDB", "table": "barTable", "type": "bootstrap-complete", "ts": 1450557744, "data": {} } ``` **注意事項:** 1)第一條type為bootstrap-start和最后一條type為bootstrap-complete的數據,是bootstrap開始和結束的標志,不包含數據,中間的type為bootstrap-insert的數據才包含數據。 2)一次bootstrap輸出的所有記錄的ts都相同,為bootstrap開始的時間。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看