-
Notifications
You must be signed in to change notification settings - Fork 58
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
Update docker instructions #295
Conversation
Here you go, @samay-sharma, give it a try. |
|
||
# Linux ONLY | ||
|
||
curl -L https://github.com/docker/compose/releases/download/1.11.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could alternately link to the instructions in https://github.com/docker/compose/releases/latest
This has the advantage of not hardcoding a docker-compose version, but the disadvantage of being harder to follow than our reproducing the command here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's super annoying that we have to ask users to add a repo to their box (to download Engine) only to turn around and ask them to curl some binary into their path.
docker/compose#2235 is a request to add docker-compose
to the repository. I have no clue why this isn't already the case, but dropping a reference here in order to register my displeasure with upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spinned up a linux box and tried these steps. I ran into two separate issues.
(1) These steps assume that I'm running as root
on my box. This isn't the case and the following instructions worked.
sudo curl -L https://github.com/docker/compose/releases/download/1.11.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
(2) Even after this, when I ran docker-compose -p citus up -d
, I saw the following error message.
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/json: dial unix /var/run/docker.sock: connect: permission denied
This was because I didn't run the Linux postinstall steps in here: https://docs.docker.com/engine/installation/linux/linux-postinstall/
|
||
**2. Start the Citus Cluster** | ||
|
||
Citus uses docker-compose to run and connect containers holding the database master node, workers, and a persistent data volume. To create a local cluster download our docker-compose configuration file and run it | ||
|
||
.. code-block:: bash | ||
|
||
wget https://raw.githubusercontent.com/citusdata/docker/master/docker-compose.yml | ||
curl -L https://raw.githubusercontent.com/citusdata/docker/master/docker-compose.yml > docker-compose.yml | ||
docker-compose -p citus up -d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After installing docker, I had to start docker before I was able to do docker-compose. Could we add a step to the instructions which tells users to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Come to think of it, when I tested on Ubuntu and CentOS the installer also started the daemon automatically. It's only the Mac installation that requires a start step. So I added a "Mac Only" step to the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super minor unrelated point for the note below (line 41).
If you have PostgreSQL running on your machine -> If you already have PostgreSQL running on your machine
|
||
open /Applications/Docker.app | ||
|
||
* (Linux only) On most platforms the previous step will install docker-compose as well as Docker, but on Linux you'll need to install docker-compose manually by downloading the binary and putting it in your path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small rewording.
On Linux, you need to manually install docker-compose (you can find the latest docker-compose version here). For this, you need to download the binary and put it in your path:
|
||
curl -sSL https://get.docker.com/ | sudo bash | ||
sudo usermod -aG docker $USER && exec su -l $USER | ||
sudo systemctl start docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my CentOS test Docker did not start automatically after non-root installation. Adding systemctrl start
fixed that, and also causes no harm in Ubuntu where the service was already started.
The systemctl
works for Linux distros that use systemd, which I think is recent versions of all major distros. @jasonmp85 does this seem like a good bet to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@begriffs -- I had three higher level questions.
- When I look at the "Single-Machine Cluster" menu, it looks different and more involved than installation steps for other platforms. Could we make this uniform? (preferably keep Docker steps as they were before)?
https://citus-doc-preview-pr-295.herokuapp.com/installation/development.html
-
How confident are we that curl, usermod, systemctl are going to reliably work across different Linux distros? -- don't know, just asking
-
I remember @jasonmp85 saying that the Docker installation steps didn't work on Windows. Do we know whether Docker runs on Windows or not? (If it doesn't work on Windows, happy to just nix the windows part.)
|
||
# Linux ONLY | ||
|
||
curl -L https://github.com/docker/compose/releases/download/1.11.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spinned up a linux box and tried these steps. I ran into two separate issues.
(1) These steps assume that I'm running as root
on my box. This isn't the case and the following instructions worked.
sudo curl -L https://github.com/docker/compose/releases/download/1.11.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
(2) Even after this, when I ran docker-compose -p citus up -d
, I saw the following error message.
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/json: dial unix /var/run/docker.sock: connect: permission denied
This was because I didn't run the Linux postinstall steps in here: https://docs.docker.com/engine/installation/linux/linux-postinstall/
.. code-block:: bash | ||
|
||
curl -sSL https://get.docker.com/ | sudo bash | ||
sudo usermod -aG docker $USER && exec su -l $USER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spinned up a Redhat instance on AWS and got stock at the exec su -l $USER
step.
This is because I have sudo
on AWS instances but not su
.
Waiting to test this on a few EC2 machines until the S3 outage (!) abates. |
@ozgune these instructions worked for me on Red Hat, Ubuntu and Debian on AWS. I was logged in as ec2-user, ubuntu, and admin for each system respectively (not root). The only thing that went wrong is that Debian on AWS did not come pre-bundled with curl and I had to install that. However I'm pretty confident that curl is a common enough tool that our users will either have it or know how to get it. |
This is also true of the Debian-based Docker images themselves. They're pretty barebones and don't include I don't think it's e.g. worth investigating |
The debian one was actually a community AMI. (ami-0343ae47) |
@begriffs -- Sounds good, let's 🚀 I had two side notes. First, we'll need to resolve a minor conflict with the tutorial changes before merging this. Second, I played around with a few AMIs and things looked good. On SUSE 11, I ran into the following issue. I think that's perfectly acceptable since Docker seems to only support SUSE 12+. The error message here was also pretty descriptive. JFYI: ec2-user@ip-10-203-133-221:~> curl -sSL https://get.docker.com/ | sudo bash Either your platform is not easily detectable, is not supported by this installer script (yet - PRs welcome! [hack/install.sh]), or does not yet have a package for Docker. Please visit the following URL for more detailed installation instructions: https://docs.docker.com/engine/installation/ |
Differs from mac enough now that I made subsections
CentOS did not auto-start it on install in my test
Fixes #292 (I will subsequently open a pull request to update the Citus readme as well).
Tested the Docker installation instructions under Ubuntu 16.04 and CentOS 7.3.