7

In my use case I am using single ec2 instance [not a cluster]. I want to create a database and an user with all privileges programmatically? Is there a config file which I can edit and copy to the right location after influxdb is installed.

Could someone help me with this?

3 Answers 3

10

There isn't any config option that you can use to do that with InfluxDB itself. After starting up an instance you can use the InfluxDB HTTP to create the users. The curl command to do so would be the following:

curl "http://localhost:8086/query" --data-urlencode "q=CREATE USER myuser WITH PASSWORD 'mypass' WITH ALL PRIVILEGES"

Just run this command for each of the users you'd like to create. After that, you'll need to enabled the auth value of the [http] section of the config.

Sign up to request clarification or add additional context in comments.

1 Comment

On CLI just type influx, then enter command CREATE USER myuser WITH PASSWORD 'mypass' WITH ALL PRIVILEGES
-1

you can use ansible to setup influxb with your own recipe.

here's the ansible module documentation that you can use http://docs.ansible.com/ansible/influxdb_database_module.html

or, any config/deploy manager that you prefer. i'd do this anyday instead of some ssh script or who knows what. https://forge.puppet.com/tags/influxdb

chef. https://github.com/bdangit/chef-influxdb

and also, you can use any of the above config managers to provision/manipulate your ec2 instance(s).

Comments

-1

Use the admin token and this command (InfluxDB 2.3 CLI)

.\influx.exe user create -n yourusername -p yourpassword -o "your org name" --token admintokengoeshere

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.