(subparsers)
| 816 | |
| 817 | |
| 818 | def initialize_admin_subcommand(subparsers): |
| 819 | sub_parser = subparsers.add_parser("admin", help="""The storm admin command provides access to several operations that can help |
| 820 | an administrator debug or fix a cluster.""", formatter_class=SortingHelpFormatter) |
| 821 | sub_sub_parsers = sub_parser.add_subparsers() |
| 822 | |
| 823 | remove_sub_sub_parser = sub_sub_parsers.add_parser( |
| 824 | "remove_corrupt_topologies", help="""This command should be run on a nimbus node as |
| 825 | the same user nimbus runs as. It will go directly to zookeeper + blobstore |
| 826 | and find topologies that appear to be corrupted because of missing blobs. |
| 827 | It will kill those topologies.""", formatter_class=SortingHelpFormatter |
| 828 | ) |
| 829 | |
| 830 | add_common_options(remove_sub_sub_parser) |
| 831 | |
| 832 | zk_cli_parser = sub_sub_parsers.add_parser( |
| 833 | "zk_cli", help="""This command will launch a zookeeper cli pointing to the |
| 834 | storm zookeeper instance logged in as the nimbus user. It should be run on |
| 835 | a nimbus server as the user nimbus runs as.""", formatter_class=SortingHelpFormatter |
| 836 | ) |
| 837 | |
| 838 | zk_cli_parser.add_argument( |
| 839 | "-s", "--server", default=None, help="""Set the connection string to use, |
| 840 | defaults to storm connection string""" |
| 841 | ) |
| 842 | |
| 843 | zk_cli_parser.add_argument( |
| 844 | "-t", "--time-out", default=None, help="""Set the timeout in seconds to use, defaults to storm |
| 845 | zookeeper timeout.""", type=check_non_negative |
| 846 | ) |
| 847 | |
| 848 | zk_cli_parser.add_argument( |
| 849 | "-w", "--write", default=None, action="store_true", |
| 850 | help="""Allow for writes, defaults to read only, we don't want to |
| 851 | cause problems.""" |
| 852 | ) |
| 853 | |
| 854 | zk_cli_parser.add_argument( |
| 855 | "-n", "--no-root", default=None, action="store_true", |
| 856 | help="""Don't include the storm root on the default connection string.""" |
| 857 | ) |
| 858 | |
| 859 | zk_cli_parser.add_argument( |
| 860 | "-j", "--jaas", default=None, help="""Include a jaas file that should be used when |
| 861 | authenticating with ZK defaults to the |
| 862 | java.security.auth.login.config conf""" |
| 863 | ) |
| 864 | |
| 865 | add_common_options(zk_cli_parser) |
| 866 | |
| 867 | creds_parser = sub_sub_parsers.add_parser( |
| 868 | "creds", help="""Print the credential keys for a topology.""", formatter_class=SortingHelpFormatter |
| 869 | ) |
| 870 | |
| 871 | creds_parser.add_argument("topology_id") |
| 872 | add_common_options(creds_parser) |
| 873 | |
| 874 | sub_parser.set_defaults(func=admin) |
| 875 | add_common_options(sub_parser) |
no test coverage detected