gpt4 book ai didi

ubuntu - 启动 Grafana-server 总是给我绑定(bind) : address already in use even though I change port

转载 作者:行者123 更新时间:2023-12-04 18:26:00 25 4
gpt4 key购买 nike

我正在使用 Ansible 自动安装 Grafana、Promethus 和 Node 导出器。其他一切都运行良好,但我在启动 Grafana 服务器时遇到问题。所以我尝试通过 SSH 连接到服务器并运行 sudo grafana-server --config grafana.ini --homepath "/usr/share/grafana" .我对 Grafana 的 HTTP 选项是这样的:

# HTTP options
[server]
http_addr = 0.0.0.0
http_port = 1339
domain = ansiblevirtualbox
root_url = http://0.0.0.0:1337
cert_key =
enforce_domain = False
protocol = http
socket =
enable_gzip = False
cert_file =
static_root_path = public
router_logging = False

如您所见,我目前正在使用端口 1339。这给了我已经在使用的错误地址。我可以更改为端口 3000、1337 等。我总是收到该错误。

下面是最近尝试启动服务器的日志。
t=2019-09-19T06:26:44+0000 lvl=info msg="Starting Grafana" logger=server version=6.3.5 commit=67bad72 branch=HEAD compiled=2019-09-02T09:34:49+0000
t=2019-09-19T06:26:44+0000 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2019-09-19T06:26:44+0000 lvl=info msg="Config loaded from" logger=settings file=grafana.ini
t=2019-09-19T06:26:44+0000 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2019-09-19T06:26:44+0000 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2019-09-19T06:26:44+0000 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2019-09-19T06:26:44+0000 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
t=2019-09-19T06:26:44+0000 lvl=info msg="Path Provisioning" logger=settings path=/usr/share/grafana/conf/provisioning
t=2019-09-19T06:26:44+0000 lvl=info msg="App mode production" logger=settings
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing SqlStore" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=sqlite3
t=2019-09-19T06:26:44+0000 lvl=info msg="Starting DB migration" logger=migrator
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing HTTPServer" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing InternalMetricsService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing RemoteCache" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing QuotaService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing PluginManager" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Starting plugin search" logger=plugins
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing RenderingService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing AlertEngine" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing DatasourceCacheService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing HooksService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing LoginService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing SearchService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing ServerLockService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing TracingService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing UsageStatsService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing UserAuthTokenService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing CleanUpService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing NotificationService" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing provisioningServiceImpl" logger=server
t=2019-09-19T06:26:44+0000 lvl=info msg="Initializing Stream Manager"
t=2019-09-19T06:26:44+0000 lvl=info msg="HTTP Server Listen" logger=http.server address=0.0.0.0:1339 protocol=http subUrl= socket=
t=2019-09-19T06:26:44+0000 lvl=eror msg="Stopped HTTPServer" logger=server reason="listen tcp 0.0.0.0:1339: bind: address already in use"
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped Stream Manager"
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped NotificationService" logger=server reason="context canceled"
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped CleanUpService" logger=server reason="context canceled"
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped UserAuthTokenService" logger=server reason="context canceled"
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped UsageStatsService" logger=server reason="context canceled"
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped TracingService" logger=server reason=nil
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped RenderingService" logger=server reason=nil
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped RemoteCache" logger=server reason="context canceled"
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped InternalMetricsService" logger=server reason="context canceled"
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped provisioningServiceImpl" logger=server reason="context canceled"
t=2019-09-19T06:26:44+0000 lvl=info msg="Stopped AlertEngine" logger=server reason="context canceled"
t=2019-09-19T06:26:45+0000 lvl=info msg="Stopped PluginManager" logger=server reason="context canceled"
t=2019-09-19T06:26:45+0000 lvl=eror msg="Server shutdown" logger=server reason="listen tcp 0.0.0.0:1339: bind: address already in use"

可能是什么问题?如果我运行 netstat -tulpn ,它没有说任何关于监听我一直在使用的端口。我正在使用 Ubuntu 18.04

最佳答案

使用 sudo 运行 netstat .
您也可以尝试sudo lsof -ti:1339查看哪个进程使用该端口。

你可以用 sudo lsof -ti:1339 | xargs kill -9 杀死它.

此外,请尝试仅使用以下命令运行它:grafana-server -homepath /usr/share/grafana

关于ubuntu - 启动 Grafana-server 总是给我绑定(bind) : address already in use even though I change port,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58004955/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com