问题归总
monday-pro
这个作者很懒,什么都没留下…
展开
-
ClusterId read in ZooKeeper is null,java.net.UnknownHostException: unknown host: master
1、ZooKeeperRegistry.getClusterId --> ClusterId read in ZooKeeper is null解决办法:在设置HBaseConfiguration处添加以下配置configuration.set(“zookeeper.znode.parent”, “/hbase-unsecure”);2、java.net.UnknownHostException: unknown host: master按以上配置好后,发现还是有问题解决办法:在C原创 2021-05-17 16:49:21 · 362 阅读 · 0 评论 -
java 端口检测代码
方法一: public static boolean test1(String ip, int port) { try (Socket ignored = new Socket(ip, port)) { return true; } catch (Exception e) { return false; } }方法二:稍微优雅点 public static boolean isSock原创 2021-09-03 22:52:57 · 165 阅读 · 0 评论 -
Java返回Json文件
目录一、最终代码二、注意点1、使用Get请求2、Json文件名乱码问题3、没有以文件的形式下载一、最终代码 @GetMapping("/export/{identifier}") public void export(HttpServletResponse response, @PathVariable("identifier") String identifier) throws IOException { // 当需原创 2021-07-05 21:17:22 · 2022 阅读 · 0 评论