GithubHelp home page GithubHelp logo

hue_scripts's Introduction

Set of Hue scripts to help manage hue. While some of these are self contained, the most important

ones have library calls to the lib directory. You must download the entire git repo for these

to work. Also note, they all make use of Hue's configuration and the /proc directory. This

means these scripts MUST be run as ROOT.

git clone https://github.com/cmconner156/hue_scripts /opt/cloudera/hue_scripts cd /opt/cloudera/hue_scripts ./script_runner

#This shows the available scripts in [custom_scripts] section, the rest are normal hue commands.

[root@nightly516-1 hue_scripts]# ./script_runner Usage: script_runner subcommand [options] [args]

Options: -v VERBOSITY, --verbosity=VERBOSITY Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output --settings=SETTINGS The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used. --pythonpath=PYTHONPATH A directory to add to the Python path, e.g. "/home/djangoprojects/myproject". --traceback Raise on exception --version show program's version number and exit -h, --help show this help message and exit

Type 'script_runner help ' for help on a specific subcommand.

Available subcommands:

[auth] changepassword ....... [custom_commands] backend_test_curl change_owner_of_docs delete_user estimate_concurrent_users hue_desktop_document_cleanup list_groups promote_to_superuser remove_doc2_without_content_object remove_duplicate_user_preferences remove_orphaned_docs rename_duplicate_users run_hive_impala_query share_all_workflows ......

#Commands:

script_runner backend_test_curl

  • This will test all of the REST API backend services to make sure they are running. This includes HTTPFS, Resource Manager, Job History Server, Oozie, Solr. Then outputs the matching curl commands to test outside of Hue.

script_runner change_owner_of_docs --olduser cconner --newuser cconner1

  • This will change the owner of any documents owned by oldusuer to newuser.

script_runner delete_user --username cconner

  • This will delete the user specified by uusername.

script_runner estimate_concurrent_users --last1h

  • This will check the access logs and try to estimate the number of active users over the last hour or given timeframe.

script_runner list_groups

  • This will show all of the groups that exist in Hue.

script_runner promote_to_superuser --username cconner

  • This will promote a non superuser to superuser.

script_runner remove_doc2_without_content_object

  • This will remove bad doc2 objects that do not have the content object.

script_runner remove_duplicate_user_preferences

  • This will remove duplicate entries in the table desktop_userpreferences.

script_runner remove_orphaned_docs

  • This will remove broken docs that do not have an owner.

script_runner rename_duplicate_users

  • If you end up with duplicate usernames somehow, this will rename the most recently created one to prevent data loss, but fix errors.

script_runner run_hive_impala_query --impala --user cconner --query "select * from sample_07"

  • This will run a query againsit hive or impala using Hue code, but outside the Hue process. It will iimpersonate the specified user. This is good for determining if an issue is caused by Hue or the backend service.

script_runner share_all_workflows --owner cconner --sharegroups test1,test2 --permissioins read,write

  • This will share workflows from --owner to a comma separated list of shareusers or sharegroups and a list of permissionis specified by --permissions.

hue_download_watcher.sh

  • This script can be used to capture info surrounding downloads from Hue.

hue_clean_duplicate_permissions.sh

  • This script is old, but it would have cleaned up duplicate entries for HuePermission objects

extract_archive_in_hdfs.sh

  • Debug version of the same extraction script in Hue source.

hue_scripts's People

Contributors

cmconner156 avatar erickt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hue_scripts's Issues

Cleanup Can Be Stuck in Endless Loop

Here, the code runs as long as the list isn't empty. I had a weird scenario with a database setup where the SQL wasn't generating a DatabaseError, but it wasn't deleting the records either. Since the list was never getting smaller, the code was stuck in an endless loop.

I think it would be better to iterate through the list (instead of reloading the list for each loop) and then at the end print the number of items that still exist in the list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.