Skip to content

Latest commit

 

History

History
72 lines (54 loc) · 2.11 KB

examples.md

File metadata and controls

72 lines (54 loc) · 2.11 KB

serve-grpc examples

Command line examples

Command line example - Enable only szengine gRPC service

For security reasons, it may be that only certain gRPC services are started. In this example, only the SzEngine gRPC is started.

  1. Using command line options. Example:

    export LD_LIBRARY_PATH=/opt/senzing/er/lib/
    senzing-tools serve-grpc \
        --database-url postgresql://username:[email protected]:5432/G2 \
        --enable-szengine

Command line example - using SENZING_TOOLS_ENGINE_CONFIGURATION_JSON environment variable

If using multiple databases or non-system locations of Senzing binaries, SENZING_TOOLS_ENGINE_CONFIGURATION_JSON is used to configure the Senzing runtime engine.

  1. ✏️ Set the value of SENZING_TOOLS_ENGINE_CONFIGURATION_JSON. Example:

    export SENZING_TOOLS_ENGINE_CONFIGURATION_JSON='{
        "PIPELINE": {
            "CONFIGPATH": "/etc/opt/senzing",
            "RESOURCEPATH": "/opt/senzing/er/resources",
            "SUPPORTPATH": "/opt/senzing/data"
        },
        "SQL": {
            "CONNECTION": "postgresql://username:[email protected]:G2/"
        }
    }'
  2. Run the gRPC server. Example:

    export LD_LIBRARY_PATH=/opt/senzing/er/lib/
    senzing-tools serve-grpc
  3. For more information, visit SENZING_TOOLS_ENGINE_CONFIGURATION_JSON

Docker examples

Docker example - Using SQLite database

  1. This usage has an SQLite database that is baked into the Docker container. The container is mutable and the data in the database is lost when the container is terminated. Only use this technique for simple tests. Example:

    docker run \
        --env SENZING_TOOLS_DATABASE_URL=sqlite3://na:na@nowhere/tmp/sqlite/G2C.db \
        --interactive \
        --publish 8258:8258 \
        --rm \
        --tty \
        senzing/senzing-tools serve-grpc
    

    ⚠️ Only use SQLite for simple tests.