gpt4 book ai didi

linux - Influxdb 不要求身份验证

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:42:05 26 4
gpt4 key购买 nike

我已经在运行在 raspberrypi 上的 linux 发行版上安装了 influxdb...

pi@raspberrypi:~ $ influx -version
InfluxDB shell version: 1.1.1

然后我创建一个数据库,然后创建一个管理员用户

CREATE USER admin WITH PASSWORD 'password' WITH ALL PRIVILEGES

在此之后,我编辑位于以下位置的 influx.conf 文件:

/etc/influxdb/influxdb.conf

因为我希望 influxdb 在访问时请求用户身份验证(http 外部或内部和控制台?是否可能是控制台?)我浏览并查找文件上的 [[http]] block ....这就是我所拥有的。

###
### [http]
###
### Controls how the HTTP endpoints are configured. These are the primary
### mechanism for getting data into and out of InfluxDB.
###
# [http]
# Determines whether HTTP endpoint is enabled.
enabled = true

# The bind address used by the HTTP service.
# bind-address = ":8086"

# Determines whether HTTP authentication is enabled.
auth-enabled = true

# The default realm sent back when issuing a basic auth challenge.
# realm = "InfluxDB"

# Determines whether HTTP request logging is enable.d
# log-enabled = true

# Determines whether detailed write logging is enabled.
# write-tracing = false

# Determines whether the pprof endpoint is enabled. This endpoint is used for
# troubleshooting and monitoring.
pprof-enabled = true

# Determines whether HTTPS is enabled.
https-enabled = false

# The SSL certificate to use when HTTPS is enabled.
https-certificate = "/etc/ssl/influxdb.pem"

# Use a separate private key location.
https-private-key = ""

# The JWT auth shared secret to validate requests using JSON web tokens.
shared-sercret = ""

# The default chunk size for result sets that should be chunked.
# max-row-limit = 10000

# The maximum number of HTTP connections that may be open at once. New connections that
# would exceed this limit are dropped. Setting this value to 0 disables the limit.
# max-connection-limit = 0

# Enable http service over unix domain socket
# unix-socket-enabled = false

# The path of the unix domain socket.
# bind-socket = "/var/run/influxdb.sock"

更改第 1 和第 3 个子组条目。

最后,我重新启动了 influxdb 服务:

sudo service influxdb restart

问题

1 - 从网络上的另一台计算机(没有登录 token )创建数据库成功(但不应该):

http://192.168.7.125:8086/query?q=CREATE DATABASE test

返回:

{

"results": [
{}
]
}

在 raspberry cmdline 上调用 influxdb 不要求授权:

pi@raspberrypi:~ $ influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 1.1.1
InfluxDB shell version: 1.1.1
>

有人知道我做错了什么吗?

编辑

此外,检查/var/log/syslog 我可以看到:1- 它正在从当前目录加载文件

[run] 2017/01/17 11:27:36 InfluxDB starting, version 1.1.1, branch master, commit e47c
f1f2e83a02443d7115c54f838be8ee959644
Jan 17 11:27:36 raspberrypi influxd[901]: [run] 2017/01/17 11:27:36 Go version go1.7.4, GOMAXPROCS set to 4
Jan 17 11:27:36 raspberrypi influxd[901]: [run] 2017/01/17 11:27:36 Using configuration at: /etc/influxdb/influxdb.conf
Jan 17 11:27:36 raspberrypi influxd[901]: [store] 2017/01/17 11:27:36 Using data dir: /var/lib/influxdb/data

2- 启动身份验证失败(身份验证已停用)

Jan 17 11:27:37 raspberrypi influxd[901]: [httpd] 2017/01/17 11:27:37 Starting HTTP service
Jan 17 11:27:37 raspberrypi influxd[901]: [httpd] 2017/01/17 11:27:37 Authentication enabled: false
Jan 17 11:27:37 raspberrypi influxd[901]: [httpd] 2017/01/17 11:27:37 Listening on HTTP: [::]:8086

最佳答案

罪魁祸首在 [http] 此处:

###
### [http]
###
### Controls how the HTTP endpoints are configured. These are the primary
### mechanism for getting data into and out of InfluxDB.
###
[http]
# Determines whether HTTP endpoint is enabled.
enabled = true

# The bind address used by the HTTP service.
# bind-address = ":8086"

# Determines whether HTTP authentication is enabled.
auth-enabled = true

关于linux - Influxdb 不要求身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41696079/

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