InfluxData【环境搭建 03】时序数据库 InfluxDB 离线安装配置使用(下载+安装+端口绑定+管理员用户创建+开启密码认证+开机自启配置)完整流程实例分享
生活随笔
收集整理的這篇文章主要介紹了
InfluxData【环境搭建 03】时序数据库 InfluxDB 离线安装配置使用(下载+安装+端口绑定+管理员用户创建+开启密码认证+开机自启配置)完整流程实例分享
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1.下載安裝包
安裝包地址:https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable,可根據(jù)版本號(hào)和分支進(jìn)行下載。
# 本次安裝的服務(wù)器版本信息 rpm -qi centos-release Name : centos-release Version : 7 Release : 9.2009.1.el7.centos Architecture: x86_64 Install Date: Tue 08 Feb 2022 02:59:59 PM CST Group : System Environment/Base Size : 44787 License : GPLv2 Signature : RSA/SHA256, Thu 03 Dec 2020 12:35:28 AM CST, Key ID 24c6a8a7f4a80eb5 Source RPM : centos-release-7-9.2009.1.el7.centos.src.rpm Build Date : Mon 23 Nov 2020 11:08:41 PM CST Build Host : x86-01.bsys.centos.org Relocations : (not relocatable) Packager : CentOS BuildSystem <http://bugs.centos.org> Vendor : CentOS Summary : CentOS Linux release file Description : CentOS Linux release files本次的下載地址是:https://repos.influxdata.com/rhel/7/x86_64/stable,安裝文件為influxdb-1.7.6.x86_64.rpm。
2.安裝并綁定端口
# 1.本地安裝 yum localinstall -y influxdb-1.7.6.x86_64.rpm# 2.修改配置 vim /etc/influxdb/influxdb.conf # 以下三個(gè)文件夾可根據(jù)需要進(jìn)行修改 [meta]dir = "/var/lib/influxdb/meta" [data]dir = "/var/lib/influxdb/data"wal-dir = "/var/lib/influxdb/wal"# http相關(guān)參數(shù) [http]# 開(kāi)啟 HTTP APIenabled = true # bind-address = ":8086"# 默認(rèn)綁定端口為 8086可進(jìn)行修改bind-address = ":18088"# auth-enabled = false# 用戶(hù)及密碼驗(yàn)證默認(rèn)關(guān)閉【注意】創(chuàng)建管理員用戶(hù)后生產(chǎn)環(huán)境進(jìn)行開(kāi)啟auth-enabled = true3.啟動(dòng)服務(wù)并創(chuàng)建管理員用戶(hù)
首先啟動(dòng) influxdb 服務(wù)端:
# 1.正常后臺(tái)啟動(dòng)[root@aliyun ~]# systemctl start influxd# 前臺(tái)啟動(dòng)可以查看運(yùn)行狀態(tài) 也可以用 -config 指定啟動(dòng)時(shí)的配置文件 [root@aliyun ~]# /usr/bin/influxd8888888 .d888 888 8888888b. 888888b.888 d88P" 888 888 "Y88b 888 "88b888 888 888 888 888 888 .88P888 88888b. 888888 888 888 888 888 888 888 888 8888888K.888 888 "88b 888 888 888 888 Y8bd8P' 888 888 888 "Y88b888 888 888 888 888 888 888 X88K 888 888 888 888888 888 888 888 888 Y88b 888 .d8""8b. 888 .d88P 888 d88P8888888 888 888 888 888 "Y88888 888 888 8888888P" 8888888P"進(jìn)入命令行工具界面進(jìn)行用戶(hù)添加,由于修改了默認(rèn)綁定的端口,需要添加-port參數(shù)指定端口:
# 2.進(jìn)入命令行工具 [root@aliyun ~]# influx -port '18088' Connected to http://localhost:18088 version 1.7.6 InfluxDB shell version: 1.7.6 Enter an InfluxQL query # 創(chuàng)建管理員用戶(hù) > create user "admin" with password 'admin' with all privileges; # 查看用戶(hù)信息 > show users; user admin ---- ----- admin true4.開(kāi)啟用戶(hù)密碼認(rèn)證
vim /etc/influxdb/influxdb.conf # 3.http相關(guān)參數(shù) [http]# 用戶(hù)及密碼驗(yàn)證默認(rèn)關(guān)閉【注意】創(chuàng)建管理員用戶(hù)后生產(chǎn)環(huán)境進(jìn)行開(kāi)啟auth-enabled = true重啟服務(wù)后使用用戶(hù)名及密碼進(jìn)行登錄:
# 重啟服務(wù) systemctl restart influxd# 如果不使用用戶(hù)及密碼登錄操作時(shí)會(huì)報(bào)錯(cuò) [root@aliyun ~]# influx -port '18088' Connected to http://localhost:18088 version 1.7.6 InfluxDB shell version: 1.7.6 Enter an InfluxQL query > show users; ERR: unable to parse authentication credentials Warning: It is possible this error is due to not setting a database. Please set a database with the command "use <database>". # 驗(yàn)證用戶(hù)及密碼 > auth username: admin password: > show users; user admin ---- ----- admin true# 使用用戶(hù)名及密碼正確登錄 [root@aliyun ~]# influx -port '18088' -username 'admin' -password 'admin' Connected to http://localhost:18088 version 1.7.6 InfluxDB shell version: 1.7.6 Enter an InfluxQL query > show users; user admin ---- ----- admin true5.開(kāi)機(jī)自啟配置
# enable 不能用 提示層級(jí)太深 systemctl enable influxd Failed to execute operation: Too many levels of symbolic links修改/etc/rc.loal文件實(shí)現(xiàn)開(kāi)啟啟動(dòng):
vim /etc/rc.loal # 添加啟動(dòng)命令 systemctl start influxd總結(jié)
以上是生活随笔為你收集整理的InfluxData【环境搭建 03】时序数据库 InfluxDB 离线安装配置使用(下载+安装+端口绑定+管理员用户创建+开启密码认证+开机自启配置)完整流程实例分享的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 【Linux部署】NTP时间服务器搭建及
- 下一篇: 【SQL编程】Greenplum 与 M