{"id":19931834,"url":"https://github.com/petabridge/lighthouse","last_synced_at":"2025-10-24T09:35:21.924Z","repository":{"id":22156940,"uuid":"25488342","full_name":"petabridge/lighthouse","owner":"petabridge","description":"Lighthouse - a simple service discovery platform for Akka.Cluster (Akka.NET)","archived":false,"fork":false,"pushed_at":"2024-12-23T22:36:08.000Z","size":1364,"stargazers_count":176,"open_issues_count":6,"forks_count":99,"subscribers_count":20,"default_branch":"dev","last_synced_at":"2025-05-15T19:48:41.915Z","etag":null,"topics":["akka","c-sharp","cluster","lighthouse","service-discovery"],"latest_commit_sha":null,"homepage":"","language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petabridge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-10-20T21:54:31.000Z","updated_at":"2025-05-08T22:57:52.000Z","dependencies_parsed_at":"2023-02-14T13:02:00.659Z","dependency_job_id":"8e42f92d-42ea-4c92-be1a-b9155508eeaf","html_url":"https://github.com/petabridge/lighthouse","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petabridge%2Flighthouse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petabridge%2Flighthouse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petabridge%2Flighthouse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petabridge%2Flighthouse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petabridge","download_url":"https://codeload.github.com/petabridge/lighthouse/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553958,"owners_count":22090417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["akka","c-sharp","cluster","lighthouse","service-discovery"],"created_at":"2024-11-12T23:08:15.410Z","updated_at":"2025-10-24T09:35:21.879Z","avatar_url":"https://github.com/petabridge.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lighthouse\n\n![Docker Pulls](https://img.shields.io/docker/pulls/petabridge/lighthouse)\n\n**Lighthouse** is a simple service-discovery tool for Akka.Cluster, designed to make it easier to play nice with PaaS deployments like Azure / Elastic Beanstalk / AppHarbor.\n\nThe way it works: Lighthouse runs on a static address and _is not updated during deployments of your other Akka.Cluster services_. You don't treat it like the rest of your services. It just stays there as a fixed entry point into the cluster while the rest of your application gets deployed, redeployed, scaled up, scaled down, and so on around it. This eliminates the complexity of traditional service discovery apparatuses by relying on Akka.Cluster's own built-in protocols to do the heavy lifting.\n\nIf you do need to make an update to Lighthouse, here are some cases where that might make sense:\n\n1. To upgrade Akka.NET itself;\n2. To install additional [Petabridge.Cmd](https://cmd.petabridge.com/) modules;\n3. To change the Akka.Remote serialization format (since that affects how Lighthouse communicates with the rest of your Akka.NET cluster); or\n4. To install additional monitoring or tracing tools, such as [Phobos](https://phobos.petabridge.com/).\n\n## Running Lighthouse\nThe easiest way to run Lighthouse is via [Petabridge's official Lighthouse Docker images on Docker Hub](https://hub.docker.com/r/petabridge/lighthouse):\n\n\n### Linux Images\n\n#### AMD64\n\n```\ndocker pull petabridge/lighthouse:latest\n```\n\nor\n\n```\ndocker pull petabridge/lighthouse:linux-latest\n```\n\n#### ARM64\n\n```\ndocker pull petabridge/lighthouse:arm64-latest\n```\n\n### Windows Images\n\n```\ndocker pull petabridge/lighthouse:windows-latest\n```\n\nAll of these images run lighthouse on top of .NET 6 and expose the Akka.Cluster TCP endpoint on port 4053 by default. These images also come with [`Petabridge.Cmd.Host` installed](https://cmd.petabridge.com/articles/install/host-configuration.html) and exposed on TCP port 9110.\n\n\u003e Linux images also come with [the `pbm` client](https://cmd.petabridge.com/articles/install/index.html) installed as a global .NET Core tool, so you can remotely execute `pbm` commands inside the containers themselves without exposing `Petabridge.Cmd.Host` over the network. \n\u003e\n\u003e This feature will be added to Windows container images as soon as [#80](https://github.com/petabridge/lighthouse/issues/80) is resolved.\n\n### Environment Variables\nLighthouse configures itself largely through [the use of `Akka.Bootstrap.Docker`'s environment variables](https://github.com/petabridge/akkadotnet-bootstrap/tree/dev/src/Akka.Bootstrap.Docker#bootstrapping-your-akkanet-applications-with-docker):\n\n* `ACTORSYSTEM` - the name of the `ActorSystem` Lighthouse will use to join the network.\n* `CLUSTER_IP` - this value will replace the `akka.remote.dot-netty.tcp.public-hostname` at runtime. If this value is not provided, we will use `Dns.GetHostname()` instead.\n* `CLUSTER_PORT` - the port number that will be used by Akka.Remote for inbound connections.\n* `CLUSTER_SEEDS` - a comma-delimited list of seed node addresses used by Akka.Cluster. Here's [an example](https://github.com/petabridge/Cluster.WebCrawler/blob/9f854ff2bfb34464769f562936183ea7719da4ea/yaml/k8s-tracker-service.yaml#L46-L47). _Lighthouse will inject it's own address into this list at startup if it's not already present_.\n\nHere's an example of running a single Lighthouse instance as a Docker container:\n\n```\nPS\u003e docker run --name lighthouse1 --hostname lighthouse1 -p 4053:4053 -p 9110:9110 --env ACTORSYSTEM=webcrawler --env CLUSTER_IP=lighthouse1 --env CLUSTER_PORT=4053 --env CLUSTER_SEEDS=\"akka.tcp://webcrawler@lighthouse1:4053\" petabridge/lighthouse:latest\n```\n\n#### Enabling Additional Akka.NET Settings\nLighthouse uses [`Akka.Bootstrap.Docker` under the covers, which allows for any Akka.NET HOCON setting to be overridden via environment variables](https://github.com/petabridge/akkadotnet-bootstrap/tree/dev/src/Akka.Bootstrap.Docker#using-environment-variables-to-configure-akkanet).\n\n**Enabling a Split Brain Resolver in Lighthouse**\nHere's one example of how to enable a split brain resolver in Lighthouse using these `Akka.Bootstrap.Docker` environment variable substitution, using `docker-compose` syntax:\n\n```\nversion: '3'\n\nservices:\n  lighthouse.main:\n    image: petabridge/lighthouse:latest\n    hostname: lighthouse.main\n    ports:\n      - '9110:9110'\n    environment:\n      ACTORSYSTEM: \"LighthouseTest\"\n      CLUSTER_PORT: 4053\n      CLUSTER_IP: \"lighthouse.main\"\n      CLUSTER_SEEDS: \"akka.tcp://LighthouseTest@lighthouse.main:4053,akka.tcp://LighthouseTest@lighthouse.second:4053,akka.tcp://LighthouseTest@lighthouse.third:4053\"\n      AKKA__CLUSTER__DOWNING_PROVIDER_CLASS: \"Akka.Cluster.SplitBrainResolver, Akka.Cluster\"\n      AKKA__CLUSTER__SPLIT_BRAIN_RESOLVER__ACTIVE_STRATEGY: \"keep-majority\"\n```\n\n### Examples of Lighthouse in the Wild\nLooking for some complete examples of how to use Lighthouse? Here's some:\n\n1. [Cluster.WebCrawler - webcrawling Akka.Cluster + Akka.Streams sample application.](https://github.com/petabridge/Cluster.WebCrawler)\n\n## Customizing Lighthouse / Avoiding Serialization Errors\n\nWhen using Akka.NET with extension modules like DistributedPubSub or custom serializers (like [Hyperion](https://github.com/akkadotnet/Hyperion)), \nserialization errors may appear in the logs because these modules are not installed and configured into Lighthouse by default. That is, required assemblies should be built into Lighthouse container.\n\nAs you may see in [project file references](src/Lighthouse/Lighthouse.csproj), only `Akka.Cluster` and basic `Petabridge.Cmd.Remote` / `Petabridge.Cmd.Cluster` \n[pbm](https://cmd.petabridge.com/) modules are referenced by default, which means that if you need DistributedPubSub serializers to be discovered, \nyou have to build your own Lighthouse image from source, with required references included.\n\nBasically, what you have to do is:\n1. Get a list of Akka.NET extension modules you are using (`Akka.Cluster.Tools` might be the most popular, or any custom Akka.NET serialization package)\n2. Clone this Lighthouse repo, take Lighthouse project and add this references so that Lighthouse had all the same dependencies your Akka.Cluster nodes are using\n3. Build your own Docker image using Dockerfile ([windows](src/Lighthouse/Dockerfile-windows) / [linux](src/Lighthouse/Dockerfile-linux)) from this repository, \n   and use your customized image instead of the default one\n\n### Workaround for DistributedPubSub\n\n`DistributedPubSub` extension has [`role`](https://getakka.net/articles/clustering/distributed-publish-subscribe.html#distributedpubsub-extension) configuration setting, which allows to select nodes that \nare hosting DistributedPubSub mediators. You can use any role (let's say, `pub-sub-host`) in all your cluster nodes and set `akka.cluster.pub-sub.role = \"pub-sub-host\"` everywhere to exclude nodes that do not have this role configured.\n\nIf Lighthouse container is not configured to have this role, DistributedPubSub will not even touch it's node, which should also resolve the issue with serialization errors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetabridge%2Flighthouse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetabridge%2Flighthouse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetabridge%2Flighthouse/lists"}