Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Join cluster with .erlang.hosts on startup (#5736)
Adam Rutkowski5681c222833b
diff --git a/lib/plausible/application.ex b/lib/plausible/application.exindex 218a1d51de..d38c54c388 100644--- a/lib/plausible/application.ex+++ b/lib/plausible/application.ex@@ -13,8 +13,24 @@ defmodule Plausible.Application do# in CE we start the endpoint under site_encrypt for automatic httpsendpoint = on_ee(do: PlausibleWeb.Endpoint, else: maybe_https_endpoint())+ cluster =+ on_ee(+ do:+ {Cluster.Supervisor,+ [+ [+ default: [+ strategy: Cluster.Strategy.ErlangHosts,+ config: [timeout: 30_000]+ ]+ ],+ [name: Plausible.ClusterSupervisor]+ ]}+ )+children =[+ cluster,{PartitionSupervisor,child_spec: Task.Supervisor, name: Plausible.UserAgentParseTaskSupervisor},Plausible.Session.BalancerSupervisor,diff --git a/mix.exs b/mix.exsindex 5256a6df1e..642e89e36b 100644--- a/mix.exs+++ b/mix.exs@@ -153,7 +153,8 @@ defmodule Plausible.MixProject do{:odgn_json_pointer, "~> 3.0.1"},{:phoenix_bakery, "~> 0.1.2", only: [:ce, :ce_dev, :ce_test]},{:site_encrypt, github: "sasa1977/site_encrypt", only: [:ce, :ce_dev, :ce_test]},- {:phoenix_storybook, "~> 0.8"}+ {:phoenix_storybook, "~> 0.8"},+ {:libcluster, "~> 3.5"}]enddiff --git a/mix.lock b/mix.lockindex ac0c774157..6e333f36ca 100644--- a/mix.lock+++ b/mix.lock@@ -73,6 +73,7 @@"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},"joken": {:hex, :joken, "2.6.0", "b9dd9b6d52e3e6fcb6c65e151ad38bf4bc286382b5b6f97079c47ade6b1bcc6a", [:mix], [{:jose, "~> 1.11.5", [hex: :jose, repo: "hexpm", optional: false]}], "hexpm", "5a95b05a71cd0b54abd35378aeb1d487a23a52c324fa7efdffc512b655b5aaa7"},"jose": {:hex, :jose, "1.11.6", "613fda82552128aa6fb804682e3a616f4bc15565a048dabd05b1ebd5827ed965", [:mix, :rebar3], [], "hexpm", "6275cb75504f9c1e60eeacb771adfeee4905a9e182103aa59b53fed651ff9738"},+ "libcluster": {:hex, :libcluster, "3.5.0", "5ee4cfde4bdf32b2fef271e33ce3241e89509f4344f6c6a8d4069937484866ba", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.3", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ebf6561fcedd765a4cd43b4b8c04b1c87f4177b5fb3cbdfe40a780499d72f743"},"location": {:git, "https://github.com/plausible/location.git", "a89bf79985c3c3d0830477ae587001156a646ce8", []},"locus": {:hex, :locus, "2.3.11", "ddfab230e3fb8b45f47416ed0fb8776c6d6d00f38687f6d37647ed7502c33d8e", [:rebar3], [{:tls_certificate_check, "~> 1.9", [hex: :tls_certificate_check, repo: "hexpm", optional: false]}], "hexpm", "ad855e9b998adc6ec5c57b9d0e5130b0e40a927be7b50d8e104df245c60ede1a"},"mail": {:hex, :mail, "0.3.1", "cb0a14e4ed8904e4e5a08214e686ccf6f9099346885db17d8c309381f865cc5c", [:mix], [], "hexpm", "1db701e89865c1d5fa296b2b57b1cd587587cca8d8a1a22892b35ef5a8e352a6"},