#指定配置启动
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
还可以输入influx
,在客户端输入auth验证用户名和密码:
连上influxdb
客户端,输入help
,可查看常用操作命令:
最后
我想问下大家当初选择做程序员的初衷是什么?有思考过这个问题吗?高薪?热爱?
既然入了这行就应该知道,这个行业是靠本事吃饭的,你想要拿高薪没有问题,请好好磨练自己的技术,不要抱怨。有的人通过培训可以让自己成长,有些人可以通过自律强大的自学能力成长,
必看视频!获取2024年最新Java开发全套学习资料 备注Java
如果你两者都不占,还怎么拿高薪?
架构师是很多程序员的职业目标,一个好的架构师是不愁所谓的35岁高龄门槛的,到了那个时候,照样大把的企业挖他。为什么很多人想进阿里巴巴,无非不是福利待遇好以及优质的人脉资源,这对个人职业发展是有非常大帮助的。
如果你也想成为一名好的架构师,那或许这份Java核心架构笔记你需要阅读阅读,希望能够对你的职业发展有所帮助。
中高级开发必知必会:
788.png)(title-必看视频!获取2024年最新Java开发全套学习资料 备注Java)]
如果你两者都不占,还怎么拿高薪?
架构师是很多程序员的职业目标,一个好的架构师是不愁所谓的35岁高龄门槛的,到了那个时候,照样大把的企业挖他。为什么很多人想进阿里巴巴,无非不是福利待遇好以及优质的人脉资源,这对个人职业发展是有非常大帮助的。
如果你也想成为一名好的架构师,那或许这份Java核心架构笔记你需要阅读阅读,希望能够对你的职业发展有所帮助。
中高级开发必知必会:
[外链图片转存中…(img-pi9EYWzz-1716444576174)]