瀏覽代碼

HUE-8834 [docker] Improve instructions for getting started with compose

Romain 6 年之前
父節點
當前提交
43fb3c0954
共有 1 個文件被更改,包括 56 次插入3 次删除
  1. 56 3
      tools/docker/hue/README.md

+ 56 - 3
tools/docker/hue/README.md

@@ -58,10 +58,62 @@ By default the Hue container is using
 
 The default ini is used for configuration at the image build time (e.g. which apps to always disable or certain settings like [banner customization](http://gethue.com/add-a-top-banner-to-hue/)).
 
-In order to be useful, configure Hue at runtime to point to external services. The simplified ini [``hue-overrides.ini``](/tools/docker/hue/hue-overrides.ini) can be edited before starting Hue via:
+In order to be useful, configure Hue at runtime to point to external services. The simplified ini [``hue-overrides.ini``](/tools/docker/hue/conf/hue-overrides.ini) can be edited before starting Hue via:
 
 ```
-docker run -it -p 8888:8888 -v $PWD/tools/docker/hue/conf/hue-overrides.ini:/usr/share/hue/desktop/conf/z-hue.ini gethue/hue
+cd tools/docker/hue
+cp conf/hue-overrides.ini hue.ini
+```
+
+Edit the database settings in `hue.ini` for one of these two databases. Do not forget to create a 'hue' database too.
+
+Postgres
+
+```
+    [desktop]
+    [[database]]
+    engine=postgresql_psycopg2
+    host=127.0.0.1
+    port=5432
+    user=hue
+    password=hue
+    name=hue
+```
+
+MySql
+
+```
+    [desktop]
+    [[database]]
+    engine=mysql
+    host=127.0.0.1
+    port=3306
+    user=root
+    password=secret
+    name=hue
+```
+
+If you want to be able to query a database out of the box, update the connector accordingly or remove it all:
+
+```
+[notebook]
+
+  # One entry for each type of snippet.
+  [[interpreters]]
+    # Define the name and how to connect and execute the language.
+    # http://cloudera.github.io/hue/latest/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"}'
+```
+
+Then start the Hue server:
+
+```
+docker run -it -p 8888:8888 -v $PWD/hue.ini:/usr/share/hue/desktop/conf/z-hue.ini gethue/hue
 ```
 
 *Note*
@@ -73,13 +125,14 @@ If for example the database is pointing to your localhost, if using Docker on Li
 
 #### Docker Compose
 
+Docker compose allows to start all the required services in one command line.
+
 This will start a Hue server as well as a MySQL database by default. Only the MySQL interpreter is configured in [``tools/docker/hue/conf/hue-overrides.ini``](/tools/docker/hue/conf/hue-overrides.ini).
 
 Assuming we have a local ``hue.ini`` as shown in the previous section:
 
 ```
 cd tools/docker/hue
-cp conf/hue-overrides.ini hue.ini
 ```
 
 Then: