在Windows上运行Elixir应用程序:无法设置短节点名称

问题描述 投票:0回答:1

[我使用mix release构建了Elixir应用,当我使用.\_build\prod\rel\prod\bin\prod start运行它时,出现以下错误:

2020-02-08 19:57:52.981000
    args: []
    format: "Can't set short node name!\nPlease check your configuration\n"
    label: {error_logger,info_msg}

我查看了fsutil并更改了我的计算机名称(Windows 10),但没有帮助。

我也尝试了@aleksei提到的内容,但没有运气:

.\_build\prod\rel\prod\bin\prod start --sname zpc

我的mix.exs具有以下内容:

  def project do
    [
      app: :km,
      releases: [
        prod: [
          include_executables_for: [:unix, :windows],
          steps: [:assemble, :tar]
        ]
      ],
      version: "0.1.0",
      elixir: "~> 1.9",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

env.bat.eex具有以下内容:

@echo off
rem Set the release to work across nodes. If using the long name format like
rem the one below ([email protected]), you need to also uncomment the
rem RELEASE_DISTRIBUTION variable below.
rem set RELEASE_DISTRIBUTION=km
set RELEASE_NODE=<%= @release.name %>@127.0.0.1
elixir mix
1个回答
0
投票

env.bat.eex的默认模板被配置为与节点之间的发行版一起使用,并且取决于要设置的@release.name模块变量。

要使用短节点名运行发行版,只需注释env.bat.eex中的所有内容:

@echo off
rem Set the release to work across nodes.
rem If using the long name format like
rem   the one below ([email protected]),
rem   you need to also uncomment the
rem   RELEASE_DISTRIBUTION variable below.
rem
rem set RELEASE_DISTRIBUTION=km
rem set RELEASE_NODE=<%= @release.name %>@127.0.0.1
© www.soinside.com 2019 - 2024. All rights reserved.