Last active
December 10, 2018 23:48
-
-
Save dpeek/eaa9a612451987aaf7bd84e07494c0cb to your computer and use it in GitHub Desktop.
Install Go and Dgraph on AWS ubuntu AMI and run as service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install dgraph | |
sudo apt-get update -y | |
sudo apt-get install -y gcc | |
curl https://get.dgraph.io -sSf | bash | |
# create dgraph.service | |
sudo bash -c 'cat << EOF > /etc/systemd/system/dgraph.service | |
[Unit] | |
Description=dgraph | |
[Service] | |
ExecStart=/usr/local/bin/dgraph -w /home/ubuntu/dgraph/w -p /home/ubuntu/dgraph/p -bindall | |
Restart=always | |
User=ubuntu | |
[Install] | |
WantedBy=multi-user.target | |
EOF' | |
# enable and start dgraph service | |
sudo systemctl enable dgraph.service | |
sudo systemctl start dgraph.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment