influxdb配置https认证

1.下载生成CA证书

sudo openssl req -x509 -nodes -newkey rsa:2048 \
>   -keyout /etc/ssl/influxdb-selfsigned.key \
>   -out /etc/ssl/influxdb-selfsigned.crt \
>   -days 10
Generating a 2048 bit RSA private key
...................................+++
...................+++
writing new private key to '/etc/ssl/influxdb-selfsigned.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:
State or Province Name (full name) []:
Locality Name (eg, city) [Default City]:
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:
Email Address []:

在/etc/ssl/目录下可以看到生成的2个文件:

[root@basic-server infuxdb]# ll ssl
总用量 8
-rw-r--r-- 1 root root 1302 9月  28 16:16 influxdb-selfsigned.crt
-rw-r--r-- 1 root root 1704 9月  28 16:16 influxdb-selfsigned.key

2.给证书赋权

root@2885d5258bd8:/# chmod 644 /etc/ssl/influxdb-selfsigned.crt 
root@2885d5258bd8:/# chmod 644 /etc/ssl/influxdb-selfsigned.key 

3.配置influxdb支持https

[http]
  enabled = true
  bind-address = ":8086"
  auth-enabled = true
  log-enabled = true
  write-tracing = false
  pprof-enabled = false
  https-enabled = true
  https-certificate = "/etc/ssl/influxdb-selfsigned.crt"
  https-private-key = "/etc/ssl/influxdb-selfsigned.key"
  max-row-limit = 10000

4.可以连接查看

influx -ssl -host <domain_name>.com

参考:influxdb https配置

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值