Skip to content

Commit

Permalink
HUE-8888 [docs] Refresh install README and update syncdb references
Browse files Browse the repository at this point in the history
  • Loading branch information
romainr committed Jan 4, 2020
1 parent 1724551 commit 0fc591b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 47 deletions.
4 changes: 2 additions & 2 deletions apps/useradmin/src/useradmin/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def has_hue_permission(self, action=None, app=None, perm=None):
try:
perm = self._lookup_permission(app, action)
except HuePermission.DoesNotExist:
LOG.exception("Permission object %s - %s not available. Was syncdb run after installation?" % (app, action))
LOG.exception("Permission object %s - %s not available. Was Django migrate command run after installation?" % (app, action))
return self.user.is_superuser
if self.user.is_superuser:
return True
Expand Down Expand Up @@ -249,7 +249,7 @@ def update_app_permissions(**kwargs):
We never delete permissions automatically, because apps might come and go.
Note that signing up to the "migrate" signal is not necessarily the best thing we can do, since some apps might not
have models, but nonetheless, "syncdb" is typically run when apps are installed.
have models, but nonetheless, "migrate" is typically run when apps are installed.
"""
created_tables = connection.introspection.table_names()
if u'useradmin_huepermission' in created_tables: # Check if Useradmin has been installed.
Expand Down
7 changes: 4 additions & 3 deletions desktop/core/src/desktop/lib/django_db_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
# limitations under the License.

"""
Utilities for django database operations.
Utilities for Django database operations.
"""

import logging
from django.contrib.contenttypes.models import ContentType


LOG = logging.getLogger(__name__)


def remove_content_type(app_label, model_name):
"""
Delete from the Django ContentType table, as applications delete
Expand All @@ -34,8 +36,7 @@ def remove_content_type(app_label, model_name):
be prompted with a question as they run syncdb.
"""
try:
ct = ContentType.objects.get(app_label=app_label,
model=model_name.lower())
ct = ContentType.objects.get(app_label=app_label, model=model_name.lower())
ct.delete()
except ContentType.DoesNotExist:
pass
2 changes: 1 addition & 1 deletion desktop/core/src/desktop/lib/django_test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def configure_django_for_test():
def create_tables(model):
""" Create all tables for the given model.
This is a subset of django.core.management.commands.syncdb
This is a subset of django.core.management.commands.migrate
"""
from django.db import connection
from django.db.models import Model
Expand Down
61 changes: 29 additions & 32 deletions dist/README
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
=========================================
Hue - Data-warehouse Editor
=========================================
==============================
Hue - DataWarehouse SQL Editor
==============================

Instructions to install the tarball release of Hue are available
in the manual from http://gethue.com.
Instructions to install the tarball release of Hue are available in the manual https://docs.gethue.com/administrator/installation/.

If you're impatient, these are the key steps. Please check the full manual
for more details.
If you're impatient, these are the key steps. Please check the full manual for more details and browse https://gethue.com.


Install
-------
## Install in any directory, e.g. /home/hue, /usr/share, /home/my_user
PREFIX=/usr/share make install

## If you don't have the permissions, you will need to 'sudo' the command and
## make sure that the 'hue' user has write access to the 'logs' directory and 'desktop/desktop.db'.
## e.g. sudo chown -R hue:hue /usr/local/hue
## Install in any directory, e.g. /home/hue, /usr/share, /home/my_user
PREFIX=/usr/share make install

## Run!
${PREFIX}/hue/build/env/bin/supervisor
## If you don't have the permissions, you will need to 'sudo' the command and
## make sure that the 'hue' user has write access to the 'logs' directory and 'desktop/desktop.db'.
## e.g. sudo chown -R hue:hue /usr/local/hue

## Run!
${PREFIX}/hue/build/env/bin/supervisor


Upgrade
-------
Stop the current Hue and do a database backup.
Install the new Hue to replace the old one and run the database migrations:

./build/env/bin/hue syncdb
./build/env/bin/hue migrate
# Stop the current Hue and do a database backup.
# Install the new Hue to replace the old one and run the database migrations:

./build/env/bin/hue migrate


Configure Hue
-------------

Point to other services: https://docs.gethue.com/administrator/configuration/


Configure Hadoop
Expand All @@ -37,23 +42,15 @@ Configure Hadoop
## Configure HDFS
Edit hdfs-site.xml:

<property>
<name>dfs.webhdfs.enable</name>
<value>true</value>
</property>


Configure Hue
-------------

Point to other services: http://gethue.com/how-to-configure-hue-in-your-hadoop-cluster/
<property>
<name>dfs.webhdfs.enable</name>
<value>true</value>
</property>


Problems?
---------

Search or ask questions on the forum and http://groups.google.com/a/cloudera.org/group/hue-user

Some packages might be required during the 'make install': https://github.com/cloudera/hue#development-prerequisites)
Search or ask questions on the forum https://discourse.gethue.com/

Download a pre-built packaged version (apt-get/yum install...) of Hue on http://gethue.com
Some packages might be required during the 'make install': https://docs.gethue.com/administrator/installation/dependencies/
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,11 @@ To configure Hue to store data in MySQL:
name=hue
</pre>

5. As the Hue user, configure Hue to load the existing data and create the
necessary database tables:
5. As the Hue user, configure Hue to load the existing data and create the database tables:

<pre>
/usr/share/hue/build/env/bin/hue syncdb --noinput
/usr/share/hue/build/env/bin/hue migrate
mysql -uhue -psecretpassword -e "DELETE FROM hue.django_content_type;"
/usr/share/hue/build/env/bin/hue loaddata $temporary-file-containing-dumped-data.json
</pre>

Your system is now configured and you can start the Hue server as normal.

Expand Down
4 changes: 1 addition & 3 deletions docs/docs-site/content/developer/development/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,8 @@ for regenerating the code from the interfaces.

### Upgrades

After upgrading the version of Hue, running these two commands will make sure the
database has the correct tables and fields.
After upgrading the version of Hue, running these two commands will make sure the database has the correct tables and fields.

./build/env/bin/hue syncdb
./build/env/bin/hue migrate


Expand Down
1 change: 0 additions & 1 deletion tools/docker/hue/startup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh

./build/env/bin/hue syncdb --noinput
./build/env/bin/hue migrate
./build/env/bin/supervisor

0 comments on commit 0fc591b

Please sign in to comment.