如何在Cassandra DB中创建第一个用户 [英] How do you create the first user in Cassandra DB

查看:234
本文介绍了如何在Cassandra DB中创建第一个用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在cassandra数据库中创建第一个用户?

How does one create the first user in a cassandra database?

我试过:

CREATE USER username WITH PASSWORD "";

并说:

Bad Request: Only superusers are allowed to perform CREATE USER queries

从未在此尝试之前创建用户,那么如何在cassandra数据库中创建第一个用户?

But I have never created a user before this attempt, so how do you create the first user in a cassandra database?

这看起来有点奇怪,因为它像一个鸡和鸡蛋问题

This seems a little strange because it's like a chicken and egg problem, but people use Cassandra so I am sure there must be a solution somewhere.

推荐答案

一旦您启用了身份验证和授权,您就可以使用Cassandra可以以默认的Cassandra管理员用户身份登录(到您本地的Cassandra实例),如下所示:

Once you have enabled Authentication and Authorization, you can log-in (to your local Cassandra instance) as the default Cassandra admin user like this:

./cqlsh localhost -u cassandra -p cassandra

如果你在Windows Server上运行Cassandra,我相信您需要使用Python调用它

If you are running Cassandra on a Windows Server, I believe you need to invoke it with Python:

python cqlsh localhost -u cassandra -p cassandra

一次您需要创建另一个超级用户帐户。

Once you get in, your first task should be to create another super user account.

CREATE USER dba WITH PASSWORD 'bacon' SUPERUSER;

接下来,将当前Cassandra超级用户的密码设置为其他值是一个很好的主意。 .preferably长和不可理解的东西。对于新的超级用户,您不需要再次使用默认的Cassandra帐户。

Next, it is a really good idea to set the current Cassandra super user's password to something else...preferably something long and incomprehensible. With your new super user, you shouldn't need the default Cassandra account again.

ALTER USER cassandra WITH PASSWORD 'dfsso67347mething54747long67a7ndincom4574prehensi562ble';

有关详细信息,请参阅此DataStax文章: DataStax中内部验证和授权安全的快速访问Enterprise和Apache Cassandra

For more information, check out this DataStax article: A Quick Tour of Internal Authentication and Authorization Security in DataStax Enterprise and Apache Cassandra

这篇关于如何在Cassandra DB中创建第一个用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