Aerospike Data Loader can help in migrating data from any other database to Aerospike. User can dump data from different databases in .DSV format and use this tool to parse and load them in Aerospike server. User need to provide .DSV data files to load and aerospike schema file in JSON format. It parse those .DSV files and load data in Aerospike Server according to given schema in schema files.
Source code is available on github:
$ git clone https://github.com/aerospike/aerospike-loader.git
Then build the utility by running following:
$ cd aerospike-loader
$ ./build
Following dependencies are downloaded automatically:
If you downloaded the jar from the releases page. Use
$ java -cp aerospike-load-*-jar-with-dependencies.jar com.aerospike.load.AerospikeLoad <options> <data file name(s)/directory>
If you downloaded the source. Use run_loader script along with options and data files.
$ ./run_loader <options> <data file name(s)/directory>
"data file name(s)/directory" can either be space delimited files or a directory name containing data files. See "Data Files" section for more details.
For available options and their descriptions run with asloader's --usage option.
$ java -cp aerospike-load-*-jar-with-dependencies.jar com.aerospike.load.AerospikeLoad --usage
$ ./run_loader --usage
For more details, refer to Options.
$ ./run_loader -h nodex -p 3000 -n test -T 3000 -e 2592000 -ec 100 -tz PST -wa update -c ~/pathto/config.json datafiles/
Where:
Server IP: nodex (-h)
Port: 3000 (-p)
Namespace: test (-n)
Write Operation Timeout (in milliseconds): 3000 (-T)
Write Error Threshold: 100 (-ec)
Record Expiration: 2592000 (-e)
Timezone: PST (-tz)
Write Action: update (-wa)
Data Mapping: ~/pathto/config.json (-c)
Data Files: datafiles/
Example directory contains two files: allDatatype.json and data.csv. Run the following command to load data from data file data.csv.
./run_loader -h localhost -c example/alldatatype.json example/alldatatype.dsv
For more examples, see the examples/README.md.