Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Spark stdout log is garbled.

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

There is no garbled code when using the Apache version of spark1.2.1, but in the spark-1.1.0-cdh6.2.1 version, when printing and debug the data in the distributed processing map function

Val rs = rdd.filter (e = > {val (lable,text) = (e.yog2 (2), e.room2 (3); m.filterItem (lable,text)}) .reduceByKey ((XMague y) = > m.merge (xMague y)) .map {case (xMague y) = > {println (x + "\ t" + y); (x._1.toLong, x.yog2, y (1), y (3))}}

Found that the Chinese content in the stdout file is garbled

(5pm?) List, http://xinligs.cn.china.cn/, A0, (11)? (11), false. 4, 7)? 17,?

View the stdout file in the corresponding app-20150605171809-0003 in the / var/run/spark/work/ directory

Stderr: ASCII C++ program textstdout: UTF-8 Unicode text, with very long lines

Stdout is encoded by ASCII, so it can't be displayed in Chinese.

When using service to start the Java program, the log output of stdout in hadoop on the machine is also garbled in Chinese.

Modify / sbin/service by adding LANG= "$LANG" after env-I

Restart each node of spark

Service spark-master restartservice spark-worker restart

Finally, the log shows normal in Chinese.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report