This page discusses running the Stardog Server.
<details open markdown="block"> <summary> Page Contents </summary> 1. TOC </details>Stardog server is run via Docker. The simplest way to start the server is:
$ docker run -v ~/stardog-home:/var/opt/stardog -p 5820:5820 stardog/stardog
This mounts your Stardog home directory (containing your license and databases) and exposes port 5820.
To run in the background (detached mode):
$ docker run -d --name stardog -v ~/stardog-home:/var/opt/stardog -p 5820:5820 stardog/stardog
To bind to a custom port (e.g., 8080):
$ docker run -v ~/stardog-home:/var/opt/stardog -p 8080:5820 stardog/stardog
Server startup options can be appended to the docker run command. For example, to bind to a specific network interface:
$ docker run -v ~/stardog-home:/var/opt/stardog -p 5820:5820 stardog/stardog --bind 192.168.1.100
For more information on server startup options, see the server start man page. For Docker-specific configuration, see Docker setup.
Stardog server will lock STARDOG_HOME when it starts in order to prevent synchronization errors and other issues. This prevents running more than one Stardog server with the same STARDOG_HOME. If you need to run more than one Stardog server instance, choose a different STARDOG_HOME, or pass a different value to the --home option.
Do not manually delete the lock file. Please see the Administrating Stardog 101 section for more information about common pitfalls with the lock file.
To stop a running Stardog server:
$ stardog-admin server stop
By default, this stops a server running on localhost on the default port (5820). Use the --server option to specify a different URL.
For more information on the server stop command, see its man page.
If you started Stardog in the foreground, press Ctrl+C to stop the server.
If you started Stardog in detached mode, you can also use Docker commands:
$ docker stop stardog
You can find the container name or ID with docker ps.
Safe mode helps users overcome initialization errors when starting the server. This feature ensures that the server may start up, even if there is an issue with a component. Safe mode should be a temporary fallback, only for starting servers which no longer start due to a misconfiguration. Safe mode is not supported with the HA Cluster. In a clustered environment, you must use safe mode on a single node. Once you finish making changes on one node, the other nodes may be restarted and sync from the healthy node.
Safe mode will do the following:
stardog-admin server backupSituations where one would use the Safe Mode include:
Append the --safe option to the docker run command:
$ docker run -v ~/stardog-home:/var/opt/stardog -p 5820:5820 stardog/stardog --safe
Alternatively, add a property to the stardog.properties file in your Stardog home directory. After you have resolved the issue, remove this property to disable safe mode.
stardog.safe.mode=true