﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-bob-文章分类-spark</title><link>http://www.blogjava.net/keweibo/category/55302.html</link><description>&lt;script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- iteye 460 60 --&gt;
&lt;ins class="adsbygoogle"
     style="display:inline-block;width:468px;height:60px"
     data-ad-client="ca-pub-2876867208357149"
     data-ad-slot="0418982663"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
</description><language>zh-cn</language><lastBuildDate>Wed, 18 Apr 2018 19:47:39 GMT</lastBuildDate><pubDate>Wed, 18 Apr 2018 19:47:39 GMT</pubDate><ttl>60</ttl><item><title>spark中split()特殊符号"." "|" "*" "\" "]"</title><link>http://www.blogjava.net/keweibo/articles/433162.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Wed, 18 Apr 2018 03:15:00 GMT</pubDate><guid>http://www.blogjava.net/keweibo/articles/433162.html</guid><wfw:comment>http://www.blogjava.net/keweibo/comments/433162.html</wfw:comment><comments>http://www.blogjava.net/keweibo/articles/433162.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/keweibo/comments/commentRss/433162.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/keweibo/services/trackbacks/433162.html</trackback:ping><description><![CDATA[<p style="margin: 0px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #454545; line-height: 26px; text-align: justify; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, SimHei, Arial, SimSun; background-color: #ffffff; text-indent: 2em;">关于点的问题是用string.split("[.]") 解决。</p><p style="margin: 0px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #454545; line-height: 26px; text-align: justify; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, SimHei, Arial, SimSun; background-color: #ffffff; text-indent: 2em;">关于竖线的问题用 string.split("\\|")解决。</p><p style="margin: 0px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #454545; line-height: 26px; text-align: justify; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, SimHei, Arial, SimSun; background-color: #ffffff; text-indent: 2em;">关于星号的问题用 string.split("\\*")解决。</p><p style="margin: 0px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #454545; line-height: 26px; text-align: justify; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, SimHei, Arial, SimSun; background-color: #ffffff; text-indent: 2em;">关于斜线的问题用 sring.split("<a target="_blank" style="color: #4fa1db; outline: 0px; margin: 0px; padding: 0px; box-sizing: border-box; background: transparent;">\\\\</a>")解决。</p><p style="margin: 0px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #454545; line-height: 26px; text-align: justify; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, SimHei, Arial, SimSun; background-color: #ffffff; text-indent: 2em;">关于中括号的问题用 sring.split("<a target="_blank" style="color: #4fa1db; outline: 0px; margin: 0px; padding: 0px; box-sizing: border-box; background: transparent;">\\[\\</a>]")解决。<br /><br /><br /></p><img src ="http://www.blogjava.net/keweibo/aggbug/433162.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/keweibo/" target="_blank">Ke</a> 2018-04-18 11:15 <a href="http://www.blogjava.net/keweibo/articles/433162.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>windows下使用IDEA开发 spark SQL例子报IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI</title><link>http://www.blogjava.net/keweibo/articles/433116.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Wed, 21 Mar 2018 03:31:00 GMT</pubDate><guid>http://www.blogjava.net/keweibo/articles/433116.html</guid><wfw:comment>http://www.blogjava.net/keweibo/comments/433116.html</wfw:comment><comments>http://www.blogjava.net/keweibo/articles/433116.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/keweibo/comments/commentRss/433116.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/keweibo/services/trackbacks/433116.html</trackback:ping><description><![CDATA[<pre style="background-color: #c7edcc; font-family: 宋体; font-size: 10.5pt;"><span style="color:#808080;font-style:italic;"><br /></span><span style="color:#000080;font-weight:bold;">public class </span>FirstSparkSql {<br />    <span style="color:#000080;font-weight:bold;">public static void </span>main(String[] args) {<br /><br /><br />        String masterMode = <span style="color:#008000;font-weight:bold;">"local"</span><span style="color:#cc7832;">;</span><span style="color:#808080;font-style:italic;">//spark://master:7077<br /></span><span style="color:#cc7832;"><br /></span> SparkConf conf = <span style="color:#000080;font-weight:bold;">new </span>SparkConf()<span style="color:#cc7832;">;<br /></span> <span style="color:#808080;font-style:italic;">//conf.set("spark.executor.memory", "1024m");<br /></span> conf.setAppName(<span style="color:#008000;font-weight:bold;">"First Spark SQL"</span>)<span style="color:#cc7832;">;<br /></span> conf.setMaster(masterMode)<span style="color:#cc7832;">;<br /></span><span style="color: red; font-style: italic;">//解决异常：</span><span style="color: red;">IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI</span><span style="color:#808080;font-style:italic;"><br /></span><strong><span style="color: red;"> conf.set(</span><span style="color: red;">"spark.sql.warehouse.dir"</span><span style="color: red;">,</span><span style="color: red;">"D:</span><span style="color: red;">\\</span><span style="color: red;">temp_files"</span><span style="color: red;">)</span><span style="color: red;">;</span></strong><span style="color:#cc7832;"><br /></span><span style="color:#cc7832;"><br /></span> JavaSparkContext sc = <span style="color:#000080;font-weight:bold;">new </span>JavaSparkContext(conf)<span style="color:#cc7832;">;<br /></span> <span style="color:#cc7832;"><br /></span> SparkSession spark = SparkSession.<span style="font-style:italic;">builder</span>().config(conf).getOrCreate()<span style="color:#cc7832;">;<br /></span> Dataset&lt;Row&gt; df = spark.read().json(<span style="color:#008000;font-weight:bold;">"hdfs://master:9000/user/spark/input/persons.txt"</span>)<span style="color:#cc7832;">;<br /></span> df.show()<span style="color:#cc7832;">;<br /></span> sc.stop()<span style="color:#cc7832;">;<br /></span> }<br />}<br /></pre><img src ="http://www.blogjava.net/keweibo/aggbug/433116.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/keweibo/" target="_blank">Ke</a> 2018-03-21 11:31 <a href="http://www.blogjava.net/keweibo/articles/433116.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Spark错误：TaskSchedulerImpl: Initial job has not accepted any resources</title><link>http://www.blogjava.net/keweibo/articles/433095.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Mon, 12 Mar 2018 10:09:00 GMT</pubDate><guid>http://www.blogjava.net/keweibo/articles/433095.html</guid><wfw:comment>http://www.blogjava.net/keweibo/comments/433095.html</wfw:comment><comments>http://www.blogjava.net/keweibo/articles/433095.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/keweibo/comments/commentRss/433095.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/keweibo/services/trackbacks/433095.html</trackback:ping><description><![CDATA[<p style="margin: 0px 0px 16px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #4f4f4f; line-height: 26px; text-align: justify; word-wrap: break-word; word-break: normal; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; background-color: #ffffff;">在windows环境下使用Intellij idea远程执行spark程序时，遇到了以下问题：</p><blockquote style="box-sizing: border-box; margin: 0px 0px 24px; padding: 16px; border-left-width: 8px; border-left-color: #dddfe4; background-image: initial; background-color: #eef0f4; border-radius: 0px 5px 5px 0px; overflow: auto; word-wrap: normal; word-break: normal; color: #3f3f3f; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-size: 16px;"><p style="margin: 0px; padding: 0px; box-sizing: border-box; font-size: 14px; color: #999999; line-height: 22px; text-align: justify; word-wrap: break-word; word-break: normal;">Intellij控制台输出警告：WARN TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources</p></blockquote><p style="margin: 0px 0px 16px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #4f4f4f; line-height: 26px; text-align: justify; word-wrap: break-word; word-break: normal; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; background-color: #ffffff;">此时程序会一直loading，running，loading，running&#8230;的循环，并持续出现上面的警告。&nbsp;<br style="box-sizing: border-box;" />出现这个错误可能有几种原因：</p><ol style="box-sizing: border-box; margin: 0px 0px 24px; padding: 0px; color: #3f3f3f; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-size: 16px; background-color: #ffffff;"><li style="box-sizing: border-box; list-style-type: decimal; margin-left: 40px; margin-top: 8px;">host配置不正确</li><li style="box-sizing: border-box; list-style-type: decimal; margin-left: 40px; margin-top: 8px;">worker内存不足</li><li style="box-sizing: border-box; list-style-type: decimal; margin-left: 40px; margin-top: 8px;">相关端口号被占用</li></ol><p style="margin: 0px 0px 16px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #4f4f4f; line-height: 26px; text-align: justify; word-wrap: break-word; word-break: normal; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; background-color: #ffffff;">针对第二种原因，通过修改配置文件中worker和master使用内存资源的参数即可解决。&nbsp;<br style="box-sizing: border-box;" />针对第三种原因，可以查看占用端口的程序并将其关闭，或者重启spark集群。</p><p style="margin: 0px 0px 16px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #4f4f4f; line-height: 26px; text-align: justify; word-wrap: break-word; word-break: normal; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; background-color: #ffffff;">解决方法：&nbsp;</p><p style="margin: 0px 0px 16px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #4f4f4f; line-height: 26px; text-align: justify; word-wrap: break-word; word-break: normal; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; background-color: #ffffff;">1. 修改本机hosts文件，在修改第一行，添加自己的hostName，如：<br /><br />127.0.0.1 bob-PC</p><p style="margin: 0px 0px 16px; padding: 0px; box-sizing: border-box; font-size: 16px; color: #4f4f4f; line-height: 26px; text-align: justify; word-wrap: break-word; word-break: normal; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; background-color: #ffffff;">2.在spark集群的所有节点的hosts中添加本地提交任务的windows节点的ip和hostname，如：<br /><br />192.168.189.19 bob-PC<br /><br /><br /></p><img src ="http://www.blogjava.net/keweibo/aggbug/433095.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/keweibo/" target="_blank">Ke</a> 2018-03-12 18:09 <a href="http://www.blogjava.net/keweibo/articles/433095.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>