{"id":27,"date":"2023-03-24T02:16:25","date_gmt":"2023-12-11T10:34:26","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"},"modified":"2025-07-31T10:54:21","modified_gmt":"2025-07-31T01:54:21","slug":"ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","title":{"rendered":"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5"},"content":{"rendered":"<p>\u8457\u8005\u306f\u3001\u5bc4\u4ed8\u30d7\u30ed\u30b0\u30e9\u30e0\u300c\u66f8\u3044\u3066\u5bc4\u4ed8\u3059\u308b\u300d\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u30d5\u30ea\u30fc\u304b\u3064\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u57fa\u91d1\u306b\u5bc4\u4ed8\u3092\u3059\u308b\u305f\u3081\u306b\u9078\u629e\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3>\u306f\u3058\u3081\u306b<\/h3>\n<p>Apache Kafka\u306f\u3001\u5927\u91cf\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u305f\u4eba\u6c17\u306e\u3042\u308b\u5206\u6563\u30e1\u30c3\u30bb\u30fc\u30b8\u30d6\u30ed\u30fc\u30ab\u30fc\u3067\u3059\u3002Kafka\u30af\u30e9\u30b9\u30bf\u30fc\u306f\u975e\u5e38\u306b\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u3067\u8010\u969c\u5bb3\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305f\u3001ActiveMQ\u3084RabbitMQ\u306a\u3069\u306e\u4ed6\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u30d6\u30ed\u30fc\u30ab\u30fc\u3068\u6bd4\u8f03\u3057\u3066\u3001\u306f\u308b\u304b\u306b\u9ad8\u3044\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u4e00\u822c\u7684\u306b\u306f\u30d1\u30d6\u30ea\u30c3\u30b7\u30e5\/\u30b5\u30d6\u30b9\u30af\u30e9\u30a4\u30d6\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3068\u3057\u3066\u4f7f\u7528\u3055\u308c\u307e\u3059\u304c\u3001\u591a\u304f\u306e\u7d44\u7e54\u304c\u30ed\u30b0\u96c6\u7d04\u306e\u305f\u3081\u306b\u3082\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u306a\u305c\u306a\u3089\u3001Kafka\u306f\u30d1\u30d6\u30ea\u30c3\u30b7\u30e5\u3055\u308c\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u6c38\u7d9a\u7684\u306a\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u30d1\u30d6\u30ea\u30c3\u30b7\u30e5\/\u30b5\u30d6\u30b9\u30af\u30e9\u30a4\u30d6\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u306f\u30011\u3064\u4ee5\u4e0a\u306e\u30d7\u30ed\u30c7\u30e5\u30fc\u30b5\u304c\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u516c\u958b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u30b3\u30f3\u30b7\u30e5\u30fc\u30de\u306e\u6570\u3084\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u51e6\u7406\u65b9\u6cd5\u3092\u8003\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u8cfc\u8aad\u3055\u308c\u305f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306f\u3001\u81ea\u52d5\u7684\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3084\u65b0\u3057\u3044\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u4f5c\u6210\u306b\u3064\u3044\u3066\u901a\u77e5\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u30b7\u30b9\u30c6\u30e0\u306f\u3001\u5b9a\u671f\u7684\u306b\u65b0\u3057\u3044\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u5229\u7528\u53ef\u80fd\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u5b9a\u671f\u7684\u306b\u30dd\u30fc\u30ea\u30f3\u30b0\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u3088\u308a\u3082\u52b9\u7387\u7684\u304b\u3064\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Ubuntu 20.04\u306bApache Kafka 2.8.2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304a\u3088\u3073\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<p>\u7d9a\u3051\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u304c\u5fc5\u8981\u3067\u3059:<\/p>\n<ul class=\"post-ul\">\n<li>An Ubuntu 20.04 server with at least 4 GB of RAM and a non-root user with sudo privileges. You can set this up by following our Initial Server Setup guide if you do not have a non-root user set up. Installations with less than 4GB of RAM may cause the Kafka service to fail.<\/li>\n<li>OpenJDK 11 installed on your server. To install this version, follow our tutorial on How To Install Java with APT on Ubuntu 20.04. Kafka is written in Java, so it requires a JVM.<\/li>\n<\/ul>\n<h2>\u30b9\u30c6\u30c3\u30d71 &#8211; Kafka\u306e\u305f\u3081\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210<\/h2>\n<p>Kafka\u306f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u4ecb\u3057\u3066\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3067\u304d\u308b\u305f\u3081\u3001\u307e\u305a\u6700\u521d\u306b\u5c02\u7528\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u30b5\u30fc\u30d3\u30b9\u7528\u306b\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001Kafka\u30b5\u30fc\u30d0\u30fc\u304c\u4fb5\u5bb3\u3055\u308c\u305f\u5834\u5408\u306bUbuntu\u30de\u30b7\u30f3\u3078\u306e\u88ab\u5bb3\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u5c02\u7528\u306ekafka\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u3042\u306a\u305f\u306e\u975e\u7ba1\u7406\u8005sudo\u30e6\u30fc\u30b6\u30fc\u3068\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u6b21\u306bkafka\u3068\u3044\u3046\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> adduser kafka<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u3001kafka\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u6307\u793a\u306b\u5f93\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306b\u3001adduser\u30b3\u30de\u30f3\u30c9\u3067sudo\u30b0\u30eb\u30fc\u30d7\u306bkafka\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002Kafka\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u3053\u308c\u3089\u306e\u7279\u6a29\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> adduser kafka <span class=\"token function\">sudo<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3042\u306a\u305f\u306e\u30ab\u30d5\u30ab\u30e6\u30fc\u30b6\u30fc\u306f\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002su\u3092\u4f7f\u7528\u3057\u3066\u3001\u30ab\u30d5\u30ab\u30a2\u30ab\u30a6\u30f3\u30c8\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">su<\/span> <span class=\"token parameter variable\">-l<\/span> kafka<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Kafka\u5c02\u7528\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u305f\u306e\u3067\u3001Kafka\u306e\u30d0\u30a4\u30ca\u30ea\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u5c55\u958b\u3059\u308b\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d72 \u2014 Kafka\u30d0\u30a4\u30ca\u30ea\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3068\u5c55\u958b<\/h2>\n<p>\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Kafka\u306e\u30d0\u30a4\u30ca\u30ea\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3001kafka\u30e6\u30fc\u30b6\u30fc\u306e\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5c02\u7528\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u5c55\u958b\u3057\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u3001\/home\/kafka\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u300cDownloads\u300d\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3066\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u7ba1\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">mkdir<\/span> ~\/Downloads<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30ab\u30d5\u30ab\u306e\u30d0\u30a4\u30ca\u30ea\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u3001curl\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">curl<\/span> <span class=\"token string\">&#8220;https:\/\/downloads.apache.org\/kafka\/<mark>2.8.2<\/mark>\/kafka_<mark>2.13-2.8.2<\/mark>.tgz&#8221;<\/span> <span class=\"token parameter variable\">-o<\/span> ~\/Downloads\/kafka.tgz<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300ckafka\u300d\u3068\u3044\u3046\u540d\u524d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306fKafka\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u30d9\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">mkdir<\/span> ~\/kafka <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token builtin class-name\">cd<\/span> ~\/kafka<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30a2\u30fc\u30ab\u30a4\u30d6\u3092tar\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u5c55\u958b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">tar<\/span> <span class=\"token parameter variable\">-xvzf<\/span> ~\/Downloads\/kafka.tgz <span class=\"token parameter variable\">&#8211;strip<\/span> <span class=\"token number\">1<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30a2\u30fc\u30ab\u30a4\u30d6\u306e\u5185\u5bb9\u3092~\/kafka\/\u306b\u62bd\u51fa\u3059\u308b\u3088\u3046\u306b\u3001&#8211;strip 1\u30d5\u30e9\u30b0\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ed6\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08\u305f\u3068\u3048\u3070~\/kafka\/kafka_2.13-2.8.2\/\u5185\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff09\u306b\u306f\u62bd\u51fa\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d0\u30a4\u30ca\u30ea\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u6b63\u5e38\u306b\u62bd\u51fa\u3057\u305f\u306e\u3067\u3001Kafka\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u3092\u958b\u59cb\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d73 \u2014 Kafka\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a<\/h2>\n<p>Kafka\u306e\u30c8\u30d4\u30c3\u30af\u306f\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u516c\u958b\u3067\u304d\u308b\u30ab\u30c6\u30b4\u30ea\u30fc\u3084\u30b0\u30eb\u30fc\u30d7\u3001\u30d5\u30a3\u30fc\u30c9\u306e\u540d\u524d\u3067\u3059\u3002\u305f\u3060\u3057\u3001Kafka\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u52d5\u4f5c\u3067\u306f\u30c8\u30d4\u30c3\u30af\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u306e\u52d5\u4f5c\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001\u305d\u306e\u7de8\u96c6\u4f5c\u696d\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u30ab\u30d5\u30ab\u306e\u8a2d\u5b9a\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001server.properties\u306b\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002nano\u307e\u305f\u306f\u304a\u6c17\u306b\u5165\u308a\u306e\u30a8\u30c7\u30a3\u30bf\u3067\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> ~\/kafka\/config\/server.properties<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6700\u521d\u306b\u3001Kafka\u306e\u30c8\u30d4\u30c3\u30af\u3092\u524a\u9664\u3059\u308b\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u6b21\u306e\u884c\u3092\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u5f8c\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u4ee5\u4e0b\u306e\u6587\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\uff08\u65e5\u672c\u8a9e\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u8868\u73fe\u306e\u307f\u3067\u3001\uff11\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u7d50\u69cb\u3067\u3059\uff09\uff1a<br \/>\n~\/kafka\/config\/server.properties\u2192 Kafka \u306e\u30b5\u30fc\u30d0\u30fc\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u8a2d\u5b9a\u306f\u3001~\/kafka\/config\/server.properties \u30d5\u30a1\u30a4\u30eb\u3067\u884c\u308f\u308c\u307e\u3059\u3002<\/p>\n<\/div>\n<pre class=\"post-pre\"><code>delete.topic.enable = true\r\n<\/code><\/pre>\n<p>\u6b21\u306b\u3001log.dirs\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u5909\u66f4\u3057\u3066Kafka\u306e\u30ed\u30b0\u304c\u4fdd\u5b58\u3055\u308c\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u5909\u66f4\u3057\u307e\u3059\u3002log.dirs\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u63a2\u3057\u3001\u65e2\u5b58\u306e\u30eb\u30fc\u30c8\u3092\u5f37\u8abf\u3055\u308c\u305f\u30eb\u30fc\u30c8\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>~\/kafka\/config\/server.properties\u3092\u65e5\u672c\u8a9e\u3067\u8868\u73fe\u3059\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a<br \/>\n\u300c~\/kafka\/config\/server.properties\u30d5\u30a1\u30a4\u30eb\u300d<\/div>\n<pre class=\"post-pre\"><code>log.dirs=<mark>\/home\/kafka\/logs<\/mark>\r\n<\/code><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u308b\u3002<\/p>\n<p>Kafka\u3092\u8a2d\u5b9a\u3057\u305f\u3089\u3001Kafka\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3001\u8d77\u52d5\u6642\u306b\u81ea\u52d5\u7684\u306b\u6709\u52b9\u5316\u3059\u308b\u305f\u3081\u306esystemd\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d74 \u2014 systemd\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u3068Kafka\u30b5\u30fc\u30d0\u30fc\u306e\u8d77\u52d5<\/h2>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001Kafka\u30b5\u30fc\u30d3\u30b9\u306e\u305f\u3081\u306esystemd\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u3088\u3063\u3066\u3001Kafka\u306e\u958b\u59cb\u3001\u505c\u6b62\u3001\u518d\u8d77\u52d5\u306a\u3069\u306e\u4e00\u822c\u7684\u306a\u30b5\u30fc\u30d3\u30b9\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u3001\u4ed6\u306eLinux\u30b5\u30fc\u30d3\u30b9\u3068\u4e00\u8cab\u6027\u306e\u3042\u308b\u65b9\u6cd5\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Kafka\u306f\u3001\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u72b6\u614b\u3068\u8a2d\u5b9a\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306bZookeeper\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002Zookeeper\u306f\u591a\u304f\u306e\u5206\u6563\u30b7\u30b9\u30c6\u30e0\u3067\u4f7f\u7528\u3055\u308c\u3066\u304a\u308a\u3001\u516c\u5f0f\u306eZookeeper\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u30c4\u30fc\u30eb\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u8aad\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3067Zookeeper\u3092\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>Zookeeper\u306e\u305f\u3081\u306b\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/systemd\/system\/zookeeper.service<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u30e6\u30cb\u30c3\u30c8\u306e\u5b9a\u7fa9\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>\/etc\/systemd\/system\/zookeeper.service\u3092\u65e5\u672c\u8a9e\u3067\u81ea\u7136\u306a\u8a00\u3044\u65b9\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\/zookeeper \u30b5\u30fc\u30d3\u30b9\u306e systemd \u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb<\/p>\n<\/div>\n<pre class=\"post-pre\"><code>[Unit]\r\nRequires=network.target remote-fs.target\r\nAfter=network.target remote-fs.target\r\n\r\n[Service]\r\nType=simple\r\nUser=kafka\r\nExecStart=\/home\/kafka\/kafka\/bin\/zookeeper-server-start.sh \/home\/kafka\/kafka\/config\/zookeeper.properties\r\nExecStop=\/home\/kafka\/kafka\/bin\/zookeeper-server-stop.sh\r\nRestart=on-abnormal\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/code><\/pre>\n<p>Zookeeper\u306e[Unit]\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30ad\u30f3\u30b0\u3068\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304c\u6e96\u5099\u5b8c\u4e86\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>[\u30b5\u30fc\u30d3\u30b9] \u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001systemd\u304czookeeper-server-start.sh\u3068zookeeper-server-stop.sh\u306e\u30b7\u30a7\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5\u304a\u3088\u3073\u505c\u6b62\u3059\u308b\u3053\u3068\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u7570\u5e38\u7d42\u4e86\u3057\u305f\u5834\u5408\u306b\u306fZookeeper\u304c\u518d\u8d77\u52d5\u3055\u308c\u308b\u3088\u3046\u306b\u3082\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u8ffd\u52a0\u3057\u305f\u5f8c\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306b\u3001kafka\u306esystemd\u30b5\u30fc\u30d3\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/systemd\/system\/kafka.service<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306e\u5358\u4f4d\u306e\u5b9a\u7fa9\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 (Tsugi no tan&#8217;i no teigi o fairu ni ny\u016bryoku shite kudasai.)<\/p>\n<div>\/etc\/systemd\/system\/kafka.service\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u3089\u308c\u307e\u3059\u3002\u300c\u30ab\u30d5\u30ab\u306e\u30b5\u30fc\u30d3\u30b9\u306f\/etc\/systemd\/system\/kafka.service\u30d5\u30a1\u30a4\u30eb\u306b\u3042\u308a\u307e\u3059\u3002\u300d<\/div>\n<pre class=\"post-pre\"><code>[Unit]\r\nRequires=zookeeper.service\r\nAfter=zookeeper.service\r\n\r\n[Service]\r\nType=simple\r\nUser=kafka\r\nExecStart=\/bin\/sh -c '\/home\/kafka\/kafka\/bin\/kafka-server-start.sh \/home\/kafka\/kafka\/config\/server.properties &gt; \/home\/kafka\/kafka\/kafka.log 2&gt;&amp;1'\r\nExecStop=\/home\/kafka\/kafka\/bin\/kafka-server-stop.sh\r\nRestart=on-abnormal\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/code><\/pre>\n<p>[\u30aa\u30d7\u30b7\u30e7\u30f3\uff11]<br \/>\n[Unit] \u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u306e\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u304c zookeeper.service \u306b\u4f9d\u5b58\u3057\u3066\u304a\u308a\u3001kafka \u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5\u6642\u306b\u81ea\u52d5\u7684\u306b zookeeper \u3082\u8d77\u52d5\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u300cService\u300d\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001systemd\u304ckafka-server-start.sh\u3068kafka-server-stop.sh\u30b7\u30a7\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5\u304a\u3088\u3073\u505c\u6b62\u3059\u308b\u3088\u3046\u306b\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001Kafka\u304c\u7570\u5e38\u7d42\u4e86\u3057\u305f\u5834\u5408\u306b\u306f\u518d\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3082\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u308b\u3002<\/p>\n<p>\u30e6\u30cb\u30c3\u30c8\u304c\u5b9a\u7fa9\u3055\u308c\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067Kafka\u3092\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> systemctl start kafka<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30ab\u30d5\u30ab\u30e6\u30cb\u30c3\u30c8\u306e\u30b8\u30e3\u30fc\u30ca\u30eb\u30ed\u30b0\u3092\u78ba\u8a8d\u3057\u3066\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u6b63\u5e38\u306b\u8d77\u52d5\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> systemctl status kafka<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u3042\u306a\u305f\u306b\u5c4a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u25cf kafka.service Loaded: loaded (\/etc\/systemd\/system\/kafka.service; disabled; vendor preset&gt; Active: <mark>active<\/mark> (running) since Wed 2023-02-01 23:44:12 UTC; 4s ago Main PID: 17770 (sh) Tasks: 69 (limit: 4677) Memory: 321.9M CGroup: \/system.slice\/kafka.service \u251c\u250017770 \/bin\/sh -c \/home\/kafka\/kafka\/bin\/kafka-server-start.sh \/ho&gt; \u2514\u250017793 java -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMill&gt;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u73fe\u5728\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u30dd\u30fc\u30c8\u3068\u3057\u3066Kafka\u30b5\u30fc\u30d0\u30fc\u304c\u30dd\u30fc\u30c89092\u3067\u30ea\u30b9\u30cb\u30f3\u30b0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30ab\u30d5\u30ab\u30b5\u30fc\u30d3\u30b9\u3092\u958b\u59cb\u3057\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u30b5\u30fc\u30d0\u30fc\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u3001\u30ab\u30d5\u30ab\u306f\u81ea\u52d5\u7684\u306b\u518d\u8d77\u52d5\u3055\u308c\u307e\u305b\u3093\u3002\u30b5\u30fc\u30d0\u30fc\u30d6\u30fc\u30c8\u6642\u306b\u30ab\u30d5\u30ab\u30b5\u30fc\u30d3\u30b9\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> zookeeper<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300c\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u304c\u4f5c\u6210\u3055\u308c\u305f\u300d\u3068\u3044\u3046\u5fdc\u7b54\u304c\u5c4a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Created symlink \/etc\/systemd\/system\/multi-user.target.wants\/zookeeper.service \u2192 \/etc\/systemd\/system\/zookeeper.service.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u308c\u304b\u3089\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> kafka<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u304c\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068\u3092\u304a\u77e5\u3089\u305b\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Created symlink \/etc\/systemd\/system\/multi-user.target.wants\/kafka.service \u2192 \/etc\/systemd\/system\/kafka.service.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Kafka\u3068Zookeeper\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5\u3057\u307e\u3057\u305f\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Kafka\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d75 &#8211; Kafka\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u30c6\u30b9\u30c8\u3059\u308b\u3002<\/h2>\n<p>\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Kafka\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u30c6\u30b9\u30c8\u3057\u307e\u3059\u3002Kafka\u30b5\u30fc\u30d0\u30fc\u304c\u671f\u5f85\u901a\u308a\u306b\u52d5\u4f5c\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001Hello World\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u767a\u884c\u3057\u3066\u53d7\u4fe1\u3057\u307e\u3059\u3002<\/p>\n<p>Kafka\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u516c\u958b\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u3053\u3068\u304c\u5fc5\u8981\u3067\u3059\uff1a<\/p>\n<ul class=\"post-ul\">\n<li>A producer, who enables the publication of records and data to topics.<\/li>\n<li>A consumer, who reads messages and data from topics.<\/li>\n<\/ul>\n<p>\u59cb\u3081\u308b\u524d\u306b\u3001\u300cTutorialTopic\u300d\u3068\u3044\u3046\u30c8\u30d4\u30c3\u30af\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">~\/kafka\/bin\/kafka-topics.sh <span class=\"token parameter variable\">&#8211;create<\/span> <span class=\"token parameter variable\">&#8211;zookeeper<\/span> localhost:2181 &#8211;replication-factor <span class=\"token number\">1<\/span> <span class=\"token parameter variable\">&#8211;partitions<\/span> <span class=\"token number\">1<\/span> <span class=\"token parameter variable\">&#8211;topic<\/span> <mark>TutorialTopic<\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>kafka-console-producer.sh \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u30d7\u30ed\u30c7\u30e5\u30fc\u30b5\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5f15\u6570\u3068\u3057\u3066\u3001Kafka\u30b5\u30fc\u30d0\u30fc\u306e\u30db\u30b9\u30c8\u540d\u3001\u30dd\u30fc\u30c8\u3001\u30c8\u30d4\u30c3\u30af\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u30c8\u30d4\u30c3\u30af\u304c\u4f5c\u6210\u3055\u308c\u305f\u3068\u3044\u3046\u8fd4\u4fe1\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Created topic TutorialTopic.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300c\u3053\u3093\u306b\u3061\u306f\u3001\u4e16\u754c\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u3092TutorialTopic\u30c8\u30d4\u30c3\u30af\u306b\u516c\u958b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#8220;Hello, World&#8221;<\/span> <span class=\"token operator\">|<\/span> ~\/kafka\/bin\/kafka-console-producer.sh &#8211;broker-list localhost:9092 <span class=\"token parameter variable\">&#8211;topic<\/span> TutorialTopic <span class=\"token operator\">&gt;<\/span> \/dev\/null<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306b\u3001kafka-console-consumer.sh\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3066Kafka\u30b3\u30f3\u30b7\u30e5\u30fc\u30de\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u5f15\u6570\u3068\u3057\u3066\u3001ZooKeeper\u30b5\u30fc\u30d0\u306e\u30db\u30b9\u30c8\u540d\u304a\u3088\u3073\u30dd\u30fc\u30c8\u3001\u3055\u3089\u306b\u30c8\u30d4\u30c3\u30af\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u306fTutorialTopic\u304b\u3089\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6d88\u8cbb\u3057\u307e\u3059\u3002\u30b3\u30f3\u30b7\u30e5\u30fc\u30de\u304c\u958b\u59cb\u3055\u308c\u308b\u524d\u306b\u516c\u958b\u3055\u308c\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6d88\u8cbb\u3059\u308b\u305f\u3081\u3001&#8211;from-beginning\u30d5\u30e9\u30b0\u306e\u4f7f\u7528\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">~\/kafka\/bin\/kafka-console-consumer.sh &#8211;bootstrap-server localhost:9092 <span class=\"token parameter variable\">&#8211;topic<\/span> TutorialTopic &#8211;from-beginning<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u8a2d\u5b9a\u306e\u554f\u984c\u304c\u306a\u3051\u308c\u3070\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u300c\u3053\u3093\u306b\u3061\u306f\u3001\u4e16\u754c\u300d\u3068\u3044\u3046\u5fdc\u7b54\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Hello, World<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u7d9a\u884c\u3055\u308c\u3001\u516c\u958b\u3059\u308b\u3055\u3089\u306a\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5f85\u3061\u7d9a\u3051\u307e\u3059\u3002\u3053\u308c\u3092\u30c6\u30b9\u30c8\u3059\u308b\u305f\u3081\u306b\u3001\u65b0\u3057\u3044\u30bf\u30fc\u30df\u30ca\u30eb\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u958b\u304d\u3001\u30b5\u30fc\u30d0\u30fc\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002kafka\u30e6\u30fc\u30b6\u30fc\u3068\u3057\u3066\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3053\u3068\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">su<\/span> <span class=\"token parameter variable\">-l<\/span> kafka<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u65b0\u3057\u3044\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u3001\u30d7\u30ed\u30c7\u30e5\u30fc\u30b5\u30fc\u3092\u958b\u59cb\u3057\u3066\u30012\u3064\u76ee\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u767a\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#8220;Hello World from Sammy at Silicon Cloud!&#8221;<\/span> <span class=\"token operator\">|<\/span> ~\/kafka\/bin\/kafka-console-producer.sh &#8211;broker-list localhost:9092 <span class=\"token parameter variable\">&#8211;topic<\/span> TutorialTopic <span class=\"token operator\">&gt;<\/span> \/dev\/null<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u3001\u6d88\u8cbb\u8005\u306e\u51fa\u529b\u7d50\u679c\u304c\u3042\u306a\u305f\u306e\u5143\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Hello, World <mark>Hello World from Sammy at Silicon Cloud!<\/mark><\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c6\u30b9\u30c8\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u6d88\u8cbb\u8005\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u505c\u6b62\u3059\u308b\u305f\u3081\u306bCTRL+C\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4eca\u3001Ubuntu 20.04\u306bKafka\u30b5\u30fc\u30d0\u30fc\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001Kafka\u30b5\u30fc\u30d0\u30fc\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u5f37\u5316\u3059\u308b\u305f\u3081\u306b\u3001\u3044\u304f\u3064\u304b\u306e\u8fc5\u901f\u306a\u4f5c\u696d\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d76- Kafka \u30b5\u30fc\u30d0\u30fc\u306e\u5f37\u5316<\/h2>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001kafka\u30e6\u30fc\u30b6\u30fc\u306e\u7ba1\u7406\u8005\u7279\u6a29\u3092\u524a\u9664\u3057\u3001Kafka\u30b5\u30fc\u30d0\u30fc\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u5f37\u5316\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3092\u884c\u3046\u524d\u306b\u3001root\u4ee5\u5916\u306esudo\u30e6\u30fc\u30b6\u30fc\u3068\u3057\u3066\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3066\u3001\u30ed\u30b0\u30a4\u30f3\u3057\u76f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3082\u3057\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u958b\u59cb\u3057\u305f\u6642\u3068\u540c\u3058\u30b7\u30a7\u30eb\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u307e\u307e\u3067\u3044\u308b\u5834\u5408\u306f\u3001exit\u3068\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>sudo\u30b0\u30eb\u30fc\u30d7\u304b\u3089kafka\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> deluser kafka <span class=\"token function\">sudo<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Kafka \u30b5\u30fc\u30d0\u30fc\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u3055\u3089\u306b\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306b\u3001passwd \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066 kafka \u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u30ed\u30c3\u30af\u3057\u307e\u3059\u3002\u3053\u306e\u64cd\u4f5c\u306b\u3088\u308a\u3001\u8ab0\u3082\u304c\u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u76f4\u63a5\u30b5\u30fc\u30d0\u30fc\u306b\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">passwd<\/span> kafka <span class=\"token parameter variable\">-l<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>-l\u30d5\u30e9\u30b0\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\uff08passwd\uff09\u3092\u5909\u66f4\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3092\u30ed\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u6642\u70b9\u3067\u306f\u3001kafka\u3068\u3057\u3066\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u30eb\u30fc\u30c8\u307e\u305f\u306fsudo\u30e6\u30fc\u30b6\u30fc\u306e\u307f\u304c\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">su<\/span> &#8211; kafka<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5c06\u6765\u7684\u306b\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5909\u66f4\u3059\u308b\u6a5f\u80fd\u3092\u89e3\u9664\u3059\u308b\u5834\u5408\u306f\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3092-u\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u3068\u3082\u306b\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">passwd<\/span> kafka <span class=\"token parameter variable\">-u<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u73fe\u5728\u3001Kafka\u30e6\u30fc\u30b6\u30fc\u306e\u7ba1\u7406\u8005\u6a29\u9650\u3092\u6b63\u5e38\u306b\u5236\u9650\u3057\u307e\u3057\u305f\u3002Kafka\u306e\u4f7f\u7528\u3092\u958b\u59cb\u3059\u308b\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067KafkaT\u3092\u30b7\u30b9\u30c6\u30e0\u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d77 &#8211; KafkaT\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\uff09<\/h2>\n<p>KafkaT\u306f\u3001Kafka\u30af\u30e9\u30b9\u30bf\u306e\u8a73\u7d30\u3092\u8868\u793a\u3057\u305f\u308a\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u7279\u5b9a\u306e\u7ba1\u7406\u30bf\u30b9\u30af\u3092\u5b9f\u884c\u3059\u308b\u80fd\u529b\u3092\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306b\u958b\u767a\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306fRuby\u306egem\u3067\u3059\u306e\u3067\u3001\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u306fRuby\u304c\u5fc5\u8981\u3067\u3059\u3002\u307e\u305f\u3001KafkaT\u306b\u4f9d\u5b58\u3059\u308b\u4ed6\u306egem\u3092\u30d3\u30eb\u30c9\u3059\u308b\u305f\u3081\u306b\u306f\u3001build-essential\u30d1\u30c3\u30b1\u30fc\u30b8\u3082\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>apt\u3092\u4f7f\u7528\u3057\u3066Ruby\u3068build-essential\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> ruby ruby-dev build-essential<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300cgem\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001KafkaT\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u300d<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token assign-left variable\">CFLAGS<\/span><span class=\"token operator\">=<\/span>-Wno-error<span class=\"token operator\">=<\/span>format-overflow gem <span class=\"token function\">install<\/span> kafkat<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>kafkat\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d7\u30ed\u30bb\u30b9\u4e2d\u306bZookeeper\u306e\u8b66\u544a\u3084\u30a8\u30e9\u30fc\u3092\u6291\u5236\u3059\u308b\u306b\u306f\u3001Wno-error=format-overflow\u30b3\u30f3\u30d1\u30a4\u30eb\u30d5\u30e9\u30b0\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u5b8c\u4e86\u306e\u901a\u77e5\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&#8230; Done installing documentation for json, colored, retryable, highline, trollop, zookeeper, zk, kafkat after 3 seconds 8 gems installed<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>KafkaT\u306f\u3001.kafkatcfg\u3092\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4f7f\u7528\u3057\u3066\u3001Kafka\u30b5\u30fc\u30d0\u30fc\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u304a\u3088\u3073\u30ed\u30b0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u7279\u5b9a\u3057\u307e\u3059\u3002\u307e\u305f\u3001KafkaT\u304cZooKeeper\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3078\u306e\u63a5\u7d9a\u3092\u884c\u3046\u305f\u3081\u306e\u30a8\u30f3\u30c8\u30ea\u3082\u542b\u307e\u308c\u308b\u3079\u304d\u3067\u3059\u3002<\/p>\n<p>.kafkatcfg \u3068\u3044\u3046\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> ~\/.kafkatcfg<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Kafka\u30b5\u30fc\u30d0\u30fc\u3068Zookeeper\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3092\u6307\u5b9a\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\u4ee5\u4e0b\u306e\u6587\u3092\u65e5\u672c\u8a9e\u3067\u8868\u73fe\u3057\u3066\u304f\u3060\u3055\u3044\uff08\u4e00\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\uff09:<br \/>\n~\/.kafkatcfg<\/div>\n<pre class=\"post-pre\"><code>{\r\n  \"kafka_path\": \"~\/kafka\",\r\n  \"log_path\": \"\/home\/kafka\/logs\",\r\n  \"zk_path\": \"localhost:2181\"\r\n}\r\n<\/code><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002KafkaT\u3092\u4f7f\u7528\u3059\u308b\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u5168\u3066\u306eKafka\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8a73\u7d30\u3092\u8868\u793a\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kafkat partitions<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>[DEPRECATION] The trollop gem has been renamed to optimist and will no longer be supported. Please switch to optimist as soon as possible. \/var\/lib\/gems\/2.7.0\/gems\/json-1.8.6\/lib\/json\/common.rb:155: warning: Using the last argument as keyword parameters is deprecated &#8230; Topic Partition Leader Replicas ISRs TutorialTopic 0 0 [0] [0] __consumer_offsets 0 0 [0] [0] &#8230; &#8230;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u51fa\u529b\u306b\u306f\u3001TutorialTopic \u3068 __consumer_offsets \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002__consumer_offsets \u306f\u3001Kafka \u304c\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u95a2\u9023\u306e\u60c5\u5831\u3092\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u5185\u90e8\u30c8\u30d4\u30c3\u30af\u3067\u3059\u3002__consumer_offsets \u304b\u3089\u59cb\u307e\u308b\u884c\u306f\u5b89\u5168\u306b\u7121\u8996\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>KafkaT\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u5b66\u3073\u305f\u3044\u5834\u5408\u306f\u3001\u305d\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u73fe\u5728\u3001Ubuntu\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u5b89\u5168\u306bApache Kafka\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u307e\u3059\u3002Kafka\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u4f7f\u3063\u3066\u3001\u304a\u597d\u304d\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306bKafka\u3092\u7d71\u5408\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30ab\u30d5\u30ab\u306b\u3064\u3044\u3066\u3082\u3063\u3068\u5b66\u3076\u305f\u3081\u306b\u306f\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3082\u53c2\u7167\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8457\u8005\u306f\u3001\u5bc4\u4ed8\u30d7\u30ed\u30b0\u30e9\u30e0\u300c\u66f8\u3044\u3066\u5bc4\u4ed8\u3059\u308b\u300d\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u30d5\u30ea\u30fc\u304b\u3064\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u57fa\u91d1\u306b\u5bc4\u4ed8\u3092\u3059\u308b\u305f\u3081\u306b\u9078\u629e\u3057\u307e\u3057\u305f\u3002 \u306f\u3058\u3081\u306b Apache Kafka\u306f\u3001\u5927\u91cf\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u305f\u4eba\u6c17\u306e\u3042\u308b\u5206\u6563 [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,17],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-linux","tag-17"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04\u3067apache-kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04\u3067apache-kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-11T10:34:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T01:54:21+00:00\" \/>\n<meta name=\"author\" content=\"\u84ee, \u7ffc\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u84ee, \u7ffc\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"26\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"name\":\"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-12-11T10:34:26+00:00\",\"dateModified\":\"2025-07-31T01:54:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413\"},\"description\":\"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413\",\"name\":\"\u84ee, \u7ffc\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g\",\"caption\":\"\u84ee, \u7ffc\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/rentsubasa\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5 - Blog - Silicon Cloud","description":"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04\u3067apache-kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\/","og_locale":"ja_JP","og_type":"article","og_title":"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5","og_description":"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04\u3067apache-kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-11T10:34:26+00:00","article_modified_time":"2025-07-31T01:54:21+00:00","author":"\u84ee, \u7ffc","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u84ee, \u7ffc","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"26\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","name":"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-12-11T10:34:26+00:00","dateModified":"2025-07-31T01:54:21+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413"},"description":"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Ubuntu 20.04\u3067Apache Kafka\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413","name":"\u84ee, \u7ffc","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g","caption":"\u84ee, \u7ffc"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/rentsubasa\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/ubuntu-20-04%e3%81%a7apache-kafka%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":325655,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions\/325655"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}