如何在windows机器上安装和配置kafkacat?

baubqpgj  于 2021-06-07  发布在  Kafka
关注(0)|答案(1)|浏览(734)

我正在尝试在windows机器上安装kafkacat工具。在运行./bootstrap.sh快速生成时,出现以下错误:

  1. $ ./bootstrap.sh
  2. Directory librdkafka already exists, not downloading https://github.com/edenhill/librdkafka/archive/master.tar.gz
  3. Directory libyajl already exists, not downloading https://github.com/lloyd/yajl/archive/master.tar.gz
  4. Building librdkafka
  5. checking for OS or distribution... ok (MINGW64_NT-6.1)
  6. checking for C compiler from CC env... failed
  7. checking for gcc (by command)... failed
  8. checking for clang (by command)... failed
  9. checking for cc (by command)... failed (fail)
  10. checking for C++ compiler from CXX env... failed
  11. checking for C++ compiler (g++)... failed
  12. checking for C++ compiler (clang++)... failed
  13. checking for C++ compiler (c++)... failed (fail)
  14. checking executable ld... failed (disable)
  15. checking executable nm... failed (disable)
  16. checking executable objdump... failed (disable)
  17. checking executable strip... failed (disable)
  18. checking for pkgconfig (by command)... failed
  19. checking for install (by command)... ok
  20. checking for PIC (by compile)... failed (disable)
  21. checking for GNU-compatible linker options... failed
  22. checking for OSX linker options... failed
  23. checking for GNU linker-script ld flag... failed
  24. checking for Solaris linker-script ld flag... failed (ignore)
  25. checking for __atomic_32 (by compile)... failed
  26. checking for __atomic_32_lib (by compile)... failed
  27. checking for __sync_32 (by compile)... failed (disable)
  28. checking for __atomic_64 (by compile)... failed
  29. checking for __atomic_64_lib (by compile)... failed
  30. checking for __sync_64 (by compile)... failed (disable)
  31. checking for socket (by compile)... failed
  32. checking for socket_nsl (by compile)... failed (fail)
  33. parsing version '0x00090401'... ok (0.9.4)
  34. checking for libpthread (by compile)... failed (fail)
  35. checking for zlib (by compile)... failed (disable)
  36. checking for libcrypto (by compile)... failed (disable)
  37. checking for liblz4 (by compile)... failed (disable)
  38. checking for libssl (by compile)... failed (disable)
  39. checking for libsasl2 (by compile)... failed (disable)
  40. checking for libsasl (by compile)... failed (disable)
  41. checking for regex (by compile)... failed (disable)
  42. checking for librt (by compile)... failed
  43. checking for strndup (by compile)... failed (disable)
  44. checking for nm (by env NM)... failed
  45. ###########################################################
  46. ### Configure failed ###
  47. ###########################################################
  48. ### Accumulated failures: ###
  49. ###########################################################
  50. cc (WITH_CC)
  51. module: cc
  52. action: fail
  53. reason:
  54. command 'cc --version' failed:
  55. mklove/modules/configure.base: line 1110: cc: command not found
  56. cxx (WITH_CXX) C++ compiler (c++)
  57. module: cc
  58. action: fail
  59. reason:
  60. command 'c++ --version' failed:
  61. mklove/modules/configure.base: line 1110: c++: command not found
  62. socket_nsl ()
  63. module: socket
  64. action: fail
  65. reason:
  66. compile check failed:
  67. CC: CC
  68. flags:
  69. -g -O2 -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wall -Werror _mkltmpc57mad.c -o _mkltmpc57mad.c.o -lsocket -lnsl :
  70. mklove/modules/configure.base: line 917: -g: command not found
  71. source:
  72. # include <sys/types.h>
  73. # include <sys/socket.h>
  74. # include <unistd.h>
  75. void foo (void) {
  76. int s = socket(0, 0, 0);
  77. close(s);
  78. }
  79. libpthread ()
  80. module: librdkafka
  81. action: fail
  82. reason:
  83. compile check failed:
  84. CC: CC
  85. flags: -lpthread
  86. -g -O2 -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wall -Werror -lpthread _mkltmp0Vm7ew.c -o _mkltmp0Vm7ew.c.o :
  87. mklove/modules/configure.base: line 917: -g: command not found
  88. source: #include <pthread.h>
  89. Build of librdkafka FAILED!
  90. Failed to build librdkafka: bootstrap failed

有人知道如何在windows机器上配置kafkacat吗?
提前谢谢。

jtoj6r0c

jtoj6r0c1#

我从未尝试过用mingw构建librdkafka,但这应该是可能的。看起来您缺少构建工具链(没有cc、ld、nm等)。
有关更多信息,请参阅mingw安装说明:http://www.mingw.org/wiki/howto_install_the_mingw_gcc_compiler_suite
从您的描述中也不清楚这是本机编译还是交叉编译。

本机win32内部版本/visual studio

另一种可能更好的替代方法是在visual studio中构建kafkacat:
在visual studio中打开kafkacat\win32\kafkacat.sln vs解决方案
在kafkacat项目上,右键单击并选择“还原包”
从“构建”菜单中选择“重建解决方案”
这将为您提供一个在本机win32中工作的kafkacat.exe(不需要mingw、cygwin等)
如果您发现这种方法有任何问题,请直接在kafkacat项目上提交问题。

相关问题