1

I've got an existing Cassandra application I want to try in Datastax Astra. I've created my Astra database and am able to connect to it from NodeJS successfully. The next task I have is to apply my existing schema.cql to the keyspace.

It should be easy enough right? But never-the-less I can't see any obvious way to do this. Can someone walk me through it please. I can then I think use the dsbulk tool to upload a dataset.

Thanks in advance Astra experts.

Rod

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
rodneyt
  • 71
  • 7
  • What is the role you have created your token for in Astra DB? Otherwise, create a new one as "Database Administrator" and that should be able to SELECT FROM system_virtual_schema.keyspaces. – Aaron May 18 '22 at 16:10
  • 1
    SUCCESS. Thanks for this pointer. The key was to go to Organisational Settings > Role Management > Add Custom Role. Then create a dbadmin role with all permissions. My source of confusion is that I initially created an API role which was fine for connecting from NodeJS but not sufficient for logging in via CQLSH – rodneyt May 18 '22 at 22:53

2 Answers2

0

The easiest way to do it is to cut-and-paste the CQL statements one-by-one into the CQL console and run them one at a time. This is what I would recommend since you have guarantees that each DDL statement has completed successfully before you can execute the next one.

Alternatively, you can download the Standalone CQL Shell to your laptop/desktop and run the cqlsh commands from there. You will need to configure it with your app token + secure connect bundle to be able to connect to your database.

For more info, see the instructions for Installing standalone cqlsh. Cheers!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
  • I find even pasting a table definition into Astra CQL console I get connection closed and the console reloads. Will try the standalone approach. – rodneyt May 18 '22 at 06:55
  • OK downloaded and configured CQL shell. On connecting it returns Unauthorized('Error from server: code=2100 [Unauthorized] message="No SELECT permission on tried added --keyspace=MYKEYSPACE but no changes. Any further suggestions?
    – rodneyt May 18 '22 at 07:06
  • SOLVED see SUCCESS comment above. – rodneyt May 18 '22 at 22:54
0

Converting comment to answer:

Unauthorized('Error from server: code=2100 [Unauthorized]
    message="No SELECT permission on <table system_virtual_schema.keyspaces>

What is the role you have created your token for in Astra DB? Otherwise, create a new one as "Database Administrator" and that should be able to SELECT FROM system_virtual_schema.keyspaces.

While creating use-specific roles is a good idea, only privileged roles can run data definition language (DDL) commands.

Aaron
  • 55,518
  • 11
  • 116
  • 132