Simple single-machine AsterixDB server
715
This projects aims to make it easy to get started with AsterixDB. It is based on Docker and Docker compose. Currently, the following features are supported:
If you do not need HDFS, you can use the docker image without docker-compose:
docker run --rm -it -p 19002:19002 -p 19006:19006 ingomuellernet/asterixdb
The following should be enough to bring up all required services:
docker-compose up
To change the number of HDFS data nodes, use the --scale flag of docker-compose:
docker-compose up --scale datanode=3
Above command uses a pre-built docker image. If you want the image to be build locally, do the following instead:
docker-compose --file docker-compose-local.yml up
If you are behind a corporate firewall, you will have to configure Maven (which is used to build part of AsterixDB) as follows before running above command:
export MAVEN_OPTS="-Dhttp.proxyHost=your.proxy.com -Dhttp.proxyPort=3128 -Dhttps.proxyHost=your.proxy.com -Dhttps.proxyPort=3128"
The data/ folder is mounted into the HDFS namenode container, from where you can upload it using the HDFS client in that container (docker-asterixdb_namenode_1 may have a different name on your machine; run docker ps to find out):
docker exec -it docker-asterixdb_namenode_1 hadoop fs -mkdir /dataset
docker exec -it docker-asterixdb_namenode_1 hadoop fs -put /data/file.parquet /dataset/
docker exec -it docker-asterixdb_namenode_1 hadoop fs -ls /dataset
Once started, you should be able to use the server by accssing http://localhost:19006. Alternatively, the REST API is accessible on the standard port.
Suppose you have the following file test.json:
{"s": "hello world", "i": 42}
Upload it to /dataset/test.json on HDFS as described above. Then run the following in the web interface:
CREATE TYPE t1 AS OPEN {};
CREATE EXTERNAL DATASET Test(t1)
USING hdfs (
("hdfs"="hdfs://namenode:8020"),
("path"="/dataset/test.json"),
("input-format"="text-input-format"),
("format"="json")
);
Content type
Image
Digest
Size
585.3 MB
Last updated
over 5 years ago
docker pull ingomuellernet/asterixdb