Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running without root #4454

Closed
JaheimLee opened this issue Jul 22, 2022 · 2 comments
Closed

Running without root #4454

JaheimLee opened this issue Jul 22, 2022 · 2 comments

Comments

@JaheimLee
Copy link

I saw many sudo commands in your doc. Can I use it without root permission?

@JaheimLee JaheimLee changed the title Runing without root Running without root Jul 22, 2022
@wey-gu
Copy link
Contributor

wey-gu commented Jul 22, 2022

It could be done so, and i just tested it's working fine:

wget https://oss-cdn.nebula-graph.io/package/3.2.0/nebula-graph-3.2.0.ubuntu1804.amd64.deb
mkdir nebula_non_root
sudo dpkg -i --instdir=$PWD/nebula_non_root/ nebula-graph-3.2.0.ubuntu1804.amd64.deb

cd nebula_non_root/
# although here you have to change its owner, which was created as root:root by default :)
# I am running on a azure VM, it's user and group are both azureuser, you should change to yours accordingly.
sudo chown azureuser:azureuser -R .

cp usr/local/nebula/etc/nebula-metad.conf.default usr/local/nebula/etc/nebula-metad.conf
cp usr/local/nebula/etc/nebula-graphd.conf.default usr/local/nebula/etc/nebula-graphd.conf
cp usr/local/nebula/etc/nebula-storaged.conf.default usr/local/nebula/etc/nebula-storaged.conf

usr/local/nebula/scripts/nebula.service start metad
usr/local/nebula/scripts/nebula.service start graphd
usr/local/nebula/scripts/nebula.service start storaged

Verify it with console:

wget https://github.com/vesoft-inc/nebula-console/releases/download/v3.2.0/nebula-console-linux-amd64-v3.2.0

chmod +x nebula-console-linux-amd64-v3.2.0

./nebula-console-linux-amd64-v3.2.0 -addr localhost -port 9669 -user root -p nebula

ADD HOSTS for storaged:

show hosts
add hosts 127.0.0.1:9779
show hosts

It looks like:

./nebula-console-linux-amd64-v3.2.0 -addr localhost -port 9669 -user root -p nebula

Welcome to Nebula Graph!

(root@nebula) [(none)]> show hosts
+------+------+-----------+--------+--------------+---------------------+------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
+------+------+-----------+--------+--------------+---------------------+------------------------+---------+
+------+------+-----------+--------+--------------+---------------------+------------------------+---------+
Empty set (time spent 890/1763 us)

Fri, 22 Jul 2022 07:55:37 UTC

(root@nebula) [(none)]> add hosts 127.0.0.1:9779
Execution succeeded (time spent 1214/1617 us)

Fri, 22 Jul 2022 07:55:53 UTC

(root@nebula) [(none)]> show hosts
+-------------+------+-----------+-----------+--------------+----------------------+------------------------+---------+
| Host        | Port | HTTP port | Status    | Leader count | Leader distribution  | Partition distribution | Version |
+-------------+------+-----------+-----------+--------------+----------------------+------------------------+---------+
| "127.0.0.1" | 9779 | 19669     | "OFFLINE" | 0            | "No valid partition" | "No valid partition"   |         |
+-------------+------+-----------+-----------+--------------+----------------------+------------------------+---------+
Got 1 rows (time spent 832/1508 us)

Fri, 22 Jul 2022 07:55:56 UTC

(root@nebula) [(none)]> show hosts
+-------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| Host        | Port | HTTP port | Status   | Leader count | Leader distribution  | Partition distribution | Version |
+-------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| "127.0.0.1" | 9779 | 19669     | "ONLINE" | 0            | "No valid partition" | "No valid partition"   | "3.2.0" |
+-------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
Got 1 rows (time spent 877/1407 us)

Fri, 22 Jul 2022 07:56:03 UTC

Then you could load the basketballplayer data set in console:

:play basketballplayer

It takes you about 1 min to finish:

$ ./nebula-console-linux-amd64-v3.2.0 -addr localhost -port 9669 -user root -p nebula

Welcome to Nebula Graph!

(root@nebula) [(none)]> :play basketballplayer
Start loading dataset basketballplayer...

@JaheimLee
Copy link
Author

Thanks a lot! I'll have a try using your tar.gz file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants