FlyData Commands & Agent Usage - FlyData Agent v0.3
This is documentation and some use cases for our FlyData Agent. This specific article is for a FlyData Agent that is equal or higher than version 0.3
General Functionality
$ flydata start
$ flydata stop
$ flydata restart
$ flydata status
$ flydata version
$ flydata sync
$ flydata sync:generate_table_ddl
$ flydata sync:generate_table_ddl table1 table2
$ flydata sync:generate_table_ddl -all-tables
$ flydata sync:reset
$ flydata sync:reset table1 table2
Additional tips
Add tables
At one point, you may want to add more tables to sync. To do this follow these steps:
-
Log into our console and add another table to your
data entry
- Stop the FlyData Agent by running:
$ flydata stop
- Enter all the tables separated by a space. This will generate a query to create the new tables on your Redshift cluster. Run the resulting SQL on your Redshift cluster.
$ flydata sync:generate_table_ddl > create_new_table.sql
- Enter all the tables, separated by a space. This will start the initial synchronization of these specific tables. After this has finished, we will continually upload updates from all of your registered tables to your Redshift cluster.
$ flydata start
Change your Redshift table keys
Upon generation of the table creation sql via flydata sync:generate_table_ddl
, there will be no distkeys or sortkeys auto assigned for you. You will have to modify the resulting SQL to change or modify the keys. However, if the table has already been created, you can follow these steps to modify your table:
-
Stop the FlyData Agent by running:
$ flydata stop
-
Will generate the SQL to create the table for your table named “test_table”.
$ flydata sync:generate_table_ddl test_table
-
Run a query similar to this on your Redshift cluster. Keep in mind, the “CREATE TABLE” query will be the query that needs to be changed to include the distkey and sortkeys.
mysql> ALTER TABLE test_table RENAME TO old_test_table;
mysql> CREATE TABLE new_test_table([new table columns]);
mysql> INSERT INTO new_test_table (SELECT * FROM old_test_table);
mysql> ALTER TABLE new_test_table RENAME TO test_table;
mysql> DROP TABLE old_test_table;
-
Will start the FlyData Agent again and resume data flow
$ flydata start
How to change redshift cluster with an existing flydata sync account
the steps would be this:
- Reset FlyData Sync.
$ flydata sync:reset
-
Log into our FlyData console update your Redshift Cluster information and save.
- This will generate a query to create the new tables on your Redshift cluster. Run the resulting SQL on your Redshift cluster. Then run the resulting SQL on your new Redshift cluster.
$ flydata sync:generate_table_ddl > create_table.sql
- This will start the FlyData Agent again and resume data flow
$ flydata start