单节点DSE开发环境下AlwaysOn SQL访问权限配置咨询
Alright, let's work through this for your dev/test environment where security isn't a top priority. The error you're seeing happens because of a mismatch between your Cassandra and DSE authentication configurations—here's how to get it sorted:
1. Align DSE Authentication with AllowAll Setup
First, edit your dse.yaml file to disable DSE's strict authentication checks (since you're using Cassandra's AllowAllAuthenticator which lets anyone connect freely). Find the authentication_options section and update it to:
authentication_options: enabled: false default_scheme: internal other_schemes: [] scheme_permissions: false allow_digest_with_kerberos: false plain_text_without_ssl: warn transitional_mode: disabled
Setting enabled: false turns off DSE's auth enforcement, which will play nicely with Cassandra's open authentication for testing purposes.
2. Keep Hive Config Simple
Your existing hive-site.xml setting jdbc-auth-type=password is fine for this setup. Since we're disabling DSE auth, any username/password combo (even the default cassandra/cassandra) will work when connecting to AlwaysOn SQL later.
3. Grant Permissions to alwayson_sql (Optional but Useful)
Now that the auth mismatch is fixed, you can run the GRANT commands without hitting the anonymous user error. Connect to cqlsh first:
cqlsh -u cassandra -p cassandra
Then run the permissions commands (adjust based on what access you need—this gives full access for testing):
GRANT ALL ON ALL KEYSPACES TO 'alwayson_sql'; GRANT ALL ON ALL FUNCTIONS TO 'alwayson_sql'; GRANT ALL ON ALL ROLES TO 'alwayson_sql';
4. Restart DSE to Apply Changes
Don't forget to restart your DSE service so the new configuration takes effect:
sudo service dse restart
5. Test AlwaysOn SQL Access
You can verify the setup using a tool like beeline for Hive/AlwaysOn SQL:
# No auth required for test setup beeline -u "jdbc:hive2://localhost:10000/default;auth=noSasl"
Or if you want to use the alwayson_sql user (even though auth is disabled):
beeline -u "jdbc:hive2://localhost:10000/default" -n alwayson_sql -p testpassword
Quick Context on the Original Error
Earlier, you had DSE authentication enabled but Cassandra set to AllowAllAuthenticator. DSE's auth system treats unauthenticated users as anonymous, and anonymous users don't have permission to run GRANT commands. Disabling DSE auth removes that check, letting you manage permissions freely in your test environment.
内容的提问来源于stack exchange,提问作者Rafael Mor

