FlyData Commands & Agent Usage - Flydata Agent v0.2

This is documentation and some use cases for our FlyData Agent. This specific article is for a FlyData Agent that is equal or lower than version 0.2

General Functionality

$ flydata start
This command will start the FlyData Agent. 
$ flydata stop
This command will stop the FlyData Agent completely.
$ flydata restart
This command will stop the FlyData Agent and start it again. WARNING: For FlyData Sync, refer to "$ flydata sync". This command will skip initial sync.
$ flydata status
This will print out whether or not the FlyData Agent is running.
$ flydata version
This will print out the version of the FlyData Agent.
$ flydata sync
This command will start the initial sync with all of your registered MySQL tables.
$ flydata sync table1 table2
This command will start the initial sync with your listed registered MySQL tables.
$ flydata sync:generate_table_ddl
This command will print the SQL necessary to create all registered tables. It will also create FlyData specific tables if it is your first time running the command. We recommend piping this into a file and running the resulting file on your Redshift cluster.
$ flydata sync:generate_table_ddl table1 table2
This command will print the SQL necessary to create the tables listed only. We recommend piping this into a file and running the resulting file on your Redshift cluster.
$ flydata sync:reset
This command will reset your sync completely and stop the FlyData Agent. Contact us if this is run.
$ flydata sync:reset table1 table2
This command will reset your sync for the listed tables and stop the FlyData Agent. Contact us if this is run.

Additional tips

Add tables

At one point, you may want to add more tables to sync. To do this follow these steps:

    1. Log into our console and add another table to your data entry

    2. Stop the FlyData Agent by running:

       

      $ flydata stop
    3. 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 table1 table2 > create_new_table.sql
    4. 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 sync table1 table2

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:

      1. Stop the FlyData Agent by running:

        $ flydata stop
      2. Will generate the SQL to create the table for your table named “test_table”.

        $ flydata sync:generate_table_ddl test_table
      3. 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; 
        
      4. Will start the FlyData Agent again and resume data flow

        $ flydata sync

How to change redshift cluster with an existing flydata sync account

the steps would be this:

  1. Reset FlyData Sync.

     

    $ flydata sync:reset
  2. Log into our FlyData console update your Redshift Cluster information and save.

  3. 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
  4. This will start the FlyData Agent again and resume data flow

     

    $ flydata sync
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk