-
✏️ SQLite database. Example:
rm -rf /tmp/sqlite touch /tmp/sqlite/G2C.db senzing-tools init-database --database-url sqlite3://na:na@/tmp/sqlite/G2C.db
-
✏️ PostgreSql database. Example:
senzing-tools init-database --database-url postgresql://postgres:postgres@postgres.example.com:5432/G2
-
✏️ SQLite database. Example:
export SENZING_TOOLS_DATABASE_URL=sqlite3://na:na@/tmp/sqlite/G2C.db senzing-tools init-database
-
✏️ PostgreSql database. Example:
export SENZING_TOOLS_DATABASE_URL=postgresql://postgres:postgres@postgres.example.com:5432/G2 senzing-tools init-database
In these examples, datasources are added to the initial Senzing configuration.
-
✏️ Specify datasources to create using single
--datasources
parameter. Example:export LD_LIBRARY_PATH=/opt/senzing/er/lib/ senzing-tools init-database \ --database-url postgresql://username:password@postgres.example.com:5432/G2 \ --datasources CUSTOMER,REFERENCE,WATCHLIST
-
✏️ Specify datasources to create using multiple
--datasources
parameter. Example:export LD_LIBRARY_PATH=/opt/senzing/er/lib/ senzing-tools init-database \ --database-url postgresql://username:password@postgres.example.com:5432/G2 \ --datasources CUSTOMER \ --datasources REFERENCE \ --datasources WATCHLIST
-
✏️ Specify datasources to create using SENZING_TOOLS_DATASOURCES environment variable. Example:
export SENZING_TOOLS_DATABASE_URL=postgresql://username:password@postgres.example.com:5432/G2 export SENZING_TOOLS_DATASOURCES="CUSTOMER REFERENCE WATCHLIST" export LD_LIBRARY_PATH=/opt/senzing/er/lib/ senzing-tools init-database
-
Make a directory for Docker volume. Example:
mkdir /tmp/my-sqlite
-
Run
senzing/senzing-tools
Docker image withinit-database
command. Example:docker run \ --env SENZING_TOOLS_DATABASE_URL=sqlite3://na:na@/tmp/sqlite/G2C.db \ --rm \ --volume /tmp/my-sqlite:/tmp/sqlite \ senzing/senzing-tools init-database
-
Optional: If an existing PostgreSql database doesn't exist, bring up a new PostgreSql database in a docker-compose formation.
-
✏️ Identify database URL, if using existing PostgreSql. Example:
export SENZING_TOOLS_DATABASE_URL=postgresql://postgres:postgres@postgres.example.com:5432/G2
-
Identify database URL, if using docker-compose stack. Note: Assignment of
LOCAL_IP_ADDRESS
may not work in all cases. Example:export LOCAL_IP_ADDRESS=$(curl --silent https://raw.githubusercontent.com/senzing-garage/knowledge-base/main/gists/find-local-ip-address/find-local-ip-address.py | python3 -) export SENZING_TOOLS_DATABASE_URL=postgresql://postgres:postgres@${LOCAL_IP_ADDRESS}:5432/er/?sslmode=disable
-
Run
senzing/senzing-tools
Docker image withinit-database
command. Example:docker run \ --env SENZING_TOOLS_DATABASE_URL \ --rm \ senzing/senzing-tools init-database
Using SENZING_TOOLS_ENGINE_CONFIGURATION_JSON
superceeds use of SENZING_TOOLS_DATABASE_URL
.
It can be used to specify multiple databases or non-system locations of senzing binaries.
For more information, see
SENZING_TOOLS_ENGINE_CONFIGURATION_JSON.
-
✏️ Set
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:password@postgres.example.com:5432:G2" } }'
-
Run
senzing/senzing-tools
Docker container. Example:docker run \ --env SENZING_TOOLS_ENGINE_CONFIGURATION_JSON \ --rm \ senzing/senzing-tools init-database
Datasources can be added to the initial Senzing configuration.
-
✏️ Specify datasources to create using SENZING_TOOLS_DATASOURCES environment variable. Example:
docker run \ --env SENZING_TOOLS_DATABASE_URL=postgresql://username:password@postgres.example.com:5432/G2 \ --env SENZING_TOOLS_DATASOURCES="CUSTOMER REFERENCE WATCHLIST" \ senzing/senzing-tools init-database
-
Identify a directory to place docker-compose artifacts. The directory specified will be deleted and re-created. Example:
export SENZING_DEMO_DIR=~/my-senzing-demo
-
Bring up the docker-compose stack. Example:
export PGADMIN_DIR=${SENZING_DEMO_DIR}/pgadmin export POSTGRES_DIR=${SENZING_DEMO_DIR}/postgres export RABBITMQ_DIR=${SENZING_DEMO_DIR}/rabbitmq export SENZING_VAR_DIR=${SENZING_DEMO_DIR}/var export SENZING_UID=$(id -u) export SENZING_GID=$(id -g) rm -rf ${SENZING_DEMO_DIR:-/tmp/nowhere/for/safety} mkdir ${SENZING_DEMO_DIR} mkdir -p ${PGADMIN_DIR} ${POSTGRES_DIR} ${RABBITMQ_DIR} ${SENZING_VAR_DIR} chmod -R 777 ${SENZING_DEMO_DIR} curl -X GET \ --output ${SENZING_DEMO_DIR}/docker-versions-stable.sh \ https://raw.githubusercontent.com/senzing-garage/knowledge-base/main/lists/docker-versions-stable.sh source ${SENZING_DEMO_DIR}/docker-versions-stable.sh curl -X GET \ --output ${SENZING_DEMO_DIR}/docker-compose.yaml \ "https://raw.githubusercontent.com/senzing-garage/docker-compose-demo/main/resources/postgresql/docker-compose-postgresql-uninitialized.yaml" cd ${SENZING_DEMO_DIR} sudo --preserve-env docker-compose up
-
Cleanup. Example:
cd ${SENZING_DEMO_DIR} sudo --preserve-env docker-compose down
pgadmin
is deployed with
Docker-compose stack with uninitialized PostgreSql database
- Visit localhost:9171.
For the initial login, review the instructions at the top of the web page.
For server password information, see the
POSTGRESQL_POSTGRES_PASSWORD
value in${SENZING_DEMO_DIR}/docker-compose.yaml
. Usually, it's "postgres".
The coleifer/sqlite-web
Docker container can be used to view a SQLite database.
-
Run Docker container. Example:
docker run \ --env SQLITE_DATABASE=G2C.db \ --interactive \ --publish 9174:8080 \ --rm \ --tty \ --volume /tmp/sqlite:/data \ coleifer/sqlite-web
-
Visit http://localhost:9174