• 大小: 3.01MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-04
  • 语言: 其他
  • 标签: kerberos  

资源简介

kerberos安全认证demo,内含spark、oozie、mr、kafka、hive、hdfs、hbase等认证代码,并有对应开发文档等信息

资源截图

代码片段和文件信息

package com.gmcc.hdp.demo.base;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.log4j.Logger;

import java.util.Map;

/**
 * DemoConfiguration
 *
 * @author tobin
 * @since 2016-12-05
 */
public class DemoConfiguration extends Configuration {

    public static final Logger LOG = Logger.getLogger(DemoConfiguration.class);

    private static DemoConfiguration conf = null;

    public static DemoConfiguration getInstance() {
        if (conf == null) {
            synchronized (DemoConfiguration.class) {
                if (conf == null)
                    conf = new DemoConfiguration();
                conf.init(null);
            }
        }

        return conf;
    }

    private DemoConfiguration() {}

    protected void init(Configuration aConf) {
        // 可外部配置zk和各种参数
        this.addResource(“hbase-site.xml“);
        this.addResource(“core-site.xml“);
        this.addResource(“yarn-site.xml“);
        this.addResource(“hdfs-site.xml“);
        this.addResource(“mapred-site.xml“);

        String hadoopConfDir = System.getenv(“HADOOP_HOME“) + “/conf“;
        String hbaseConfDir = System.getenv(“Hbase_HOME“) + “/conf“;
        this.addResource(new Path(hbaseConfDir + “/hbase-site.xml“));
        this.addResource(new Path(hadoopConfDir + “/core-site.xml“));
        this.addResource(new Path(hadoopConfDir + “/yarn-site.xml“));
        this.addResource(new Path(hadoopConfDir + “/hdfs-site.xml“));
        this.addResource(new Path(hadoopConfDir + “/mapred-site.xml“));

        // copy配置
        if (aConf != null) {
            for (Map.Entry entry : aConf)
                this.set(entry.getKey() entry.getValue());
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-12-05 14:43  dt-gmcc-hdp-demo\
     文件        6148  2016-12-05 14:43  dt-gmcc-hdp-demo\.DS_Store
     目录           0  2016-12-05 14:48  __MACOSX\
     目录           0  2016-12-05 14:48  __MACOSX\dt-gmcc-hdp-demo\
     文件         120  2016-12-05 14:43  __MACOSX\dt-gmcc-hdp-demo\._.DS_Store
     文件        6759  2016-12-05 00:50  dt-gmcc-hdp-demo\pom.xml
     文件         226  2016-12-05 00:50  __MACOSX\dt-gmcc-hdp-demo\._pom.xml
     文件         562  2016-12-05 00:50  dt-gmcc-hdp-demo\README.md
     文件         226  2016-12-05 00:50  __MACOSX\dt-gmcc-hdp-demo\._README.md
     目录           0  2016-12-05 14:43  dt-gmcc-hdp-demo\src\
     文件        6148  2016-12-05 14:43  dt-gmcc-hdp-demo\src\.DS_Store
     目录           0  2016-12-05 14:48  __MACOSX\dt-gmcc-hdp-demo\src\
     文件         120  2016-12-05 14:43  __MACOSX\dt-gmcc-hdp-demo\src\._.DS_Store
     目录           0  2016-12-05 14:44  dt-gmcc-hdp-demo\src\main\
     文件        8196  2016-12-05 14:48  dt-gmcc-hdp-demo\src\main\.DS_Store
     目录           0  2016-12-05 14:48  __MACOSX\dt-gmcc-hdp-demo\src\main\
     文件         120  2016-12-05 14:48  __MACOSX\dt-gmcc-hdp-demo\src\main\._.DS_Store
     目录           0  2016-12-05 00:50  dt-gmcc-hdp-demo\src\main\bin\
     文件        2142  2016-12-05 00:50  dt-gmcc-hdp-demo\src\main\bin\check.sh
     目录           0  2016-12-05 14:48  __MACOSX\dt-gmcc-hdp-demo\src\main\bin\
     文件         226  2016-12-05 00:50  __MACOSX\dt-gmcc-hdp-demo\src\main\bin\._check.sh
     文件        3085  2016-12-05 00:50  dt-gmcc-hdp-demo\src\main\bin\checkKrb.sh
     文件         226  2016-12-05 00:50  __MACOSX\dt-gmcc-hdp-demo\src\main\bin\._checkKrb.sh
     文件        2879  2016-12-05 00:50  dt-gmcc-hdp-demo\src\main\bin\run.sh
     文件         226  2016-12-05 00:50  __MACOSX\dt-gmcc-hdp-demo\src\main\bin\._run.sh
     文件        5381  2016-12-05 00:50  dt-gmcc-hdp-demo\src\main\bin\runkrb.sh
     文件         226  2016-12-05 00:50  __MACOSX\dt-gmcc-hdp-demo\src\main\bin\._runkrb.sh
     文件         226  2016-12-05 00:50  __MACOSX\dt-gmcc-hdp-demo\src\main\._bin
     目录           0  2016-12-05 00:50  dt-gmcc-hdp-demo\src\main\config\
     文件         872  2016-12-05 00:50  dt-gmcc-hdp-demo\src\main\config\hdp.properties
     目录           0  2016-12-05 14:48  __MACOSX\dt-gmcc-hdp-demo\src\main\config\
............此处省略138个文件信息

评论

共有 条评论