Quick Start

This guide describes how to install and run Vespa on a single machine using Docker - it configures Vespa, feeds three documents and runs a query. See Getting Started for troubleshooting, next steps and other guides.

Prerequisites:

  • Docker Desktop for Mac/Windows, or Docker on Linux
  • Operating system: Linux, macOS or Windows 10 Pro (Docker requirement)
  • Architecture: x86_64
  • Minimum 6GB memory dedicated to Docker (the default is 2GB on macOS)

This guide is tested with Docker for Mac, Community Edition-18.06.1-ce-mac73 (26764) and vespaengine/vespa Docker image built 2018-10-01.

Running Vespa in Docker

  1. Validating your environment:

    $ docker info | grep "Total Memory"
    

    Make sure you see at minimum 6GB.

  2. Install the Vespa CLI:

    Using Homebrew:

    $ brew install vespa-cli
    

    You can also download Vespa CLI for Windows, Linux and macOS.

  3. Start a Vespa Docker container:

    $ docker run --detach --name vespa --hostname vespa-container \
      --publish 8080:8080 --publish 19071:19071 \
      vespaengine/vespa
    

    The port 8080 is published to make the search and feed interfaces accessible outside of the docker container, 19071 is the config server endpoint. Only one docker container named vespa can run at a time so change the name if needed. See the Dockerfile and the startup script for more insights.

  4. Verify it is ready to use:

    $ vespa status deploy --wait 300
    
  5. Initialize myapp/ to a copy of a sample application package:

    $ vespa clone album-recommendation myapp
    $ cd myapp
    
  6. Deploy it:

    $ vespa deploy --wait 300
    
  7. Verify it has started:

    $ vespa status
    
  8. Feed documents:

    $ vespa document src/test/resources/A-Head-Full-of-Dreams.json
    $ vespa document src/test/resources/Love-Is-Here-To-Stay.json
    $ vespa document src/test/resources/Hardwired...To-Self-Destruct.json
    

    This uses the /document/v1/ API - use vespa-feed-client to feed large amounts of data, fast.

  9. Issue queries:

    $ vespa query "select * from music where album contains 'head';"
    $ vespa query "select * from sources * where sddocname contains 'music';" "ranking=rank_albums" "ranking.features.query(user_profile)={{cat:pop}:0.8,{cat:rock}:0.2,{cat:jazz}:0.1}"
    
    This uses the Query API. You can also view query results in a browser at localhost:8080/querybuilder/.

Next steps

Check out getting started for more tutorials and use cases which Vespa is great for. Hint: the News tutorial set is a great way to explore more Vespa features, and a natural next step.