{"id":51371,"date":"2023-07-26T05:38:13","date_gmt":"2023-07-25T21:38:13","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=51371"},"modified":"2023-07-26T05:38:13","modified_gmt":"2023-07-25T21:38:13","slug":"centos6-8-deploy-jstorm-cluster","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/centos6-8-deploy-jstorm-cluster.html","title":{"rendered":"CentOS 6.8 \u5b9e\u6218\u90e8\u7f72JStorm\u96c6\u7fa4"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nAlibaba JStorm \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u4f01\u4e1a\u7ea7\u6d41\u5f0f\u8ba1\u7b97\u5f15\u64ce\uff0c\u662fApache Storm \u76844\u500d\u6027\u80fd\uff0c \u53ef\u4ee5\u81ea\u7531\u5207\u6362\u884c\u6a21\u5f0f\u6216mini-batch \u6a21\u5f0f\uff0cJStorm \u4e0d\u4ec5\u63d0\u4f9b\u4e00\u4e2a\u6d41\u5f0f\u8ba1\u7b97\u5f15\u64ce\uff0c \u8fd8\u63d0\u4f9b\u5b9e\u65f6\u8ba1\u7b97\u7684\u5b8c\u6574\u89e3\u51b3\u65b9\u6848\uff0c \u6d89\u53ca\u5230\u66f4\u591a\u7684\u7ec4\u4ef6\uff0c \u5982jstorm-on-yarn, jstorm-on-docker, SQL Engine, Exactly-Once Framework \u7b49\u7b49\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/a><\/p>\n

JStorm \u662f\u4e00\u4e2a\u5206\u5e03\u5f0f\u5b9e\u65f6\u8ba1\u7b97\u5f15\u64ce<\/div>\n

JStorm \u662f\u4e00\u4e2a\u7c7b\u4f3cHadoop MapReduce\u7684\u7cfb\u7edf\uff0c \u7528\u6237\u6309\u7167\u6307\u5b9a\u7684\u63a5\u53e3\u5b9e\u73b0\u4e00\u4e2a\u4efb\u52a1\uff0c\u7136\u540e\u5c06\u8fd9\u4e2a\u4efb\u52a1\u9012\u4ea4\u7ed9JStorm\u7cfb\u7edf\uff0cJStorm\u5c06\u8fd9\u4e2a\u4efb\u52a1\u8dd1\u8d77\u6765\uff0c\u5e76\u4e14\u63097 * 24\u5c0f\u65f6\u8fd0\u884c\u8d77\u6765\uff0c\u4e00\u65e6\u4e2d\u95f4\u4e00\u4e2aWorker \u53d1\u751f\u610f\u5916\u6545\u969c\uff0c \u8c03\u5ea6\u5668\u7acb\u5373\u5206\u914d\u4e00\u4e2a\u65b0\u7684Worker\u66ff\u6362\u8fd9\u4e2a\u5931\u6548\u7684Worker\u3002<\/p>\n

\u56e0\u6b64\uff0c\u4ece\u5e94\u7528\u7684\u89d2\u5ea6\uff0cJStorm\u5e94\u7528\u662f\u4e00\u79cd\u9075\u5b88\u67d0\u79cd\u7f16\u7a0b\u89c4\u8303\u7684\u5206\u5e03\u5f0f\u5e94\u7528\u3002\u4ece\u7cfb\u7edf\u89d2\u5ea6\uff0c JStorm\u662f\u4e00\u5957\u7c7b\u4f3cMapReduce\u7684\u8c03\u5ea6\u7cfb\u7edf\u3002 \u4ece\u6570\u636e\u7684\u89d2\u5ea6\uff0cJStorm\u662f\u4e00\u5957\u57fa\u4e8e\u6d41\u6c34\u7ebf\u7684\u6d88\u606f\u5904\u7406\u673a\u5236\u3002<\/p>\n

\u5b9e\u65f6\u8ba1\u7b97\u73b0\u5728\u662f\u5927\u6570\u636e\u9886\u57df\u4e2d\u6700\u706b\u7206\u7684\u4e00\u4e2a\u65b9\u5411\uff0c\u56e0\u4e3a\u4eba\u4eec\u5bf9\u6570\u636e\u7684\u8981\u6c42\u8d8a\u6765\u8d8a\u9ad8\uff0c\u5b9e\u65f6\u6027\u8981\u6c42\u4e5f\u8d8a\u6765\u8d8a\u5feb\uff0c\u4f20\u7edf\u7684Hadoop MapReduce\uff0c\u9010\u6e10\u6ee1\u8db3\u4e0d\u4e86\u9700\u6c42\uff0c\u56e0\u6b64\u5728\u8fd9\u4e2a\u9886\u57df\u9700\u6c42\u4e0d\u65ad\u3002<\/p>\n

Storm\u7ec4\u4ef6\u548cHadoop\u7ec4\u4ef6\u5bf9\u6bd4<\/strong><\/span><\/div>\n\n\n\n\n\n\n\n\n\n
<\/th>\nJStorm<\/th>\nHadoop<\/th>\n<\/tr>\n<\/thead>\n
\u89d2\u8272<\/td>\nNimbus<\/td>\nJobTracker<\/td>\n<\/tr>\n
Supervisor<\/td>\nTaskTracker<\/td>\n<\/tr>\n
Worker<\/td>\nChild<\/td>\n<\/tr>\n
\u5e94\u7528\u540d\u79f0<\/td>\nTopology<\/td>\nJob<\/td>\n<\/tr>\n
\u7f16\u7a0b\u63a5\u53e3<\/td>\nSpout\/Bolt<\/td>\nMapper\/Reducer<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u4f18\u70b9<\/strong><\/span><\/div>\n

\u5728Storm\u548cJStorm\u51fa\u73b0\u4ee5\u524d\uff0c\u5e02\u9762\u4e0a\u51fa\u73b0\u5f88\u591a\u5b9e\u65f6\u8ba1\u7b97\u5f15\u64ce\uff0c\u4f46\u81eaStorm\u548cJStorm\u51fa\u73b0\u540e\uff0c\u57fa\u672c\u4e0a\u53ef\u4ee5\u8bf4\u4e00\u7edf\u6c5f\u6e56\uff1a \u7a76\u5176\u4f18\u70b9:<\/p>\n

    \n
  • \u5f00\u53d1\u975e\u5e38\u8fc5\u901f\uff1a\u63a5\u53e3\u7b80\u5355\uff0c\u5bb9\u6613\u4e0a\u624b\uff0c\u53ea\u8981\u9075\u5b88Topology\u3001Spout\u548cBolt\u7684\u7f16\u7a0b\u89c4\u8303\u5373\u53ef\u5f00\u53d1\u51fa\u4e00\u4e2a\u6269\u5c55\u6027\u6781\u597d\u7684\u5e94\u7528\uff0c\u5e95\u5c42RPC\u3001Worker\u4e4b\u95f4\u5197\u4f59\uff0c\u6570\u636e\u5206\u6d41\u4e4b\u7c7b\u7684\u52a8\u4f5c\u5b8c\u5168\u4e0d\u7528\u8003\u8651<\/li>\n
  • \u6269\u5c55\u6027\u6781\u597d\uff1a\u5f53\u4e00\u7ea7\u5904\u7406\u5355\u5143\u901f\u5ea6\uff0c\u76f4\u63a5\u914d\u7f6e\u4e00\u4e0b\u5e76\u53d1\u6570\uff0c\u5373\u53ef\u7ebf\u6027\u6269\u5c55\u6027\u80fd<\/li>\n
  • \u5065\u58ee\u5f3a\uff1a\u5f53Worker\u5931\u6548\u6216\u673a\u5668\u51fa\u73b0\u6545\u969c\u65f6\uff0c \u81ea\u52a8\u5206\u914d\u65b0\u7684Worker\u66ff\u6362\u5931\u6548Worker<\/li>\n
  • \u6570\u636e\u51c6\u786e\u6027\uff1a\u53ef\u4ee5\u91c7\u7528Ack\u673a\u5236\uff0c\u4fdd\u8bc1\u6570\u636e\u4e0d\u4e22\u5931\u3002 \u5982\u679c\u5bf9\u7cbe\u5ea6\u6709\u66f4\u591a\u4e00\u6b65\u8981\u6c42\uff0c\u91c7\u7528\u4e8b\u52a1\u673a\u5236\uff0c\u4fdd\u8bc1\u6570\u636e\u51c6\u786e\u3002<\/li>\n
  • \u5b9e\u65f6\u6027\u9ad8\uff1a JStorm \u7684\u8bbe\u8ba1\u504f\u5411\u5355\u884c\u8bb0\u5f55\uff0c\u56e0\u6b64\uff0c\u5728\u65f6\u5ef6\u8f83\u540c\u7c7b\u4ea7\u54c1\u66f4\u4f4e<\/li>\n<\/ul>\n
    \u5e94\u7528\u573a\u666f<\/strong><\/span><\/div>\n

    JStorm\u5904\u7406\u6570\u636e\u7684\u65b9\u5f0f\u662f\u57fa\u4e8e\u6d88\u606f\u7684\u6d41\u6c34\u7ebf\u5904\u7406\uff0c \u56e0\u6b64\u7279\u522b\u9002\u5408\u65e0\u72b6\u6001\u8ba1\u7b97<\/strong>\uff0c\u4e5f\u5c31\u662f\u8ba1\u7b97\u5355\u5143\u7684\u4f9d\u8d56\u7684\u6570\u636e\u5168\u90e8\u5728\u63a5\u53d7\u7684\u6d88\u606f\u4e2d\u53ef\u4ee5\u627e\u5230\uff0c \u5e76\u4e14\u6700\u597d\u4e00\u4e2a\u6570\u636e\u6d41\u4e0d\u4f9d\u8d56\u53e6\u5916\u4e00\u4e2a\u6570\u636e\u6d41\u3002<\/p>\n

    \u56e0\u6b64\uff0c\u5e38\u5e38\u7528\u4e8e:<\/p>\n

      \n
    • \u65e5\u5fd7\u5206\u6790\uff0c\u4ece\u65e5\u5fd7\u4e2d\u5206\u6790\u51fa\u7279\u5b9a\u7684\u6570\u636e\uff0c\u5e76\u5c06\u5206\u6790\u7684\u7ed3\u679c\u5b58\u5165\u5916\u90e8\u5b58\u50a8\u5668\u5982\u6570\u636e\u5e93\u3002\u76ee\u524d\uff0c\u4e3b\u6d41\u65e5\u5fd7\u5206\u6790\u6280\u672f\u5c31\u4f7f\u7528JStorm\u6216Storm<\/li>\n
    • \u7ba1\u9053\u7cfb\u7edf\uff0c \u5c06\u4e00\u4e2a\u6570\u636e\u4ece\u4e00\u4e2a\u7cfb\u7edf\u4f20\u8f93\u5230\u53e6\u5916\u4e00\u4e2a\u7cfb\u7edf\uff0c \u6bd4\u5982\u5c06\u6570\u636e\u5e93\u540c\u6b65\u5230Hadoop<\/li>\n
    • \u6d88\u606f\u8f6c\u5316\u5668\uff0c \u5c06\u63a5\u53d7\u5230\u7684\u6d88\u606f\u6309\u7167\u67d0\u79cd\u683c\u5f0f\u8fdb\u884c\u8f6c\u5316\uff0c\u5b58\u50a8\u5230\u53e6\u5916\u4e00\u4e2a\u7cfb\u7edf\u5982\u6d88\u606f\u4e2d\u95f4\u4ef6<\/li>\n
    • \u7edf\u8ba1\u5206\u6790\u5668\uff0c \u4ece\u65e5\u5fd7\u6216\u6d88\u606f\u4e2d\uff0c\u63d0\u70bc\u51fa\u67d0\u4e2a\u5b57\u6bb5\uff0c\u7136\u540e\u505acount\u6216sum\u8ba1\u7b97\uff0c\u6700\u540e\u5c06\u7edf\u8ba1\u503c\u5b58\u5165\u5916\u90e8\u5b58\u50a8\u5668\u3002\u4e2d\u95f4\u5904\u7406\u8fc7\u7a0b\u53ef\u80fd\u66f4\u590d\u6742\u3002<\/li>\n
    • \u5b9e\u65f6\u63a8\u8350\u7cfb\u7edf\uff0c \u5c06\u63a8\u8350\u7b97\u6cd5\u8fd0\u884c\u5728jstorm\u4e2d\uff0c\u8fbe\u5230\u79d2\u7ea7\u7684\u63a8\u8350\u6548\u679c<\/li>\n<\/ul>\n
      \u57fa\u672c\u6982\u5ff5<\/strong><\/span><\/div>\n

      \u9996\u5148\uff0cJStorm\u6709\u70b9\u7c7b\u4f3c\u4e8eHadoop\u7684MR\uff08Map-Reduce\uff09\uff0c\u4f46\u662f\u533a\u522b\u5728\u4e8e\uff0chadoop\u7684MR\uff0c\u63d0\u4ea4\u5230hadoop\u7684MR job\uff0c\u6267\u884c\u5b8c\u5c31\u7ed3\u675f\u4e86\uff0c\u8fdb\u7a0b\u5c31\u9000\u51fa\u4e86\uff0c\u800c\u4e00\u4e2aJStorm\u4efb\u52a1\uff08JStorm\u4e2d\u79f0\u4e3atopology\uff09\uff0c\u662f7*24\u5c0f\u65f6\u6c38\u8fdc\u5728\u8fd0\u884c\u7684\uff0c\u9664\u975e\u7528\u6237\u4e3b\u52a8kill\u3002<\/p>\n

      JStorm\u7ec4\u4ef6<\/strong><\/span><\/div>\n

      \u63a5\u4e0b\u6765\u662f\u4e00\u5f20\u6bd4\u8f83\u7ecf\u5178\u7684Storm\u7684\u5927\u81f4\u7684\u7ed3\u6784\u56fe\uff08\u8ddfJStorm\u4e00\u6837\uff09\uff1a<\/p>\n

      <\/p>\n

      \u56fe\u4e2d\u7684\u6c34\u9f99\u5934\uff08\u597d\u5427\uff0c\u6709\u70b9\u4fd7\uff09\u5c31\u88ab\u79f0\u4f5cspout\uff0c\u95ea\u7535\u88ab\u79f0\u4f5cbolt\u3002<\/p>\n

      \u5728JStorm\u7684topology\u4e2d\uff0c\u6709\u4e24\u79cd\u7ec4\u4ef6\uff1aspout\u548cbolt\u3002<\/p>\n

      # spout<\/strong><\/p>\n

      spout\u4ee3\u8868\u8f93\u5165\u7684\u6570\u636e\u6e90\uff0c\u8fd9\u4e2a\u6570\u636e\u6e90\u53ef\u4ee5\u662f\u4efb\u610f\u7684\uff0c\u6bd4\u5982\u8bf4kafaka\uff0cDB\uff0cHBase\uff0c\u751a\u81f3\u662fHDFS\u7b49\uff0cJStorm\u4ece\u8fd9\u4e2a\u6570\u636e\u6e90\u4e2d\u4e0d\u65ad\u5730\u8bfb\u53d6\u6570\u636e\uff0c\u7136\u540e\u53d1\u9001\u5230\u4e0b\u6e38\u7684bolt\u4e2d\u8fdb\u884c\u5904\u7406\u3002<\/p>\n

      # bolt<\/strong><\/p>\n

      bolt\u4ee3\u8868\u5904\u7406\u903b\u8f91\uff0cbolt\u6536\u5230\u6d88\u606f\u4e4b\u540e\uff0c\u5bf9\u6d88\u606f\u505a\u5904\u7406\uff08\u5373\u6267\u884c\u7528\u6237\u7684\u4e1a\u52a1\u903b\u8f91\uff09\uff0c\u5904\u7406\u5b8c\u4ee5\u540e\uff0c\u65e2\u53ef\u4ee5\u5c06\u5904\u7406\u540e\u7684\u6d88\u606f\u7ee7\u7eed\u53d1\u9001\u5230\u4e0b\u6e38\u7684bolt\uff0c\u8fd9\u6837\u4f1a\u5f62\u6210\u4e00\u4e2a\u5904\u7406\u6d41\u6c34\u7ebf\uff08pipeline\uff0c\u4e0d\u8fc7\u66f4\u7cbe\u786e\u7684\u5e94\u8be5\u662f\u4e2a\u6709\u5411\u56fe\uff09\uff1b\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7ed3\u675f\u3002<\/p>\n

      \u901a\u5e38\u4e00\u4e2a\u6d41\u6c34\u7ebf\u7684\u6700\u540e\u4e00\u4e2abolt\uff0c\u4f1a\u505a\u4e00\u4e9b\u6570\u636e\u7684\u5b58\u50a8\u5de5\u4f5c\uff0c\u6bd4\u5982\u5c06\u5b9e\u65f6\u8ba1\u7b97\u51fa\u6765\u7684\u6570\u636e\u5199\u5165DB\u3001HBase\u7b49\uff0c\u4ee5\u4f9b\u524d\u53f0\u4e1a\u52a1\u8fdb\u884c\u67e5\u8be2\u548c\u5c55\u73b0\u3002<\/p>\n

      \u7ec4\u4ef6\u7684\u63a5\u53e3<\/strong><\/span><\/div>\n

      JStorm\u6846\u67b6\u5bf9spout\u7ec4\u4ef6\u5b9a\u4e49\u4e86\u4e00\u4e2a\u63a5\u53e3\uff1anextTuple\uff0c\u987e\u540d\u601d\u4e49\uff0c\u5c31\u662f\u83b7\u53d6\u4e0b\u4e00\u6761\u6d88\u606f\u3002\u6267\u884c\u65f6\uff0c\u53ef\u4ee5\u7406\u89e3\u6210JStorm\u6846\u67b6\u4f1a\u4e0d\u505c\u5730\u8c03\u8fd9\u4e2a\u63a5\u53e3\uff0c\u4ee5\u4ece\u6570\u636e\u6e90\u62c9\u53d6\u6570\u636e\u5e76\u5f80bolt\u53d1\u9001\u6570\u636e\u3002<\/p>\n

      \u540c\u65f6\uff0cbolt\u7ec4\u4ef6\u5b9a\u4e49\u4e86\u4e00\u4e2a\u63a5\u53e3\uff1aexecute\uff0c\u8fd9\u4e2a\u63a5\u53e3\u5c31\u662f\u7528\u6237\u7528\u6765\u5904\u7406\u4e1a\u52a1\u903b\u8f91\u7684\u5730\u65b9\u3002<\/p>\n

      \u6bcf\u4e00\u4e2atopology\uff0c\u65e2\u53ef\u4ee5\u6709\u591a\u4e2aspout\uff0c\u4ee3\u8868\u540c\u65f6\u4ece\u591a\u4e2a\u6570\u636e\u6e90\u63a5\u6536\u6d88\u606f\uff0c\u4e5f\u53ef\u4ee5\u591a\u4e2abolt\uff0c\u6765\u6267\u884c\u4e0d\u540c\u7684\u4e1a\u52a1\u903b\u8f91\u3002<\/p>\n

      \u8c03\u5ea6\u548c\u6267\u884c<\/strong><\/span><\/div>\n

      \u63a5\u4e0b\u6765\u5c31\u662ftopology\u7684\u8c03\u5ea6\u548c\u6267\u884c\u539f\u7406\uff0c\u5bf9\u4e00\u4e2atopology\uff0cJStorm\u6700\u7ec8\u4f1a\u8c03\u5ea6\u6210\u4e00\u4e2a\u6216\u591a\u4e2aworker\uff0c\u6bcf\u4e2aworker\u5373\u4e3a\u4e00\u4e2a\u771f\u6b63\u7684\u64cd\u4f5c\u7cfb\u7edf\u6267\u884c\u8fdb\u7a0b\uff0c\u5206\u5e03\u5230\u4e00\u4e2a\u96c6\u7fa4\u7684\u4e00\u53f0\u6216\u8005\u591a\u53f0\u673a\u5668\u4e0a\u5e76\u884c\u6267\u884c\u3002<\/p>\n

      \u800c\u6bcf\u4e2aworker\u4e2d\uff0c\u53c8\u53ef\u4ee5\u6709\u591a\u4e2atask\uff0c\u5206\u522b\u4ee3\u8868\u4e00\u4e2a\u6267\u884c\u7ebf\u7a0b\u3002\u6bcf\u4e2atask\u5c31\u662f\u4e0a\u9762\u63d0\u5230\u7684\u7ec4\u4ef6(component)\u7684\u5b9e\u73b0\uff0c\u8981\u4e48\u662fspout\u8981\u4e48\u662fbolt\u3002<\/p>\n

      \u7528\u6237\u5728\u63d0\u4ea4\u4e00\u4e2atopology\u7684\u65f6\u5019\uff0c\u4f1a\u6307\u5b9a\u4ee5\u4e0b\u7684\u4e00\u4e9b\u6267\u884c\u53c2\u6570\uff1a<\/p>\n

      #\u603bworker\u6570<\/strong><\/p>\n

      \u5373\u603b\u7684\u8fdb\u7a0b\u6570\u3002\u4e3e\u4f8b\u6765\u8bf4\uff0c\u6211\u63d0\u4ea4\u4e00\u4e2atopology\uff0c\u6307\u5b9aworker\u6570\u4e3a3\uff0c\u90a3\u4e48\u6700\u540e\u53ef\u80fd\u4f1a\u67093\u4e2a\u8fdb\u7a0b\u5728\u6267\u884c\u3002\u4e4b\u6240\u4ee5\u662f\u53ef\u80fd\uff0c\u662f\u56e0\u4e3a\u6839\u636e\u914d\u7f6e\uff0cJStorm\u6709\u53ef\u80fd\u4f1a\u6dfb\u52a0\u5185\u90e8\u7684\u7ec4\u4ef6\uff0c\u5982_acker\u6216\u8005__topology_master\uff08\u8fd9\u4e24\u4e2a\u7ec4\u4ef6\u90fd\u662f\u7279\u6b8a\u7684bolt\uff09\uff0c\u8fd9\u6837\u4f1a\u5bfc\u81f4\u6700\u7ec8\u6267\u884c\u7684\u8fdb\u7a0b\u6570\u5927\u4e8e\u7528\u6237\u6307\u5b9a\u7684\u8fdb\u7a0b\u6570\u3002\u6211\u4eec\u9ed8\u8ba4\u662f\u5982\u679c\u7528\u6237\u8bbe\u7f6e\u7684worker\u6570\u5c0f\u4e8e10\u4e2a\uff0c\u90a3\u4e48__topology_master \u53ea\u662f\u4f5c\u4e3a\u4e00\u4e2atask\u5b58\u5728\uff0c\u4e0d\u72ec\u5360worker\uff1b\u5982\u679c\u7528\u6237\u8bbe\u7f6e\u7684worker\u6570\u91cf\u5927\u4e8e\u7b49\u4e8e10\u4e2a\uff0c\u90a3\u4e48__topology_master\u4f5c\u4e3a\u4e00\u4e2atask\u5c06\u72ec\u5360\u4e00\u4e2aworker<\/p>\n

      #\u6bcf\u4e2acomponent\u7684\u5e76\u884c\u5ea6<\/strong><\/p>\n

      \u4e0a\u9762\u63d0\u5230\u6bcf\u4e2atopology\u90fd\u53ef\u4ee5\u5305\u542b\u591a\u4e2aspout\u548cbolt\uff0c\u800c\u6bcf\u4e2aspout\u548cbolt\u90fd\u53ef\u4ee5\u5355\u72ec\u6307\u5b9a\u4e00\u4e2a\u5e76\u884c\u5ea6(parallelism)\uff0c\u4ee3\u8868\u540c\u65f6\u6709\u591a\u5c11\u4e2a\u7ebf\u7a0b(task)\u6765\u6267\u884c\u8fd9\u4e2aspout\u6216bolt\u3002<\/p>\n

      JStorm\u4e2d\uff0c\u6bcf\u4e00\u4e2a\u6267\u884c\u7ebf\u7a0b\u90fd\u6709\u4e00\u4e2atask id\uff0c\u5b83\u4ece1\u5f00\u59cb\u9012\u589e\uff0c\u6bcf\u4e00\u4e2acomponent\u4e2d\u7684task id\u662f\u8fde\u7eed\u7684\u3002<\/p>\n

      \u8fd8\u662f\u4e0a\u9762\u8fd9\u4e2atopology\uff0c\u5b83\u5305\u542b\u4e00\u4e2aspout\u548c\u4e00\u4e2abolt\uff0cspout\u7684\u5e76\u884c\u5ea6\u4e3a5\uff0cbolt\u5e76\u884c\u5ea6\u4e3a10\u3002\u90a3\u4e48\u6211\u4eec\u6700\u7ec8\u4f1a\u670915\u4e2a\u7ebf\u7a0b\u6765\u6267\u884c\uff1a5\u4e2aspout\u6267\u884c\u7ebf\u7a0b\uff0c10\u4e2abolt\u6267\u884c\u7ebf\u7a0b\u3002<\/p>\n

      \u8fd9\u65f6spout\u7684task id\u53ef\u80fd\u662f1\uff5e5\uff0cbolt\u7684task id\u53ef\u80fd\u662f6\uff5e15\uff0c\u4e4b\u6240\u4ee5\u662f\u53ef\u80fd\uff0c\u662f\u56e0\u4e3aJStorm\u5728\u8c03\u5ea6\u7684\u65f6\u5019\uff0c\u5e76\u4e0d\u4fdd\u8bc1task id\u4e00\u5b9a\u662f\u4ecespout\u5f00\u59cb\uff0c\u7136\u540e\u5230bolt\u7684\u3002\u4f46\u662f\u540c\u4e00\u4e2acomponent\u4e2d\u7684task id\u4e00\u5b9a\u662f\u8fde\u7eed\u7684\u3002<\/p>\n

      #\u6bcf\u4e2acomponent\u4e4b\u95f4\u7684\u5173\u7cfb<\/strong><\/p>\n

      \u5373\u7528\u6237\u9700\u8981\u53bb\u6307\u5b9a\u4e00\u4e2a\u7279\u5b9a\u7684spout\u53d1\u51fa\u7684\u6570\u636e\u5e94\u8be5\u7531\u54ea\u4e9bbolt\u6765\u5904\u7406\uff0c\u6216\u8005\u8bf4\u4e00\u4e2a\u4e2d\u95f4\u7684bolt\uff0c\u5b83\u53d1\u51fa\u7684\u6570\u636e\u5e94\u8be5\u88ab\u4e0b\u6e38\u54ea\u4e9bbolt\u5904\u7406\u3002<\/p>\n

      \u8fd8\u662f\u4ee5\u4e0a\u9762\u7684topology\u4e3a\u4f8b\uff0c\u5b83\u4eec\u4f1a\u5206\u5e03\u57283\u4e2a\u8fdb\u7a0b\u4e2d\u3002JStorm\u4f7f\u7528\u4e86\u4e00\u79cd\u5747\u5300\u7684\u8c03\u5ea6\u7b97\u6cd5\uff0c\u56e0\u6b64\u5728\u6267\u884c\u7684\u65f6\u5019\uff0c\u4f60\u4f1a\u770b\u5230\uff0c\u6bcf\u4e2a\u8fdb\u7a0b\u5206\u522b\u90fd\u5404\u67095\u4e2a\u7ebf\u7a0b\u5728\u6267\u884c\u3002\u5f53\u7136\uff0c\u7531\u4e8espout\u662f5\u4e2a\u7ebf\u7a0b\uff0c\u4e0d\u80fd\u5747\u5300\u5730\u5206\u914d\u52303\u4e2a\u8fdb\u7a0b\u4e2d\uff0c\u4f1a\u51fa\u73b0\u4e00\u4e2a\u8fdb\u7a0b\u53ea\u67091\u4e2aspout\u7ebf\u7a0b\u7684\u60c5\u51b5\uff1b\u540c\u6837\u5730\uff0c\u4e5f\u4f1a\u51fa\u73b0\u4e00\u4e2a\u8fdb\u7a0b\u4e2d\u67094\u4e2abolt\u7ebf\u7a0b\u7684\u60c5\u51b5\u3002<\/p>\n

      \u5728\u4e00\u4e2atopology\u7684\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u4e00\u4e2a\u8fdb\u7a0b\uff08worker\uff09\u6302\u6389\u4e86\uff0cJStorm\u68c0\u6d4b\u5230\u4e4b\u540e\uff0c\u4f1a\u4e0d\u65ad\u5c1d\u8bd5\u91cd\u542f\u8fd9\u4e2a\u8fdb\u7a0b\uff0c\u8fd9\u5c31\u662f7*24\u5c0f\u65f6\u4e0d\u95f4\u65ad\u6267\u884c\u7684\u6982\u5ff5\u3002<\/p>\n

      \u6d88\u606f\u7684\u901a\u4fe1<\/strong><\/span><\/div>\n

      \u4e0a\u9762\u63d0\u5230\uff0cspout\u7684\u6d88\u606f\u4f1a\u53d1\u9001\u7ed9\u7279\u5b9a\u7684bolt\uff0cbolt\u4e5f\u53ef\u4ee5\u53d1\u9001\u7ed9\u5176\u4ed6\u7684bolt\uff0c\u90a3\u8fd9\u4e4b\u95f4\u662f\u5982\u4f55\u901a\u4fe1\u7684\u5462\uff1f<\/p>\n

      \u9996\u5148\uff0c\u4ecespout\u53d1\u9001\u6d88\u606f\u7684\u65f6\u5019\uff0cJStorm\u4f1a\u8ba1\u7b97\u51fa\u6d88\u606f\u8981\u53d1\u9001\u7684\u76ee\u6807task id\u5217\u8868\uff0c\u7136\u540e\u770b\u76ee\u6807task id\u662f\u5728\u672c\u8fdb\u7a0b\u4e2d\uff0c\u8fd8\u662f\u5176\u4ed6\u8fdb\u7a0b\u4e2d\uff0c\u5982\u679c\u662f\u672c\u8fdb\u7a0b\u4e2d\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u76f4\u63a5\u8d70\u8fdb\u7a0b\u5185\u90e8\u901a\u4fe1\uff08\u5982\u76f4\u63a5\u5c06\u8fd9\u4e2a\u6d88\u606f\u653e\u5165\u672c\u8fdb\u7a0b\u4e2d\u76ee\u6807task\u7684\u6267\u884c\u961f\u5217\u4e2d\uff09\uff1b\u5982\u679c\u662f\u8de8\u8fdb\u7a0b\uff0c\u90a3\u4e48JStorm\u4f1a\u4f7f\u7528netty\u6765\u5c06\u6d88\u606f\u53d1\u9001\u5230\u76ee\u6807task\u4e2d\u3002<\/p>\n

      \u5b9e\u65f6\u8ba1\u7b97\u7ed3\u679c\u8f93\u51fa<\/strong><\/span><\/div>\n

      JStorm\u662f7*24\u5c0f\u65f6\u8fd0\u884c\u7684\uff0c\u5916\u90e8\u7cfb\u7edf\u5982\u679c\u9700\u8981\u67e5\u8be2\u67d0\u4e2a\u7279\u5b9a\u65f6\u95f4\u70b9\u7684\u5904\u7406\u7ed3\u679c\uff0c\u5e76\u4e0d\u4f1a\u76f4\u63a5\u8bf7\u6c42JStorm\uff08\u5f53\u7136\uff0cDRPC\u53ef\u4ee5\u652f\u6301\u8fd9\u79cd\u9700\u6c42\uff0c\u4f46\u662f\u6027\u80fd\u5e76\u4e0d\u662f\u592a\u597d\uff09\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u5728JStorm\u7684spout\u6216bolt\u4e2d\uff0c\u90fd\u4f1a\u6709\u4e00\u4e2a\u5b9a\u65f6\u5f80\u5916\u90e8\u5b58\u50a8\u5199\u8ba1\u7b97\u7ed3\u679c\u7684\u903b\u8f91\uff0c\u8fd9\u6837\u6570\u636e\u53ef\u4ee5\u6309\u7167\u4e1a\u52a1\u9700\u6c42\u88ab\u5b9e\u65f6\u6216\u8005\u8fd1\u5b9e\u65f6\u5730\u5b58\u50a8\u8d77\u6765\uff0c\u7136\u540e\u76f4\u63a5\u67e5\u8be2\u5916\u90e8\u5b58\u50a8\u4e2d\u7684\u8ba1\u7b97\u7ed3\u679c\u5373\u53ef\u3002<\/p>\n

      \u4ee5\u4e0a\u5185\u5bb9\u76f4\u63a5\u7c98\u8d34JStorm\u5b98\u7f51\uff0c\u5207\u52ff\u5410\u69fd<\/p>\n

      \u4e8c\u3001 Jstorm \u96c6\u7fa4\u5b89\u88c5<\/strong><\/div>\n
      1\u3001\u7cfb\u7edf\u73af\u5883\u51c6\u5907<\/strong><\/span><\/div>\n
      # OS: CentOS 6.8 mininal\r\n# host.ip: 10.1.1.78 aniutv-1\r\n# host.ip: 10.1.1.80 aniutv-2\r\n# host.ip: 10.1.1.97 aniutv-5<\/pre>\n
      2\u3001\u5b89\u88c5\u76ee\u5f55\u81ea\u5b9a\u4e49<\/strong><\/span><\/div>\n

      jstorm : \/opt\/jstorm \uff08\u6e90\u7801\u5b89\u88c5\uff09;<\/p>\n

      zookeeper : \/opt\/zookeeper\uff08\u6e90\u7801\u5b89\u88c5\uff09;<\/p>\n

      java : \/usr\/java\/jdk1.7.0_79 (rpm\u5305\u5b89\u88c5)<\/p>\n

      3\u3001zookeeper \u96c6\u7fa4\u5b89\u88c5<\/strong><\/span><\/div>\n

      zookeeper \u96c6\u7fa4\u53c2\u8003\uff08http:\/\/blog.csdn.net\/wh211212\/article\/details\/56014983\uff09<\/p>\n

      4\u3001zeromq \u5b89\u88c5<\/strong><\/span><\/div>\n

      zeromq\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/zeromq.org\/area:download\/<\/p>\n

      \u4e0b\u8f7dzeromq-4.2.1.tar.gz \u00a0\u5230\/usr\/local\/src<\/p>\n

      cd \/usr\/local\/src && tar -zxf zeromq-4.2.1.tar.gz -C \/opt<\/pre>\n

      cd \/opt\/zeromq-4.2.1 && .\/configure && make && sudo make install && sudo ldconfig<\/p>\n

      5\u3001jzmq\u5b89\u88c5<\/strong><\/span><\/div>\n
      cd \/opt &&\u00a0git clone\u00a0 https:\/\/github.com\/nathanmarz\/jzmq.git\r\n\r\n.\/autogen.sh &&\u00a0.\/configure &&\u00a0make &&\u00a0make install<\/pre>\n
      6\u3001JStorm\u5b89\u88c5<\/strong><\/span><\/div>\n
      wget https:\/\/github.com\/alibaba\/jstorm\/releases\/download\/2.1.1\/jstorm-2.1.1.zip -P \/usr\/local\/src\r\ncd \/usr\/local\/src && unzip jstorm-2.1.1.zip -d \/opt\r\ncd \/opt && mv jstorm-2.1.1 jstorm\r\n# mkdir \/opt\/jstorm\/jstorm_data\r\necho '# jstorm env' >> ~\/.bashrc\r\necho 'export JSTORM_HOME=\/opt\/jstorm' >> ~\/.bashrc\r\necho 'export PATH=$PATH:$JSTORM_HOME\/bin' >> ~\/.bashrc\r\nsource ~\/.bashrc<\/pre>\n

      # JStorm \u914d\u7f6e<\/strong><\/p>\n

      sed -i \/'storm.zookeeper.servers:\/a\\ - \"10.1.1.78\"' \/opt\/jstorm\/conf\/storm.yaml\r\nsed -i \/'storm.zookeeper.servers:\/a\\ - \"10.1.1.80\"' \/opt\/jstorm\/conf\/storm.yaml\r\nsed -i \/'storm.zookeeper.servers:\/a\\ - \"10.1.1.97\"' \/opt\/jstorm\/conf\/storm.yaml\r\nsed -i \/'storm.zookeeper.root\/a\\ nimbus.host: \"10.1.1.78\"' \/opt\/jstorm\/conf\/storm.yaml<>\r\n<\/pre>\n

      \u914d\u7f6e\u9879\uff1a<\/p>\n

      storm.zookeeper.servers: \u8868\u793azookeeper \u7684\u5730\u5740;<\/p>\n

      nimbus.host: \u8868\u793animbus\u7684\u5730\u5740;<\/p>\n

      storm.zookeeper.root: \u8868\u793aJStorm\u5728zookeeper\u4e2d\u7684\u6839\u76ee\u5f55\uff0c\u5f53\u591a\u4e2aJStorm\u5171\u4eab\u4e00\u4e2azookeeper\u65f6\uff0c\u9700\u8981\u8bbe\u7f6e\u8be5\u9009\u9879<\/strong>\uff0c\u9ed8\u8ba4\u5373\u4e3a\u201c\/jstorm\u201d;<\/p>\n

      storm.local.dir: \u8868\u793aJStorm\u4e34\u65f6\u6570\u636e\u5b58\u653e\u76ee\u5f55\uff0c\u9700\u8981\u4fdd\u8bc1JStorm\u7a0b\u5e8f\u5bf9\u8be5\u76ee\u5f55\u6709\u5199\u6743\u9650;<\/p>\n

      java.library.path: Zeromq \u548cjava zeromq library\u7684\u5b89\u88c5\u76ee\u5f55\uff0c\u9ed8\u8ba4\"\/usr\/local\/lib:\/opt\/local\/lib:\/usr\/lib\";<\/p>\n

      supervisor.slots.ports: \u8868\u793aSupervisor \u63d0\u4f9b\u7684\u7aef\u53e3Slot\u5217\u8868\uff0c\u6ce8\u610f\u4e0d\u8981\u548c\u5176\u4ed6\u7aef\u53e3\u53d1\u751f\u51b2\u7a81\uff0c\u9ed8\u8ba4\u662f68xx\uff0c\u800cStorm\u7684\u662f67xx;<\/p>\n

      topology.enable.classloader: false, \u9ed8\u8ba4\u5173\u95edclassloader\uff0c\u5982\u679c\u5e94\u7528\u7684jar\u4e0eJStorm\u7684\u4f9d\u8d56\u7684jar\u53d1\u751f\u51b2\u7a81\uff0c\u6bd4\u5982\u5e94\u7528\u4f7f\u7528thrift9\uff0c\u4f46jstorm\u4f7f\u7528thrift7\u65f6\uff0c\u5c31\u9700\u8981\u6253\u5f00classloader\u3002\u5efa\u8bae\u5728\u96c6\u7fa4\u7ea7\u522b\u4e0a\u9ed8\u8ba4\u5173\u95ed\uff0c\u5728\u5177\u4f53\u9700\u8981\u9694\u79bb\u7684topology\u4e0a\u6253\u5f00\u8fd9\u4e2a\u9009\u9879\u3002<\/p>\n

      # \u4e0b\u9762\u547d\u4ee4\u53ea\u9700\u8981\u5728\u5b89\u88c5 jstorm_ui \u548c\u63d0\u4ea4jar\u8282\u70b9\u7684\u673a\u5668\u4e0a\u9762\u6267\u884c\u5373\u53ef<\/p>\n

      mkdir ~\/.jstorm\r\ncp -f $JSTORM_HOME\/conf\/storm.yaml ~\/.jstorm<\/pre>\n
      7\u3001\u5b89\u88c5JStorm Web UI<\/strong><\/span><\/div>\n

      \u5f3a\u5236\u4f7f\u7528tomcat7.0\u6216\u4ee5\u4e0a\u7248\u672c\uff0c\u5207\u8bb0\u62f7\u8d1d~\/.jstorm\/storm.yaml\uff0c <\/strong> Web UI \u53ef\u4ee5\u548cNimbus\u5728\u540c\u4e00\u4e2a\u8282\u70b9\u4e0a<\/p>\n

      mkdir ~\/.jstorm\r\ncp -f $JSTORM_HOME\/conf\/storm.yaml ~\/.jstorm\r\n\u4e0b\u8f7dtomcat 7.x \uff08\u4ee5apache-tomcat-7.0.37 \u4e3a\u4f8b\uff09\r\ntar -xzf apache-tomcat-7.0.75.tar.gz\r\ncd apache-tomcat-7.0.75\r\ncd webapps\r\ncp $JSTORM_HOME\/jstorm-ui-2.1.1.war .\/\r\nmv ROOT ROOT.old\r\nln -s jstorm-ui-2.1.1 ROOT   \r\n# \u53e6\u5916\u4e0d\u662f ln -s jstorm-ui-2.1.1.war ROOT \u8fd9\u4e2a\u8981\u5c0f\u5fc3\r\ncd ..\/bin\r\n.\/startup.sh<\/pre>\n
      8\u3001JStorm\u542f\u52a8<\/strong><\/span><\/div>\n

      1.\u5728nimbus \u8282\u70b9\uff0810.1.1.78\uff09\u4e0a\u6267\u884c \u201cnohup jstorm nimbus &\u201d, \u67e5\u770b$JSTORM_HOME\/logs\/nimbus.log\u68c0\u67e5\u6709\u65e0\u9519\u8bef<\/p>\n

      2.\u5728supervisor\u8282\u70b9(10.1.1.78,10.1.1.80,10.1.1.97)\u4e0a\u6267\u884c \u201cnohup jstorm supervisor &\u201d, \u67e5\u770b$JSTORM_HOME\/logs\/supervisor.log\u68c0\u67e5\u6709\u65e0\u9519\u8bef<\/p>\n

      9\u3001JStorm Web UI<\/strong><\/span><\/div>\n

      JStorm\u96c6\u7fa4\u542f\u52a8\u6210\u529f\u622a\u56fe\u5982\u4e0b\uff1a<\/p>\n

      \"\"<\/a><\/p>\n

      # JStorm \u96c6\u7fa4\u5b89\u88c5\u95ee\u9898\u603b\u7ed3<\/strong><\/p>\n

      1\u3001\u6ce8\u610f\/etc\/hosts\u8bbe\u7f6e\uff0c\u6dfb\u52a0\u76f8\u5bf9\u5e94\u7684ip hostname<\/p>\n

      2\u3001\u8bbe\u7f6essh\u514d\u5bc6\u64cd\u4f5c\uff08\u6b64\u6b65\u9aa4\u5728zookeeper\u96c6\u7fa4\u5b8c\u6210\uff09<\/p>\n

      3\u3001\u6ce8\u610f\u5404\u670d\u52a1\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e<\/p>\n

      \u672c\u6587\u539f\u521b\u5730\u5740\uff1a http:\/\/lrxjmw.cn\/centos6-8-deploy-jstorm-cluster.html<\/a>\u4f5c\u8005\uff1a\u738b\u8f89\uff0c\u5ba1\u6838\u5458\uff1a\u5cb3\u6c38<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"

      \u5bfc\u8bfb Alibaba JStorm \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u4f01\u4e1a\u7ea7\u6d41\u5f0f\u8ba1\u7b97\u5f15\u64ce\uff0c\u662fApache Storm \u76844\u500d\u6027\u80fd\uff0c […]<\/p>\n","protected":false},"author":63,"featured_media":65901,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-51371","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/51371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=51371"}],"version-history":[{"count":23,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/51371\/revisions"}],"predecessor-version":[{"id":278740,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/51371\/revisions\/278740"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/65901"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=51371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=51371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=51371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}