Managing Kafka users
The Kafka data bus is used for streaming messages. To access the message queue in topics of a Kafka cluster, you must first create a user. The user is assigned roles that determine whether the user can read and send messages in a topic. You can assign a role to a user and grant access:
- for a single topic;
- multiple topics by prefix;
- all topics.
Create a user
- In the control panel, in the top menu, click Products and select Cloud Databases.
- Open the Active tab.
- Open the database cluster page → Users tab.
- Click Create user.
- Enter a username and password. Save the password — it will not be stored in the dashboard.
- Click Create.
Change user password
After the cluster is created, the user password can be changed. Do not forget to update the password in your application.
- In the control panel, in the top menu, click Products and select Cloud Databases.
- Open the Active tab.
- Open the cluster page → Users tab.
- In the user's menu, select Change password.
- Enter or generate a new password and click Save.
User roles
Users can have the following roles:
- consumer — receives and processes messages from a topic to which they have access;
- producer — sends messages to a topic to which they have access.
For more information, see the Apache Kafka documentation for the consumer and producer.
Grant access to a user
-
In the control panel, in the top menu, click Products and select Cloud Databases.
-
Open the Active tab.
-
Open the cluster page → Users tab.
-
In the user's menu, select Configure access.
-
Choose the topic access type:
- by prefix — to multiple topics identified by a repeating start of their name;
- by name — to a specific topic. Available only if topics have been created;
- all topics.
-
If you selected access by topic prefix, in the Value field, enter the prefix.
-
If you selected access by topic name, in the Value field, select the topic name.
-
Select a user role. You can assign one or two roles to a user.
-
Click .
-
To grant the user multiple permissions, click Add access and repeat steps 5-9.
Change user access
In the access row, you can only change the role. If you need to change the access type or value, delete the access row that needs to be modified and add a new access.
- In the control panel, in the top menu, click Products and select Cloud Databases.
- Open the Active tab.
- Open the cluster page → Users tab.
- In the user's menu, select Configure access.
- To change the role, in the access row, click .
- Change the role.
- Click .