Skip to content

Commit 4cf74fc

Browse files
dnskrtdcmeehan
authored andcommitted
Generalize the doc page explaining how to deploy Presto with Homebrew
1 parent a5256ab commit 4cf74fc

File tree

1 file changed

+35
-142
lines changed

1 file changed

+35
-142
lines changed
Lines changed: 35 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,60 @@
1-
=====================================
2-
Deploy Presto on a Mac using Homebrew
3-
=====================================
1+
============================
2+
Deploy Presto using Homebrew
3+
============================
44

5-
- If you are deploying Presto on an Intel Mac, see `Deploy Presto on an Intel Mac using Homebrew`_.
5+
This guide explains how to install and get started with Presto on macOS, Linux or WSL2 using the Homebrew package manager.
66

7-
- If you are deploying Presto on an Apple Silicon Mac that has an M1 or M2 chip, see `Deploy Presto on an Apple Silicon Mac using Homebrew`_.
7+
Prerequisites
8+
-------------
89

9-
Deploy Presto on an Intel Mac using Homebrew
10-
--------------------------------------------
11-
*Note*: These steps were developed and tested on Mac OS X on Intel. These steps will not work with Apple Silicon (M1 or M2) chips.
12-
13-
Following these steps, you will:
14-
15-
- install the Presto service and CLI on an Intel Mac using `Homebrew <https://formulae.brew.sh/formula/prestodb#default>`_
16-
- start and stop the Presto service
17-
- start the Presto CLI
10+
`Homebrew <https://brew.sh/>`_ installed.
1811

1912
Install Presto
20-
^^^^^^^^^^^^^^
13+
--------------
2114

22-
Follow these steps to install Presto on an Intel Mac using `Homebrew <https://formulae.brew.sh/formula/prestodb#default>`_.
15+
Run the following command to install the latest version of Presto using the `Homebrew Formulae <https://formulae.brew.sh/formula/prestodb>`_:
2316

24-
1. If you do not have brew installed, run the following command:
17+
.. code-block:: none
2518
26-
``/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"``
19+
brew install prestodb
2720
28-
2. To install Presto, run the following command:
21+
Homebrew installs packages in the ``Cellar`` directory, which can be found with this command:
2922

30-
``brew install prestodb``
23+
.. code-block:: none
3124
32-
Presto is installed in the directory */usr/local/Cellar/prestodb/<version>.*
25+
brew --cellar
3326
34-
The following files are created in the *libexec/etc* directory in the Presto install directory:
27+
The directory ``$(brew --cellar)/prestodb/<version>/libexec`` contains the Presto files used to run and configure the service.
28+
For example, the ``etc`` directory within the Presto installation contains the following default configuration files:
3529

3630
- node.properties
3731
- jvm.config
3832
- config.properties
3933
- log.properties
4034
- catalog/jmx.properties
4135

42-
For example, the full path to the node.properties file is */usr/local/Cellar/prestodb/<version>/libexec/etc/node.properties*.
43-
44-
The Presto CLI is installed in the *bin* directory of the Presto install directory: */usr/local/Cellar/prestodb/<version>/bin*.
45-
46-
The executables are added to */usr/local/bin* path and should be available as part of $PATH.
47-
4836
Start and Stop Presto
49-
^^^^^^^^^^^^^^^^^^^^^
37+
---------------------
5038

51-
To start Presto, use the ``presto-server`` helper script.
39+
Presto is installed with the ``presto-server`` helper script, which simplifies managing the cluster.
40+
For example, run the following command to start the Presto service in the foreground:
5241

53-
To start the Presto service in the background, run the following command:
54-
55-
``presto-server start``
42+
.. code-block:: none
5643
57-
To start the Presto service in the foreground, run the following command:
44+
presto-server run
5845
59-
``presto-server run``
46+
To stop Presto from running in the foreground, press ``Ctrl + C`` until the terminal prompt appears, or close the terminal.
6047

61-
To stop the Presto service in the background, run the following command:
48+
For more available commands and options, use help:
6249

63-
``presto-server stop``
50+
.. code-block:: none
6451
65-
To stop the Presto service in the foreground, close the terminal or select Ctrl + C until the terminal prompt is shown.
52+
presto-server --help
6653
6754
Open the Presto Console
68-
^^^^^^^^^^^^^^^^^^^^^^^
55+
-----------------------
6956

70-
After starting Presto, you can access the web UI at the default port ``8080`` using the following link in a browser:
57+
After starting the service, Presto Console can be accessible at the default port ``8080`` using the following link in a browser:
7158

7259
.. code-block:: none
7360
@@ -79,117 +66,23 @@ After starting Presto, you can access the web UI at the default port ``8080`` us
7966
For more information about the Presto Console, see :doc:`/clients/presto-console`.
8067

8168
Start the Presto CLI
82-
^^^^^^^^^^^^^^^^^^^^
69+
--------------------
8370

