Przeglądaj źródła

HUE-9453 [docs] Refresh the docker How To

Romain 5 lat temu
rodzic
commit
cdbc212ae3
1 zmienionych plików z 42 dodań i 14 usunięć
  1. 42 14
      tools/docker/hue/README.md

+ 42 - 14
tools/docker/hue/README.md

@@ -53,6 +53,8 @@ So in our case [http://172.17.0.2:8888](http://172.17.0.2:8888).
 
 ### Configuration
 
+#### Via local file
+
 By default the Hue container is using
 [``tools/docker/hue/conf/hue-overrides.ini``](/tools/docker/hue/conf/hue-overrides.ini) on top of [``desktop/conf/hue.ini``](/desktop/conf/hue.ini) which assumes localhost for all the data services and uses and embedded sqlite database that will error out.
 
@@ -62,16 +64,50 @@ Just curl it:
 
     wget https://raw.githubusercontent.com/cloudera/hue/master/tools/docker/hue/conf/hue-overrides.ini -O hue.ini
 
- OR get is via the repository:
+ Or get is via the repository:
 
     cd tools/docker/hue
     cp conf/hue-overrides.ini hue.ini
 
+#### Via the Image
+
+Let's pull and start the latest Hue container and open a shell inside it:
+
+    docker run -it -p 8888:8888 gethue/hue:latest /bin/bash
+
+This puts us into the `/usr/share/hue` home folder of the Hue installation. Now let's open the configuration file:
+
+    apt-get install -y vim
+
+    vim desktop/conf/hue.ini
+
+First let's make sure that Hue is backed by a relational database supporting transactions like MySQL, PostgreSql or Oracle. Here we go with MySQL and fill-up the `[[database]]` section with the credentials:
+
+    [desktop]
+    [[database]]
+    host=demo.gethue.com  # Use 127.0.0.1 and not localhost if on the same host
+    engine=mysql
+    user=hue
+    password=password
+    name=hue
+
+Now from another terminal use `docker ps` to identify the Hue container id and commit its state to remember the configuration even after stopping it:
+
+    docker ps
+
+    docker commit 368f0d568a5f hue-hive
+
+Now you can start the saved container which will expose the Hue interface on [localhost:8888](localhost:8888).
+
+    docker run -it -p 8888:8888 hue-hive ./startup.sh
+
 #### Hue's Database
 
+ Hue needs an existing database with transactions like MySQL to support concurrent requests and also not lose the registered users, saved queries, sharing permissions... when the server gets stopped.
+
 Edit the database settings in `hue.ini` for one of these two databases. Do not forget to create a 'hue' database too.
 
-Postgres
+PostGreSql
 
     [desktop]
     [[database]]
@@ -93,23 +129,18 @@ MySql
     password=secret
     name=hue
 
-#### Querying Databases
+#### Querying a Data Warehouse
 
 To be able to query a database, update the connector interpreters accordingly, e.g.:
 
-
     [notebook]
-    # One entry for each type of snippet.
     [[interpreters]]
-    # Define the name and how to connect and execute the language.
-    # https://docs.gethue.com/administrator/configuration/editor/
-
     [[[mysql]]]
     name = MySQL
     interface=sqlalchemy
-    ## https://docs.sqlalchemy.org/en/latest/dialects/mysql.html
-    options='{"url": "mysql://root:secret@database:3306/hue"}'
+    options='{"url": "mysql://root:secret@database-host:3306/hue"}'
 
+If you are looking another warehouse than Hive, check out all the [other connectors](https://docs.gethue.com/administrator/configuration/connectors/).
 
 Then start the Hue server:
 
@@ -121,12 +152,10 @@ If for example the database is pointing to your localhost, if using Docker on Li
 
     sudo docker run -it -p 8888:8888 -v $PWD/desktop/conf/pseudo-distributed.ini:/usr/share/hue/desktop/conf/z-hue.ini --network="host" gethue/hue
 
-
 ## Get the docker image
 
 Just pull the latest from the Internet or build it yourself from the Hue repository via the [Dockerfile](Dockerfile).
 
-
 ### Pull the image from Docker Hub
 
     docker pull gethue/hue:latest
@@ -137,14 +166,13 @@ Directly from Github source:
 
     docker build https://github.com/cloudera/hue.git#master -t hue -f tools/docker/hue/Dockerfile
 
-
 Or from a cloned local Hue:
 
     docker build . -t hue -f tools/docker/hue/Dockerfile
 
 **Note**
 
-Feel free to replace `-t hue` in all the commands by your own docker repository and image tag, e.g. `gethue/hue:latest`, `docker-account/hue:4.5.0`
+Feel free to replace `-t hue` in all the commands by your own docker repository and image tag, e.g. `gethue/hue:latest`, `docker-account/hue:4.8.0`
 
 **Push the image to the container registry**