vaticle / typedb

TypeDB: the polymorphic database powered by types
https://typedb.com
Mozilla Public License 2.0
3.72k stars 337 forks source link

Installing a Grakn distribution as root (using sudo) prevents you from starting it as non-root user #5336

Closed lolski closed 3 years ago

lolski commented 4 years ago

Description

Installing Grakn in Linux is likely done using package manager with sudo privileges:

sudo apt install grakn-core

Environment

  1. OS (where Grakn server runs): Linux
  2. Grakn version (and platform): 1.5.7
  3. Grakn client: N/A
  4. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

$ sudo apt install grakn-core
$ grakn server start

Expected Output

Starting Storage....SUCCESS
Starting Server....SUCCESS

Actual Output

Starting Storage...
An error has occurred during boot-up. Please run 'grakn server status' or check the logs located under the 'logs' directory.
java.nio.file.AccessDeniedException: server/services/cassandra/cassandra.yaml

Additional information

This is because Grakn tries to write to server/services/cassandra/cassandra.yaml which is owned by root.

singuyenmai commented 4 years ago

Hi there,

It also should be noted that to stop the server, the command also need to be executed by root.

For example, I found that when running grakn server stop without sudo, it still runs and returns no error, but it runs like forever ... I tried it, waited for a few minutes, then decided to quit.
Then I tried sudo grakn server stop, and the server successfully stopped in just around 30 sec.

lolski commented 4 years ago

Thank you for the additional clarification.

shanghai-Jerry commented 4 years ago

How to deploy distribution grakn in production with grakn core?

lolski commented 4 years ago

Your question is irrelevant to this bug report and I suggest that you post the question on our Slack or Discussion Forum instead. They can be accessed from this page: https://grakn.ai/community

Also, please take a look at our enterprise offering, Grakn KGMS which is available in the market place in both AWS and Google Cloud.

andreas-roehler commented 3 years ago

Having a look into grakn/config there are settings for rpm and brew, nothing for deb.

in rpm, grakn-core-server.spec, the issue seems living too:

%files

/opt/grakn/ /var/lib/grakn/ %attr(777, root, root) /opt/grakn/core/server/services/cassandra/cassandra.yaml %attr(777, root, root) /var/lib/grakn/db/cassandra/ %attr(777, root, root) /var/lib/grakn/db/queue/

vmax commented 3 years ago

I believe this one is addressed by #3315; the recommended way for starting Grakn Core installed via APT will be sudo systemctl start grakn-core (available starting with release 2.0.3)

carltondaniel commented 2 years ago

How to install grakn 1.5.7 unable to find any source

lolski commented 2 years ago

Are you facing some issue @carltondaniel ?

First, I would suggest you download the latest distribution TypeDB 2.5.0 since Grakn 1.5.7 is very, very old.

If you're still facing an issue with the new one, please create a new issue instead of piggy-backing on this issue that has been closed.