Skip to content

Commit 996fcf3

Browse files
committed
Update presto-admin documentation
* Remove Presto version from presto-cli-installation docs * Clarify SSH requirements for presto-admin * Document adding a connector in the Quick Start Guide * Add Presto configuration to the Quick Start Guide * Add warning in Java 8 installation about RPM install * various grammatical edits * Move port configs docs after server install. * Add comma to presto-admin-configuration config.json specification The user should first run `presto-admin server install` before updating the port, so that the default values for the configs are already there.
1 parent 7fa9d1a commit 996fcf3

11 files changed

+112
-22
lines changed

docs/installation/java-installation.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ Prerequisites: :ref:`presto-admin-installation-label` and :ref:`presto-admin-con
77

88
The Oracle Java 1.8 JRE (64-bit), update 45 or higher, is a prerequisite for Presto. If a suitable 64-bit version of Oracle Java 8 is already installed on the cluster, you can skip this step.
99

10-
The ``presto-admin`` tool simplifies installing Java 8 on all nodes in the Presto cluster. To install the Oracle Java 1.8 (64-bit) RPM for Linux using ``presto-admin``, first download `Oracle Java 8 <http://java.com/en/download/linux_manual.jsp>`_ and copy it to a location accessible by ``presto-admin``. Next, run the following command to install Java 8 on each node in the Presto cluster.
10+
The simplest way to install Java 8 on all nodes in the Presto cluster is to use ``presto-admin``. To install the Oracle Java 1.8 (64-bit) RPM for Linux using ``presto-admin``, first download `Oracle Java 8 <http://java.com/en/download/linux_manual.jsp>`_ and copy it to a location accessible by ``presto-admin``. Next, run the following command to install Java 8 on each node in the Presto cluster.
1111
::
1212

1313
$ sudo ./presto-admin package install <local_path_to_java_rpm>
1414

15+
.. NOTE:: Using this method of installation will cause the default Java on your machine to be Java 8. If that is not desirable, you must download the tarball version of Java 8 and install it manually.
16+
1517
.. NOTE:: The ``server-install-label`` will look for your Oracle Java 1.8 installation at locations where Java is installed normally using the binary or the RPM based installer. Otherwise, you need to have an environment variable called ``JAVA8_HOME`` set with your Java 1.8 install path. If ``JAVA8_HOME`` is not set or is pointing to an incompatible version of Java, the installer will look for the ``JAVA_HOME`` environment variable for a compatible version of Java. If neither of these environmental variables is set with a compatible version, and ``presto-admin`` fails to find Java 8 at any of the normal install locations, then ``server install`` will fail. After successfully running ``server install`` you can find the Java being used by Presto at ``/etc/presto/env.sh``.
1618

1719
.. NOTE:: If installing Java on SLES, you may need to specify the ``--nodeps`` flag, so that the RPM is installed without checking or validating dependencies.

docs/installation/presto-admin-configuration.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ file should be owned by root with R/W permissions (i.e. 622).
2626
"username": "<ssh_user_name>",
2727
"port": "<ssh_port>",
2828
"coordinator": "<host_name>",
29-
"workers": ["<host_name_1>", "<host_name_2>", ... "<host_name_n>"]
29+
"workers": ["<host_name_1>", "<host_name_2>", ... "<host_name_n>"],
3030
"java8_home":"<path/to/java8/on/presto/nodes>"
3131
}
3232

@@ -43,7 +43,7 @@ be used:
4343

4444
Note that ``java8_home`` is not set by default. It only needs to be set if
4545
Java 8 is in a non-standard location on the Presto nodes. The property is used
46-
to tell the presto rpm where to find Java 8.
46+
to tell the Presto RPM where to find Java 8.
4747

4848
You can also specify some but not all of the properties. For example, the
4949
default configuration is for a single-node installation of Presto on the same

docs/installation/presto-admin-installation.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ Presto Admin Installation
99
To install ``presto-admin``, first copy the installer
1010
``prestoadmin-1.2-offline.tar.bz2`` to the location where you want
1111
``presto-admin`` to run. The recommended installation location is ``/opt``.
12-
Note that ``presto-admin`` does not have to be on same node(s) where Presto
13-
will run, though it does need to have SSH access to all of them. Next, extract
14-
and sudo run the installation script from within the ``prestoadmin`` directory.
12+
13+
14+
.. NOTE::
15+
``presto-admin`` does not have to be on the same node(s) where Presto will run,
16+
though it does need to have SSH access to all of the nodes in the cluster.
17+
18+
Next, extract and sudo run the installation script from within the ``prestoadmin`` directory.
1519
::
1620

