日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

InfluxData【环境搭建 03】时序数据库 InfluxDB 离线安装配置使用(下载+安装+端口绑定+管理员用户创建+开启密码认证+开机自启配置)完整流程实例分享

發布時間:2024/10/6 数据库 38 豆豆

1.下載安裝包

安裝包地址:https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable,可根據版本號和分支進行下載。

# 本次安裝的服務器版本信息 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 # 以下三個文件夾可根據需要進行修改 [meta]dir = "/var/lib/influxdb/meta" [data]dir = "/var/lib/influxdb/data"wal-dir = "/var/lib/influxdb/wal"# http相關參數 [http]# 開啟 HTTP APIenabled = true # bind-address = ":8086"# 默認綁定端口為 8086可進行修改bind-address = ":18088"# auth-enabled = false# 用戶及密碼驗證默認關閉【注意】創建管理員用戶后生產環境進行開啟auth-enabled = true

3.啟動服務并創建管理員用戶

首先啟動 influxdb 服務端:

# 1.正常后臺啟動[root@aliyun ~]# systemctl start influxd# 前臺啟動可以查看運行狀態 也可以用 -config 指定啟動時的配置文件 [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"

進入命令行工具界面進行用戶添加,由于修改了默認綁定的端口,需要添加-port參數指定端口:

# 2.進入命令行工具 [root@aliyun ~]# influx -port '18088' Connected to http://localhost:18088 version 1.7.6 InfluxDB shell version: 1.7.6 Enter an InfluxQL query # 創建管理員用戶 > create user "admin" with password 'admin' with all privileges; # 查看用戶信息 > show users; user admin ---- ----- admin true

4.開啟用戶密碼認證

vim /etc/influxdb/influxdb.conf # 3.http相關參數 [http]# 用戶及密碼驗證默認關閉【注意】創建管理員用戶后生產環境進行開啟auth-enabled = true

重啟服務后使用用戶名及密碼進行登錄:

# 重啟服務 systemctl restart influxd# 如果不使用用戶及密碼登錄操作時會報錯 [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>". # 驗證用戶及密碼 > auth username: admin password: > show users; user admin ---- ----- admin true# 使用用戶名及密碼正確登錄 [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 true

5.開機自啟配置

# enable 不能用 提示層級太深 systemctl enable influxd Failed to execute operation: Too many levels of symbolic links

修改/etc/rc.loal文件實現開啟啟動:

vim /etc/rc.loal # 添加啟動命令 systemctl start influxd

總結

以上是生活随笔為你收集整理的InfluxData【环境搭建 03】时序数据库 InfluxDB 离线安装配置使用(下载+安装+端口绑定+管理员用户创建+开启密码认证+开机自启配置)完整流程实例分享的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。