Skip to content

Instantly share code, notes, and snippets.

@roscopecoltran
Forked from dpeek/dgraph.sh
Created December 10, 2018 23:48
Show Gist options
  • Save roscopecoltran/fb0c145fefbba1586109b7c2604aca99 to your computer and use it in GitHub Desktop.
Save roscopecoltran/fb0c145fefbba1586109b7c2604aca99 to your computer and use it in GitHub Desktop.
Install Go and Dgraph on AWS ubuntu AMI and run as service
#!/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