1721
$ tar xvf prestoadmin-1.2-offline.tar.bz2

docs/installation/presto-cli-installation.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ Running Presto Queries
66

77
The Presto CLI provides a terminal-based interactive shell for running queries. The CLI is a self-executing JAR file, which means it acts like a normal UNIX executable.
88

9-
Download the `presto-cli` and copy it to the location you want to run it from. This location may be any node that has network access to the coordinator. Then rename it to presto and make it executable with chmod +x:
9+
Download the `presto-cli` and copy it to the location you want to run it from. This location may be any node that has network access to the coordinator. Then rename it to presto and make it executable with chmod +x, subsituting your version of Presto for "version":
1010
::
1111

12-
$ mv presto-cli-0.115-executable.jar presto
12+
$ mv presto-cli-<version>-executable.jar presto
1313
$ chmod +x presto
1414

1515
.. NOTE:: Presto must run with Java 8, so if Java 7 is the default on your cluster, you will need to explicitly specify the Java 8 executable. For example, ``<path_to_java_8_executable> -jar presto``. It may be helpful to add an alias for the Presto CLI: ``alias presto='<path_to_java_8_executable> -jar <path_to_presto>'``.
1616

17-
By default, ``presto-admin`` installs the TPC-H connector for you, which generates TPC-H data on-the-fly. Using this connector, issue the following commands to run your first Presto query:
17+
By default, ``presto-admin`` configures the TPC-H connector, which generates TPC-H data on-the-fly. Using this connector, issue the following commands to run your first Presto query:
1818
::
1919

2020
$ ./presto --catalog tpch --schema tiny
2121
$ select count(*) from lineitem;
2222

23-
For more on connectors, including how to connect to Hive, see :ref:`connector-add`.
2423

2524
The above command assumes that you installed the Presto CLI on the coordinator, and that the Presto server is on port 8080. If either of these are not the case, then specify the server location in the command:
2625
::
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
==================
3+
Configuring Presto
4+
==================
5+
6+
Presto has many configuration parameters that can be modified to
7+
tweak performance or add/remove features. While Presto should work decently well out-of-the-box,
8+
you still may need to make some changes.
9+
10+
For example, it is often necessary to change the default memory configuration
11+
based on your cluster's capacity. The default max memory for each Presto server is 16GB, but in
12+
an environment with less than 16GB available per node, you will have to adjust the settings
13+
to be lower. Similarly, if you have a lot of memory (say, 120GB/node), you may want to allocate more
14+
memory to Presto for better performance.
15+
16+
In the second case, in order to update the max memory value to 60GB per node,
17+
change the line in ``/etc/opt/prestoadmin/coordinator/jvm.config`` and
18+
``/etc/opt/prestoadmin/workers/jvm.config`` that says ``-Xmx16G`` to ``-Xmx60G``.
19+
20+
In addition, change the following lines in ``/etc/opt/prestoadmin/coordinator/config.properties``
21+
and ``/etc/opt/prestoadmin/workers/config.properties``: ::
22+
23+
query.max-memory-per-node=8GB
24+
query.max-memory=50GB
25+
26+
27+
to ::
28+
29+
query.max-memory-per-node=30GB
30+
query.max-memory=<30GB * number of nodes>
31+
32+
33+
We recommend setting ``query.max-memory-per-node`` to half of the JVM config max memory, though if your workload is highly concurrent, you may want
34+
to use a lower value for ``query.max-memory-per-node``.
35+
36+
To deploy this configuration change to the cluster, run the following command: ::
37+
38+
sudo ./presto-admin configuration deploy
39+
40+
41+
Then, restart the Presto servers so that the changes get picked up: ::
42+
43+
sudo ./presto-admin server restart
44+
45+
46+
For detailed documentation on ``configuration deploy``, see :ref:`configuration-deploy-label`.
47+
For more configuration parameters, see the Presto documentation.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
==================
3+
Adding a Connector
4+
==================
5+
6+
In Presto, connectors allow you to access different data sources -- e.g.,
7+
Hive, PostgreSQL, or MySQL.
8+
9+
To add the Hive connector, create a file ``hive.properties`` in ``/etc/opt/prestoadmin/connectors``.
10+
11+
For Cloudera CDH 5, it should have the following content: ::
12+
13+
connector.name=hive-cdh5
14+
hive.metastore.uri=thrift://<metastore-host-or-ip>:<metastore-port>
15+
16+
17+
For Hadoop 2.0+ (including HDP), it should have the following content: ::
18+
19+
connector.name=hive-hadoop2
20+
hive.metastore.uri=thrift://<metastore-host-or-ip>:<metastore-port>
21+
22+
23+
There are additional properties and possible configurations in the
24+
`Hive connector documentation <https://prestodb.io/docs/current/connector/hive.html>`_,
25+
for example if you have a HA Hadoop cluster.
26+
27+
After adding a connector configuration file, :ref:distribute <reference to connector add> it to all of the nodes in the cluster: ::
28+
29+
sudo ./presto-admin connector add hive
30+
31+
Once the new connector configuration has been distributed, :ref:restart <reference to server restart> Presto: ::
32+
33+
sudo ./presto-admin server restart
34+
35+
36+
For more on what connectors Presto supports, see the `Presto connector documentation <https://prestodb.io/docs/current/connector.html>`_.

