Jelajahi Sumber

HUE-8888 [docker] Default to sqlite for booting out of the box

Romain 6 tahun lalu
induk
melakukan
e05f890287
2 mengubah file dengan 51 tambahan dan 53 penghapusan
  1. 45 47
      tools/docker/hue/README.md
  2. 6 6
      tools/docker/hue/conf/hue-overrides.ini

+ 45 - 47
tools/docker/hue/README.md

@@ -1,59 +1,61 @@
 # Hue Server
 
+## Run the image
 
-## Get the docker image
-
-Just pull the latest from the Internet or build it yourself from the Hue repository via the [Dockerfile](Dockerfile).
+Hue can run in one line via the `docker` command (but needs to be configured to point to a traditional database instead of Sqlite). To have a zero configuration start use [kubernetes](tools/kubernetes/) instead.
 
+### Docker
 
-### Pull the image from Docker Hub
+Directly boot the image:
 
 ```
-sudo docker pull gethue/hue:latest
+docker run -it -p 8888:8888 gethue/hue:latest
 ```
 
-### Build the image
+Hue should then be up and running on your default Docker IP on the port 8888, so usually [http://127.0.0.1:8888](http://127.0.0.1:8888).
 
-Directly from Github source:
+### Docker Compose
 
-```
-sudo docker build https://github.com/cloudera/hue.git#master -t hue -f tools/docker/hue/Dockerfile
-```
+Docker compose allows to start all the required services in one command line.
 
-Or from a cloned local Hue:
+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:
 
 ```
-sudo docker build . -t hue -f tools/docker/hue/Dockerfile
+cd tools/docker/hue
 ```
 
-**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`
+Edit `conf/hue-overrides.ini` and ucomment the MySql section in `[[database]]`.
 
-**Tag and push the image to the container registry**
+Then:
 
 ```
-docker build . -t gethue/hue:latest
-docker push docker.io/gethue/hue:latest
+docker-compose up -d
 ```
 
+And to stop:
 
-## Run the image
-
-Hue can run in one line via the `docker` command (but needs to be configured to point to a real database). To have a zero configuration start use the `docker-compose` section or [kubernetes](tools/kubernetes/) instead.
-
-### Docker
-
-Directly boot the image:
+```
+docker-compose down
+```
 
+**Note**
+If http://127.0.0.1:8888 does not work, get the IP of the docker container with:
 ```
-docker run -it -p 8888:8888 gethue/hue:latest
+sudo docker ps
+CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                            NAMES
+4064b02b42c9        gethue/hue          "./startup.sh"      About a minute ago   Up About a minute   0.0.0.0:8888->8888/tcp   awesome_wiles
 ```
 
-Hue should then be up and running on your default Docker IP on the port 8888, so usually [http://127.0.0.1:8888](http://127.0.0.1:8888).
+```
+docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' 4064b02b42c9
+172.17.0.2
+```
 
+So in our case [http://172.17.0.2:8888](http://172.17.0.2:8888).
 
-#### Configuration
+### Configuration
 
 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.
@@ -125,41 +127,37 @@ 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
 
 
-### Docker Compose
+## Get the docker image
 
-Docker compose allows to start all the required services in one command line.
+Just pull the latest from the Internet or build it yourself from the Hue repository via the [Dockerfile](Dockerfile).
 
-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:
+### Pull the image from Docker Hub
 
 ```
-cd tools/docker/hue
+sudo docker pull gethue/hue:latest
 ```
 
-Then:
+### Build the image
+
+Directly from Github source:
 
 ```
-docker-compose up -d
+sudo docker build https://github.com/cloudera/hue.git#master -t hue -f tools/docker/hue/Dockerfile
 ```
 
-And to stop:
+Or from a cloned local Hue:
 
 ```
-docker-compose down
+sudo docker build . -t hue -f tools/docker/hue/Dockerfile
 ```
 
 **Note**
-If http://127.0.0.1:8888 does not work, get the IP of the docker container with:
-```
-sudo docker ps
-CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                            NAMES
-4064b02b42c9        gethue/hue          "./startup.sh"      About a minute ago   Up About a minute   0.0.0.0:8888->8888/tcp   awesome_wiles
-```
+
+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`
+
+**Push the image to the container registry**
 
 ```
-docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' 4064b02b42c9
-172.17.0.2
+docker push docker.io/gethue/hue:latest
 ```
-
-So in our case [http://172.17.0.2:8888](http://172.17.0.2:8888).

+ 6 - 6
tools/docker/hue/conf/hue-overrides.ini

@@ -40,12 +40,12 @@
     # password=hue
     # name=hue
 
-    engine=mysql
-    host=database
-    port=3306
-    user=root
-    password=secret
-    name=hue
+    # engine=mysql
+    # host=database
+    # port=3306
+    # user=root
+    # password=secret
+    # name=hue
 
 ###########################################################################
 # Settings to configure the snippets available in the Notebook