Vagrant box和Docker提供商:Titan和Kafka(Vagrant box and Docker provider: Titan and Kafka)

编程入门 行业动态 更新时间:2024-10-27 07:26:20
Vagrant box和Docker提供商:Titan和Kafka(Vagrant box and Docker provider: Titan and Kafka) docker

我最近被介绍了Docker容器的概念,发现自己正在寻找一个与Kafka一起运行Titan的东西。 我似乎无法在Docker Hub中找到我需要的东西,我想知道是否有一个可行的选项来拥有一个Vagrant盒子(VirtualBox),其中Kafka已经手动安装(根据安装步骤)和Docker镜像Titan( https://hub.docker.com/r/elubow/titan-gremlin/ )从VagrantFile配置中脱颖而出。 你有什么看法? 那里有更好的选择吗? 我的最终范围是将示例Kafka Consumer消费的一些示例消息写入Titan。 这是一个合理的实验设置吗?

谢谢,

问候,

ILARIA

I have been recently introduced to the notion of Docker containers and found myself looking for one that runs Titan together with Kafka. I do not seem to be able to find what I need in Docker Hub and I wonder whether there is a viable option to have a Vagrant box (VirtualBox) where Kafka has been installed manually (according to the installation steps) and a Docker image for Titan (https://hub.docker.com/r/elubow/titan-gremlin/) stood up from the VagrantFile configurations. What is your view? Are there better options out there? My ultimate scope is to write into Titan a number of sample messages consumed by a sample Kafka Consumer. Is this a reasonable set up for experimenting with it?

Thank you,

Regards,

Ilaria

最满意答案

你可以在完整的Docker中试试这个。 你应该看一下GitHub上的这个kafka-docker项目。 它使用docker-compose方法,其目的是在不同的容器中运行不同的依赖服务。

使用此kafka docker-compose.yml项目根目录下docker-compose.yml文件,您可以根据用例想象这样的事情:

zookeeper: image: wurstmeister/zookeeper ports: - "2181" kafka: build: . ports: - "9092" links: - zookeeper:zk environment: KAFKA_ADVERTISED_HOST_NAME: 192.168.59.103 volumes: - /var/run/docker.sock:/var/run/docker.sock titan: image: <your titan image name> ports: <your titan port> links: - kafka - zookeeper:zk

这将在3个不同的容器中运行3个不同的服务:

2181港口的一名动物园管理员 一个kafka,在端口9002的repo根目录下使用Dockerfile构建 你的泰坦容器

这里有趣的东西是links:这将在你的容器之间创建网络链接。 在泰坦集装箱内,卡夫卡将在kafka:9002到达。

你应该玩这一切来拥有完全基于Docker的kafka + titan

You can try this in full Docker. You should have a look at this kafka-docker project on GitHub. It use the docker-compose approach, which aim is to run different dependant services in distinct containers.

Using the docker-compose.yml file at the root of this kafka-docker project, you can imagine something like this for your use case:

zookeeper: image: wurstmeister/zookeeper ports: - "2181" kafka: build: . ports: - "9092" links: - zookeeper:zk environment: KAFKA_ADVERTISED_HOST_NAME: 192.168.59.103 volumes: - /var/run/docker.sock:/var/run/docker.sock titan: image: <your titan image name> ports: <your titan port> links: - kafka - zookeeper:zk

This will run 3 distinct services in 3 distinct containers:

one zookeeper on port 2181 one kafka, built with Dockerfile at the root of the repo on port 9002 your titan container

The interresting stuff here is links: this will create network links between your container. Here inside the titan container, kafka will be reachable at kafka:9002.

You should play with all this to have your fully Docker based kafka + titan

更多推荐

本文发布于:2023-08-03 07:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1383903.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:提供商   Docker   box   Vagrant   Kafka

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!