docs/installation/presto-port-configuration.rst

+3-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Presto Port Configuration
55
=========================
66

7-
By default, Presto configuration uses 8080 for the HTTP port. If the port is already used on a given node on your cluster, that server will fail to start.
7+
By default, Presto uses 8080 for the HTTP port. If the port is already in use on any given node on your cluster, Presto will not start on that node(s).
88
You can check if that port is already in use on a node by running the following on that node:
99
::
1010

@@ -19,11 +19,5 @@ You can configure the server to use a different port by changing the following p
1919
http-server.http.port=<port>
2020
discovery.uri=http://<coordinator_ip_or_host>:<port>
2121

22-
You can add these properties with the new ``port`` to the file ``config.properties`` under each of the directories ``/etc/opt/prestoadmin/coordinator``
23-
and ``/etc/opt/prestoadmin/workers`` locally, prior to running :ref:`server-install-label`. You may need to create these two directories.
24-
If you have already installed Presto using :ref:`server-install-label` then you
25-
can reconfigure the cluster to use a new port by updating the ``config.properties`` at ``/etc/opt/prestoadmin/coordinator``
26-
and ``/etc/opt/prestoadmin/workers`` and then running :ref:`configuration-deploy-label`.
27-
28-
``presto-admin`` :ref:`server-start-label` and :ref:`server-restart-label` will check if the port configured for the server
29-
is already in use. If the port is in use on a node, then ``presto-admin`` will issue a warning and skip starting the server on that particular node.
22+
You can add these properties with the new ``port`` to ``/etc/opt/prestoadmin/coordinator/config.properties`` and
23+
``/etc/opt/prestoadmin/workers/config.properties``. Then, run :ref:`configuration-deploy-label`.

docs/installation/presto-server-installation.rst

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ First download the `presto-server-rpm-VERSION.ARCH.rpm` and copy it to a locatio
1111
$ sudo ./presto-admin server install <local_path_to_rpm>
1212

1313

14-
Presto! Presto is now installed on the coordinator and workers specified in your ``/etc/opt/prestoadmin/config.json`` file. Before you can issue your first query, you must start Presto:
14+
Presto! Presto is now installed on the coordinator and workers specified in your ``/etc/opt/prestoadmin/config.json`` file.
15+
16+
The default port for Presto is 8080. If that port is already in use on your cluster, you will not be able to start Presto.
17+
In order to change the port that Presto uses, and if necessary check what ports are in use, proceed to :ref:`presto-port-configuration-label`.
18+
19+
Now, you are ready to start Presto:
20+
1521
::
1622

1723
$ sudo ./presto-admin server start

docs/presto-admin-commands.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ once, you could run ::
249249
sudo ./presto-admin server restart
250250

251251
Adding a Custom Connector
252-
--------------------------
252+
-------------------------
253253
In order to install a custom connector not included with Presto, the jar must be
254254
added to the Presto plugin location using the ``plugin add_jar`` command before
255255
running the ``connector add`` command.

docs/quick-start-guide.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ For a detailed explanation of all of the commands and their options, see :ref:`c
1212
installation/presto-admin-installation
1313
installation/presto-admin-configuration
1414
installation/java-installation
15-
installation/presto-port-configuration
1615
installation/presto-server-installation
1716
installation/presto-cli-installation
17+
installation/presto-connector-installation
18+
installation/presto-configuration
1819
installation/troubleshooting-installation
1920

docs/user-guide.rst

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ A full explanation of the commands and features of ``presto-admin``.
1111

1212
quick-start-guide
1313
installation/advanced-installation-options
14+
installation/presto-port-configuration
1415
ssh-configuration
1516
presto-admin-commands
1617
presto-admin-cli-options

0 commit comments

Comments
 (0)