Search code examples
c#dockerignite

C# .NET to Apache Ignite on Docker


I am new to Apache Ignite and our requirement is to run it on docker, however, I tried searching online how to connect from my C# .NET application to the dockerize Apache Ignite but couldn't find a good resource about this.

I have a docker-compose file that contains the following:

networks:
  app-tier:
    driver: bridge

services:
  ignite:
    image: "apacheignite/ignite:latest"
    container_name: 'test-ignite'
    ports:
      - '47100:47100'
    networks:
      - app-tier
    environment:
      IGNITE_HOST: 'test-ignite'

and I run docker-compose up, and Apache Ignite is running. However, I do not know how to connect from my C# code to this dockerized ignite. Please let me know how to do so and if you can give me sample code snippet then that would be great.


Solution

    • If you want to connect client node or even server node, you will have to specify discovery configuration that will be able to find your dockerized node(s). Such as TcpDiscoveryVmIpFinder with hostname of your dockerized Ignite. Note that all nodes in cluster need to be able to connect to Discovery and Communication ports of every other node.

    • If you want to use thin client or e.g. ODBC client, just specify the hostname when connecting.