influxdb基础(一)——influxdb安装与基本配置(centos)
分享一些资料给大家,我觉得这些都是很有用的东西,大家也可以跟着来学习,查漏补缺。《Java高级面试》《Java高级架构知识》《算法知识》《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!漏补缺。《Java高级面试》[外链图片转存中…(img-2N0L9D8i-1713859287872)]《Java高级架构知识》[外链图片转存中…(img-qxp5
用命令service influxdb start
启动influxdb使用的是默认配置/etc/influxdb/influxdb.conf
。
如需指定配置启动可使用:
#指定配置启动
influxd -config /etc/influxdb/influxdb.conf
注意:influx启动后默认占用默8086/8088两个端口号,如下是influxdb.conf
部分配置:
Bind address to use for the RPC service for backup and restore.
bind-address = “127.0.0.1:8088”
The bind address used by the HTTP service.
bind-address = “:8086”
如需要修改端口,可将注释打开,修改即可。
=======================================================================
influxdb是没有密码的,输入influx
回车即可进入到influxdb的客户端,输入exit
或者quit
退出客户端。
可执行influx -help
,查看相关命令参数:
[root@xfyLinux ~]# influx -help
Usage of influx:
-version
Display the version and exit.
-path-prefix ‘url path’
Path that follows the host and port
-host ‘host name’
Host to connect to.
-port ‘port #’
Port to connect to.
-socket ‘unix domain socket’
Unix socket to connect to.
-database ‘database name’
Database to connect to the server.
-password ‘password’
Password to connect to the server. Leaving blank will prompt for password (–password ‘’).
-username ‘username’
Username to connect to the server.
-ssl
Use https for requests.
-unsafeSsl
Set this when connecting to the cluster using https and not use SSL verification.
-execute ‘command’
Execute command and quit.
-type ‘influxql|flux’
Type specifies the query language for executing commands or when invoking the REPL.
-format ‘json|csv|column’
Format specifies the format of the server responses: json, csv, or column.
-precision ‘rfc3339|h|m|s|ms|u|ns’
Precision specifies the format of the timestamp: rfc3339, h, m, s, ms, u or ns.
-consistency ‘any|one|quorum|all’
Set write consistency level: any, one, quorum, or all
-pretty
Turns on pretty print for the json format.
-import
Import a previous database export from file
-pps
How many points per second the import will allow. By default it is zero and will not throttle importing.
-path
Path to file to import
-compressed
Set to true if the import file is compressed
Examples:
Use influx in a non-interactive mode to query the database “metrics” and pretty print json:
$ influx -database ‘metrics’ -execute ‘select * from cpu’ -format ‘json’ -pretty
Connect to a specific database on startup and set database context:
$ influx -database ‘metrics’ -host ‘localhost’ -port ‘8086’
没有密码也可以正常使用,但是为了安全起见,可以为其创建用户和设置密码。输入influx
,连上influxdb客户端,然后在客户端里输入:
创建用户并设置密码
create user xxx with password ‘123456’
查看所有用户
show users
修改密码
set password for xxx=‘1234’
删除用户
drop user xxx
查询用户的权限
show grants for
授权
GRANT ALL PRIVILEGES TO
GRANT [READ,WRITE,ALL] ON <database_name> TO
回收权限
REVOKE ALL PRIVILEGES FROM
REVOKE [READ,WRITE,ALL] ON <database_name> FROM
创建用户+密码+授权(一条语句搞定)
create user xxx with password ‘123456’ with all privileges
创建用户+设置密码+权限管理之后,还需要修改配置/etc/influxdb/influxdb.conf
,开启权限验证:
vim /etc/influxdb/influxdb.conf
开启权限验证
auth-enabled = true
重启influxdb并连接测试:
重启
service influxdb restart
输入用户名+密码连接
influx -username xxx -password 123456
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Java)
最后
分享一些资料给大家,我觉得这些都是很有用的东西,大家也可以跟着来学习,查漏补缺。
《Java高级面试》
《Java高级架构知识》
《算法知识》
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
漏补缺。
《Java高级面试》
[外链图片转存中…(img-2N0L9D8i-1713859287872)]
《Java高级架构知识》
[外链图片转存中…(img-qxp5HLEc-1713859287872)]
《算法知识》
[外链图片转存中…(img-7MMo8kdL-1713859287873)]
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
更多推荐
所有评论(0)