Fuseki SPARQL server: Difference between revisions

From artserver wiki
(Created page with " =Run Fuseki as a systemd service= As root got cd /usr/local/src Download & untar wget https://apache.redkiwi.nl/jena/binaries/apache-jena-fuseki-3.15.0.tar.gz tar xfvz a...")
 
Line 44: Line 44:
<pre>
<pre>
Environment=FUSEKI_HOME=/usr/share/fuseki
Environment=FUSEKI_HOME=/usr/share/fuseki
Environment=FUSEKI_BASE=/etc/fuseki
Environment=FUSEKI_BASE=/etc/fuseki
ExecStart=/usr/share/fuseki/fuseki-server
ExecStart=/usr/share/fuseki/fuseki-server
</pre>


Note that the service, by default, will be run by user fuseki:
User=root
<pre>
 
# Run as user  "fuseki"
User=fuseki
</pre>
</pre>
Hence I will add the user fuseki to my system
useradd fuseki
Enable and run the service:
Enable and run the service:
  systemctl enable fuseki
  systemctl enable fuseki
Line 64: Line 59:
  systemctl status fuseki
  systemctl status fuseki


And again check its web UI at http://localhost:3030
* you try to create a db a make and perform and INSERT statement, which be stored in <code>/etc/fuseki/databases/databasename/</code>
==Cofig==
==Security==
==Logging==
==Backups==




there is the file https://jena.apache.org/documentation/fuseki2/fuseki-run.html#fuseki-service


  cp apache-jena-fuseki-3.15.0 /usr/local/bin/fuseki -r
  systemctl daemon-reload

Revision as of 19:15, 19 May 2020


Run Fuseki as a systemd service

As root got

cd /usr/local/src

Download & untar

wget https://apache.redkiwi.nl/jena/binaries/apache-jena-fuseki-3.15.0.tar.gz
tar xfvz apache-jena-fuseki-3.15.0.tar.gz
cd apache-jena-fuseki-3.15.0

Fuseki File Layout

I will follow the Filesystem layout suggested by the official documentation for [1] for running Fuseki as a service

Environment Variable 	Default Setting
FUSEKI_HOME 	        /usr/share/fuseki
FUSEKI_BASE 	        /etc/fuseki
  • FUSEKI_HOME(Distribution area) – a is essentially the fuseki-server binary and a few helper scripts
  • FUSEKI_BASE(Runtime area) – is a directory that contains the configuration, dbs, logs - which should be backup and not changed with updates of the Fuseki binaries.

So let's go ahead and create those directories and move the corresponding files to the right dir

mkdir /usr/share/fuseki
mkdir /etc/fuseki
mv {fuseki,fuseki-server,fuseki-server.bat,fuseki-server.jar,fuseki.war,bin,webapp} /usr/share/fuseki/
mv -r run/* /etc/fuseki/

And we can make a test run by running:

/usr/share/fuseki/fuseki-server

And checking the if the server is up by visiting http://localhost:3030/index.html


Service file

Inside the untared dir /usr/local/src/apache-jena-fuseki-3.15.0 you can find the file fuseki.service

This file should be copied to /etc/system.d/system and edited in order to run Fuseki as a service. The file itself is quite self explanatory, so I will only write here my changes, which match the file system structure I went for.

cp fuseki.service /etc/systemd/system
vi /etc/systemd/system/fuseki.service
Environment=FUSEKI_HOME=/usr/share/fuseki

Environment=FUSEKI_BASE=/etc/fuseki

ExecStart=/usr/share/fuseki/fuseki-server

User=root

Enable and run the service:

systemctl enable fuseki
systemctl start fuseki

Check it's status

systemctl status fuseki

And again check its web UI at http://localhost:3030

  • you try to create a db a make and perform and INSERT statement, which be stored in /etc/fuseki/databases/databasename/

Cofig

Security

Logging

Backups

systemctl daemon-reload
... more about "Fuseki SPARQL server"
Code Notes +
Date"Date" is a type and predefined property provided by Semantic MediaWiki to represent date values.
2020 +