If I try to create a role when the YB-TServer configuration flag use_cassandra_authentication is set to false, I will get an error.
cassandra@ycqlsh> CREATE ROLE jim WITH PASSWORD='test';
Unauthorized: Error from server: code=2100 [Unauthorized] message="Unauthorized. You have to be logged in and not anonymous to perform this request
CREATE ROLE jim WITH PASSWORD='test';
^^^^^^
(ql error -4)"
After I set the YB-TServer configuration flag use_cassandra_authentication to true, I am able to create the role.
[root@localhost ~]# yugabyted stop
Stopped yugabyted using config /root/var/conf/yugabyted.conf.
[root@localhost ~]# yugabyted start --advertise_address 198.xxx.xxx.xxx --tserver_flags="use_cassandra_authentication=True" > start.log
[root@localhost ~]# ycqlsh 198.xxx.xxx.xxx -u cassandra -p cassandra
Connected to local cluster at 198.xxx.xxx.xxx:9042.
[ycqlsh 5.0.1 | Cassandra 3.9-SNAPSHOT | CQL spec 3.4.2 | Native protocol v4]
Use HELP for help.
cassandra@ycqlsh> CREATE ROLE jim WITH PASSWORD='test';
Note that in the simple example above, I used yugabyted running on a single node.
Using yugabyted, you can create single-node clusters, and, using the –join flag in the start command, multi-node clusters.