<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Lbg_007的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Lbg_007</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Lbg_007]]></copyright><item><title><![CDATA[kafka 内网外网映射问题]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/134238743</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/134238743</guid><author>Lbg_007</author><pubDate>Mon, 06 Nov 2023 09:03:07 +0800</pubDate><description><![CDATA[原因：kafka 返回的是 listeners=PLAINTEXT://192.168.1.10:9092 的地址，外部公司访问不到公司内部的地址。解决方案： listeners 配置一个域名，外部公司的系统的服务器配置该域名到公网的映射规则，另外公网映射的时候，端口也要一致，不然有问题。背景：公司内部 kafka 要与外部单位的系统通过公网联调，公司运维做了映射后网络还是不通。]]></description><category></category></item><item><title><![CDATA[GP一个节点挂了，gpadmin用户免密失效导致]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/132097586</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/132097586</guid><author>Lbg_007</author><pubDate>Fri, 04 Aug 2023 10:03:06 +0800</pubDate><description><![CDATA[gprecoverseg -i ./recov 恢复的时候报错，报 ssh 不到segment的节点。ssh-copy-id 报错 命令不存在，切回root账号执行 yum -y install。5、再次执行 ssh-copy-id 成功，继续参考最初的链接  ，恢复成功！执行 ssh-keygen -R "你的远程服务器ip地址"4、再次执行 ssh-copy-id 发现还是报错，参考。1、有个节点挂了，参考链接。]]></description><category></category></item><item><title><![CDATA[zookeeper 进程起来了，但是zkServer.sh status报错Error contacting service. It is probably not running]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/126584840</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/126584840</guid><author>Lbg_007</author><pubDate>Mon, 29 Aug 2022 14:50:24 +0800</pubDate><description><![CDATA[zkServer.sh status报错]]></description><category></category></item><item><title><![CDATA[linux python 版本从 python3 降为 python2]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/124979344</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/124979344</guid><author>Lbg_007</author><pubDate>Thu, 26 May 2022 10:16:08 +0800</pubDate><description><![CDATA[背景：公司服务器python版本默认为2.7，有一次安装了 anaconda 后把默认的python版本改为了 python3.7版本，后来因为一些原因要降为原来的 2.7版本，发现改了软链接到2.7后执行python -V 显示的还是 3.7版本。

解决：

1、查看环境变量 echo $PATH ，发现环境变量里 anaconda3/bin 在 path 的最前边





2、查看 ~/.bashrc 可以发现里边有将 anaconda 的环境变量配置到了 PATH



3、将~/.bashrc.]]></description><category></category></item><item><title><![CDATA[配置本地ntp服务器及ntp客户端]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/124979066</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/124979066</guid><author>Lbg_007</author><pubDate>Thu, 26 May 2022 10:00:58 +0800</pubDate><description><![CDATA[背景：公司的服务器不能访问外网，所以在服务器A部署了NTP服务器，其他服务器配置源NTP为服务器A

1、服务器A的 /etc/ntp.conf 做下边调整后重启ntp

1）添加配置

restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# 以自己作为时间源

server 127.127.1.0
fudge 127.127.1.0 stratum 1

2）注释配置

#server 0.centos.pool.ntp.org iburst
]]></description><category></category></item><item><title><![CDATA[使用SourceTree将本地项目推送至GitLab]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/123692093</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/123692093</guid><author>Lbg_007</author><pubDate>Wed, 23 Mar 2022 17:52:38 +0800</pubDate><description><![CDATA[背景：正常一般是先在 GitLab 上建好项目，然后再通过 SourceTree 克隆到本地。但有时候忘记了，直接在本地新建了项目，这个时候想把本地项目也放到 GitLab 上托管。

步骤：

1、在GitLab上新建一个项目，项目名称和本地项目保持一致，复制url

2、在 SourceTree 上

文件 -》克隆/新建-》Create

在浏览那里选择本地的项目，在弹框那里选择是，然后点击创建





3、创建完后，选择 仓库-》仓库设置

选择添加，然后输入第1步复制的url







4、]]></description><category></category></item><item><title><![CDATA[Ambari 2.7.4 安装 Flink-1.14.4]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/123579359</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/123579359</guid><author>Lbg_007</author><pubDate>Fri, 18 Mar 2022 17:31:33 +0800</pubDate><description><![CDATA[一、创建flink源1，安装 httpd 服务（随便一台服务器）
[root@node01~]# yum -y install httpd

[root@node01~]# service httpd restart

[root@node01 ~]# chkconfig httpd on
安装完成后，会生成 /var/www/html目录（相当于Tomcat的webapps目录）


2、下载下边两个包，并放到 /var/www/html/flink目录 (需要在 /var/www/html先建 f...]]></description><category></category></item><item><title><![CDATA[spark sql / dataframe 二次排序，多字段排序问题]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/123133725</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/123133725</guid><author>Lbg_007</author><pubDate>Fri, 25 Feb 2022 15:21:16 +0800</pubDate><description><![CDATA[问题：spark sql / dataframe 日常操作中经常需要全局二次排序或者说针对多个字段排序然后输出到一个文件中，直接使用 order by 达不到想要的结果，只是分区内有序。

解决：在sql中使用


distribute by A_字段 sort by A_字段，B_字段 

如果是dataframe，就先将dataframe注册为临时表，再使用sql




df.createOrReplaceTempView("temp_tb")
spark.sql("select * from tem]]></description><category></category></item><item><title><![CDATA[Windows 如何使用 netcat (杀毒软件删掉了nc.exe情况)]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/122702872</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/122702872</guid><author>Lbg_007</author><pubDate>Wed, 26 Jan 2022 15:29:45 +0800</pubDate><description><![CDATA[问题：windows 从netcat 1.11 for Win32/Win64 下载 netcat 后，杀毒软件删掉了 nc.exe

解决： 从Download the Free Nmap Security Scanner for Linux/Mac/Windows下载 nMap 并安装

1、

2、



安装后可以使用 ncat.exe












...]]></description><category></category></item><item><title><![CDATA[sparkStreaming yarn-cluster消费到了数据但没有处理]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/118091660</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/118091660</guid><author>Lbg_007</author><pubDate>Mon, 21 Jun 2021 17:55:57 +0800</pubDate><description><![CDATA[现象：sparkStreaming 作业 local[*] 可以正常消费到数据并处理，但提交到yarn-cluster后只消费到数据但没有处理，从 Streaming Statistics 可见只有消费到数据，但没有处理





原因: 提交命令时只配置了1个 container ，确切的说是1个 core ，该 core 被分配用于消费数据，没有core可以用来处理，通过executor界面可以看到

spark-submit --master yarn-cluster --num-executors.]]></description><category></category></item><item><title><![CDATA[Ambari 集群重启后，HDFS 报告警 NameNode Last Checkpoint]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/115064691</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/115064691</guid><author>Lbg_007</author><pubDate>Mon, 22 Mar 2021 09:59:40 +0800</pubDate><description><![CDATA[现象：

Ambari 集群重启后，HDFS 报告警 NameNode Last Checkpoint

解决：

在其中一台服务器依次执行下边三条命令（HDFS用户）

hdfs dfsadmin -safemode enter

hdfs dfsadmin -saveNamespace

hdfs dfsadmin -safemode leave


]]></description><category></category></item><item><title><![CDATA[Ambari 使用的 Mysql Gelera 集群的机器重启后，集群启动不了]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/115063365</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/115063365</guid><author>Lbg_007</author><pubDate>Mon, 22 Mar 2021 09:36:27 +0800</pubDate><description><![CDATA[现象：

Ambari 集群所在的服务器要下电，下电前忘记手动停止 Mysql Gelera 集群。

上电后，Ambari 启动失败，因为连接不到对应的 Mysql 。

发现 Mysql 集群未启动。

手动启动 Mysql 将其中一个节点的引导地址置空然后执行

systemctl start mysqld

没有反应，日志也无报错。

再次 reboot 该节点，reboot 完后，mysql 报错

It may not be safe to bootstrap the cluster fro..]]></description><category></category></item><item><title><![CDATA[Ambari Yarn ResourceManager 无法停止及启动]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/115007706</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/115007706</guid><author>Lbg_007</author><pubDate>Fri, 19 Mar 2021 15:45:39 +0800</pubDate><description><![CDATA[现象：

通过 Ambari 安装了 Yarn HA，一段时间后，Ambari报连接不上其中一个服务器的 ResourceManager 警告。

去该服务器上看，没有相关的 ResourceManager 进程。在Ambari界面重启，在停止阶段失败。直接启动也失败。

在该服务器通过命令yarn-daemon.sh start resourcemanager 启动后，警告消失。

但通过这种方法启动的 ResourceManager 跟在Ambari界面启动的不一样，导致Ambari接管有些问题：Ya.]]></description><category></category></item><item><title><![CDATA[spark sql 开窗函数加条件]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/114636254</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/114636254</guid><author>Lbg_007</author><pubDate>Wed, 10 Mar 2021 15:37:27 +0800</pubDate><description><![CDATA[需求：如下图 test.csv，dataframe 中每行都需要添加前边跟后边最近的的 SSSSSSS* 记录对应的值。



解决方案：

无法通过 lead, lag 等方法实现，因为开窗函数选定的数据框无法加上条件

思路 - 通过两次 Join 分别找到前后最近的 SSSSSS*记录，代码如下


var df = spark.read.option("header", "true").csv("C:\\Users\\XXX\\Desktop\\test.csv") // 读取文件
df = df.]]></description><category></category></item><item><title><![CDATA[linux 使用 arcpy]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/109802488</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/109802488</guid><author>Lbg_007</author><pubDate>Thu, 19 Nov 2020 10:16:18 +0800</pubDate><description><![CDATA[linux 要想使用 arcpy，需要先安装 arcigs server。安装arcigs server 需要 安装包和授权文件。（以104版本为例）

1，ArcGIS_for_Server_Linux_1041_151978.tar.gz

2，arcgis104.ecp

安装步骤：

1，yum install xorg-x11-server-Xvfb

2，创建用户组arcgis
groupadd arcgis

3，创建用户ags （安装不能用root用户）
useradd -g arcgis.]]></description><category></category></item><item><title><![CDATA[linux ssh 报错  WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/109612570</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/109612570</guid><author>Lbg_007</author><pubDate>Wed, 11 Nov 2020 09:48:27 +0800</pubDate><description><![CDATA[现象：

ssh 到其他服务器时报错：WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!



解决：

ssh-keygen -f "/root/.ssh/known_hosts" -R 192.168.X.X
]]></description><category></category></item><item><title><![CDATA[pyspark 写入csv 文件报错 org.apache.hadoop.io.nativeio.NativeIO$Windows.createFile。。。]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/108755336</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/108755336</guid><author>Lbg_007</author><pubDate>Wed, 23 Sep 2020 16:12:18 +0800</pubDate><description><![CDATA[现象：pyspark 写入windows本地csv文件报错后报错

org.apache.hadoop.io.nativeio.NativeIO$Windows.createFile。。。

解决：删除hadoop-common-2.6.0/bin 里的hadoop.dll
]]></description><category></category></item><item><title><![CDATA[pyspark 报错 TypeError: must be real number, not Column]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/107712011</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/107712011</guid><author>Lbg_007</author><pubDate>Fri, 31 Jul 2020 14:13:32 +0800</pubDate><description><![CDATA[现象：

pyspark 需要添加一列 distance（距离），distance 需要基于四列的值（原经度，原纬度，现经度，现纬度）计算得来。

def calculateS(lng1,lat1,lng2,lat2):
  lng1, lat1, lng2, lat2 = map(radians, [lng1, lat1, lng2, lat2])
  dlon=lng2-lng1
  dlat=lat2-lat1
  a=sin(dlat/2)**2 + cos(lat1) * cos...]]></description><category></category></item><item><title><![CDATA[idea 运行 scala 报错 object apache is not a member of package org]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/107640534</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/107640534</guid><author>Lbg_007</author><pubDate>Tue, 28 Jul 2020 17:10:47 +0800</pubDate><description><![CDATA[现象：

idea 运行scala项目报错object apache is not a member of package org



解决：




]]></description><category></category></item><item><title><![CDATA[sqoop 迁移 oracle 数据到 hive ，卡住 Connecting to jdbc:hive2://]]></title><link>https://blog.youkuaiyun.com/Lbg_007/article/details/107079009</link><guid>https://blog.youkuaiyun.com/Lbg_007/article/details/107079009</guid><author>Lbg_007</author><pubDate>Thu, 02 Jul 2020 10:29:53 +0800</pubDate><description><![CDATA[现象：

sqoop 迁移 oracle 数据到 hive ，卡在Connecting to jdbc:hive2://....



解决：

在 /etc/hive/conf 增加 beeline-hs2-connection.xml 内容如下：

&lt;?xml version="1.0"?&gt;
&lt;?xml-stylesheet type="text/xsl" href="configuration.xsl"?&gt;
&lt;configuration&gt;
&lt;propert..]]></description><category></category></item></channel></rss>