influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

How to create admin / root user and set its password after a freshly installed InfluxDB 2.3?

Open kosuodhmwa opened this issue 3 years ago • 1 comments

Maybe somebody has a step-by-step-manual for that. No matter what i do, i always get a 401 error.

root@test:/var/lib/influxdb# influx auth create --org my-org --all-access Error: failed to lookup org with name "my-org": 401 Unauthorized: unauthorized access

root@test:/var/lib/influxdb# influx auth list Error: could not find authorization with given parameters: 401 Unauthorized: unauthorized access

` root@test:/var/lib/influxdb# curl http://localhost/api/v2/authorizations

404 Not Found

Not Found

The requested URL was not found on this server.


Apache/2.4.25 (Debian) Server at localhost Port 80
`

root@test:/var/lib/influxdb# influx user ls Error: failed to list users: 401 Unauthorized: unauthorized access

root@test:/var/lib/influxdb# influx user list Error: failed to list users: 401 Unauthorized: unauthorized access

root@test:/var/lib/influxdb# influx user create -n root -p Test12345 -o myorg-com Error: failed to lookup org with name "myorg-com": 401 Unauthorized: unauthorized access

Thank you very very much for your feedback(s) :-)

With best regards from Switzerland, Patrick

kosuodhmwa avatar Aug 19 '22 14:08 kosuodhmwa

-> same problem when i write noauth into config file

root@xili:/etc/influxdb# cat config.toml bolt-path = "/var/lib/influxdb/influxd.bolt" engine-path = "/var/lib/influxdb/engine" auth-enabled = false

jayjupdhig avatar Aug 19 '22 15:08 jayjupdhig

@kosuodhmwa @jayjupdhig

You need to run the influx setup command to initialize the operator token/user.

$ influx setup
> Welcome to InfluxDB 2.0!
? Please type your primary username admin
? Please type your password ***********
? Please type your password again ***********
? Please type your primary organization name my-org
? Please type your primary bucket name my-bucket
? Please type your retention period in hours, or 0 for infinite 0
? Setup with these parameters?
  Username:          admin
  Organization:      my-org
  Bucket:            my-bucket
  Retention Period:  infinite
 Yes
User    Organization    Bucket
admin   my-org          my-bucket

jshbrntt avatar Oct 14 '22 00:10 jshbrntt