【发布时间】:2017-01-17 11:34:13
【问题描述】:
我已经在 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]] 块......这就是我所拥有的。
###
### [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 - 从网络上的另一台计算机创建数据库(没有登录令牌)成功(但不应该):
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
【问题讨论】:
标签: linux authentication influxdb