8471
The Presto CLI is a terminal-based interactive shell for running queries, and is a
8572
`self-executing <http://skife.org/java/unix/2011/06/20/really_executable_jars.html>`_
8673
JAR file that acts like a normal UNIX executable.
8774

88-
The Presto CLI is installed in the *bin* directory of the Presto install directory: */usr/local/Cellar/prestodb/<version>/bin*.
89-
90-
To run the Presto CLI, run the following command:
91-
92-
``presto``
93-
94-
The Presto CLI starts and displays the prompt ``presto>``.
95-
96-
For more information, see :doc:`/clients/presto-cli`.
97-
98-
Deploy Presto on an Apple Silicon Mac using Homebrew
99-
----------------------------------------------------
100-
*Note*: These steps were developed and tested on Mac OS X on Apple Silicon. These steps will not work with Intel chips.
101-
102-
Following these steps, you will:
103-
104-
- install the Presto service and CLI on an Apple Silicon Mac using `Homebrew <https://formulae.brew.sh/formula/prestodb#default>`_
105-
- start and stop the Presto service
106-
- start the Presto CLI
107-
108-
Install Presto
109-
^^^^^^^^^^^^^^
110-
111-
Follow these steps to install Presto on an Apple Silicon Mac using `Homebrew <https://formulae.brew.sh/formula/prestodb#default>`_.
112-
113-
1. If you do not have brew installed, run the following command:
114-
115-
``arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"``
116-
117-
This installs Homebrew into ``/usr/local/bin``.
118-
119-
*Note*: The default installation of Homebrew on Apple Silicon is to ``/opt/homebrew``.
120-
121-
2. To allow the shell to look for Homebrew in ``/usr/local/bin`` before it looks for Homebrew in ``/opt/homebrew``, run the following command:
122-
123-
``export PATH=/usr/local/bin:$PATH``
124-
125-
3. To install Presto, run the following command:
126-
127-
``arch -x86_64 brew install prestodb``
128-
129-
Presto is installed in the directory */usr/local/Cellar/prestodb/<version>.* The executables ``presto``
130-
and ``presto-server`` are installed in ``/usr/local/bin/``.
131-
132-
The following files are created in the *libexec/etc* directory in the Presto install directory:
133-
134-
- node.properties
135-
- jvm.config
136-
- config.properties
137-
- log.properties
138-
- catalog/jmx.properties
139-
140-
For example, the full path to the node.properties file is */usr/local/Cellar/prestodb/<version>/libexec/etc/node.properties*.
141-
142-
The Presto CLI is installed in the *bin* directory of the Presto install directory: */usr/local/Cellar/prestodb/<version>/bin*.
143-
144-
The executables are added to */usr/local/bin* path and should be available as part of $PATH.
145-
146-
Start and Stop Presto
147-
^^^^^^^^^^^^^^^^^^^^^
148-
149-
To start Presto, use the ``presto-server`` helper script.
150-
151-
To start the Presto service in the background, run the following command:
152-
153-
``arch -x86_64 presto-server start``
154-
155-
To start the Presto service in the foreground, run the following command:
156-
157-
``arch -x86_64 presto-server run``
158-
159-
To stop the Presto service in the background, run the following command:
160-
161-
``presto-server stop``
162-
163-
To stop the Presto service in the foreground, close the terminal or select Ctrl + C until the terminal prompt is shown.
164-
165-
Open the Presto Console
166-
^^^^^^^^^^^^^^^^^^^^^^^
167-
168-
After starting Presto, you can access the web UI at the default port ``8080`` using the following link in a browser:
75+
The Presto CLI is installed in the directory ``$(brew --cellar)/prestodb/<version>/bin``.
76+
To run the Presto CLI, use the following command:
16977

17078
.. code-block:: none
17179
172-
http://localhost:8080
173-
174-
.. figure:: ../images/presto_console.png
175-
:align: center
176-
177-
For more information about the Presto Console, see :doc:`/clients/presto-console`.
178-
179-
Start the Presto CLI
180-
^^^^^^^^^^^^^^^^^^^^
181-
182-
The Presto CLI is a terminal-based interactive shell for running queries, and is a
183-
`self-executing <http://skife.org/java/unix/2011/06/20/really_executable_jars.html>`_
184-
JAR file that acts like a normal UNIX executable.
185-
186-
The Presto CLI is installed in the *bin* directory of the Presto install directory: */usr/local/Cellar/prestodb/<version>/bin*.
187-
The executable ``presto`` is installed in ``/usr/local/bin/``.
80+
presto
18881
189-
To run the Presto CLI, run the following command:
82+
The Presto CLI starts and displays its prompt:
19083

191-
``presto``
84+
.. code-block:: none
19285
193-
The Presto CLI starts and displays the prompt ``presto>``.
86+
presto>
19487
195-
For more information, see :doc:`/clients/presto-cli`.
88+
For more information, see :doc:`/clients/presto-cli`.

0 commit comments

Comments
 (0)