当前位置: 首页 > news >正文

阳江有哪些建站公司百度收录查询

阳江有哪些建站公司,百度收录查询,什么是互联网,永济市做网站Spark的本地安装配置&#xff1a; 我们用scala语言编写和操作spark&#xff0c;所以先要完成scala的环境配置 1、先完成Scala的环境搭建 下载Scala插件&#xff0c;创建一个Maven项目&#xff0c;导入Scala依赖和插件 scala依赖 <dependency><groupId>org.scal…

Spark的本地安装配置:

我们用scala语言编写和操作spark,所以先要完成scala的环境配置

1、先完成Scala的环境搭建

下载Scala插件,创建一个Maven项目,导入Scala依赖和插件

 scala依赖

<dependency><groupId>org.scala-lang</groupId><artifactId>scala-library</artifactId><version>2.11.12</version></dependency><dependency><groupId>org.scala-lang</groupId><artifactId>scala-compiler</artifactId><version>2.11.12</version></dependency><dependency><groupId>org.scala-lang</groupId><artifactId>scala-reflect</artifactId><version>2.11.12</version></dependency>

scala插件

<build><plugins><plugin><groupId>org.scala-tools</groupId><artifactId>maven-scala-plugin</artifactId><version>2.15.2</version><executions><execution><goals><goal>compile</goal><goal>testCompile</goal></goals></execution></executions></plugin></plugins></build>

2、导入spark-core依赖

<!--导入spark-core依赖--><dependency><groupId>org.apache.spark</groupId><artifactId>spark-core_2.11</artifactId><version>2.4.5</version></dependency>

3、使用spark-->(代码操作)

以下是用spark处理单词统计任务

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}object Demo1WordCount {def main(args: Array[String]): Unit = {//1、创建spark的执行环境val conf = new SparkConf()//设置运行模式conf.setMaster("local")conf.setAppName("wc")val sc = new SparkContext(conf)//2、读取数据//RDD:弹性的分布式数据集(相当于List)val linesRDD: RDD[String] = sc.textFile("data/lines.txt")//一行转换多行val wordsRDD: RDD[String] = linesRDD.flatMap(_.split(","))val kvRD: RDD[(String, Int)] = wordsRDD.map(word => (word, 1))//统计单词的数量val countRDD: RDD[(String, Int)] = kvRD.reduceByKey((x, y) => x + y)//保存结果countRDD.saveAsTextFile("data/word_count")}
}

搭建Spark独立集群:

## 1、独立集群> Spark自己搭建一个资源管理框架,不依赖yarn### 1、上传解压配置环境变量```shell
# 家业安装包
tar -xvf spark-3.1.3-bin-hadoop3.2.tgz -C /usr/local/soft
# 重命名解压目录
mv spark-3.1.3-bin-hadoop3.2/ spark-3.1.3# 配置环境变量
vim /etc/profileexport SPARK_HOME=/usr/local/soft/spark-3.1.3
export PATH=$PATH:$SPARK_HOME/binsource  /etc/profile
```### 2、修改配置文件```shell
# 1、修改spark-env.sh
cd /usr/local/soft/spark-3.1.3/conf/
mv spark-env.sh.template spark-env.sh
# 在spark-env.sh中增加配置
export HADOOP_CONF_DIR=/usr/local/soft/hadoop-3.1.1/etc/hadoop
export SPARK_MASTER_HOST=master
export SPARK_MASTER_PORT=7077
export SPARK_WORKER_CORES=2
export SPARK_WORKER_MEMORY=4G
export JAVA_HOME=/usr/local/soft/jdk1.8.0_171# 2、修改workers
mv workers.template workers# 增加配置
node1
node2# 3、同步到所有节点
cd /usr/local/soft/
scp -r spark-3.1.3/ node1:`pwd`
scp -r spark-3.1.3/ node2:`pwd`
```### 3、启动集群```shell
# 启动集群
cd /usr/local/soft/spark-3.1.3/sbin
./start-all.sh # spark webUI
http://master:8080
```### 4、提交任务```shell
# 进入样例代码所在的目录
/usr/local/soft/spark-3.1.3/examples/jars# 提交任务
spark-submit --master spark://master:7077 --class org.apache.spark.examples.SparkPi spark-examples_2.12-3.1.3.jar 100# 代码提交到集群运行方式
#1、注释local
#2、修改数据路径,改成HDFS的路径,输入输出目录都需要修改i
#3、将代码打包上传到服务器运行
# 提交任务
spark-submit --master spark://master:7077 --class com.company.core.Demo15Submit spark-1.0-SNAPSHOT.jar
```## 2、Spark on Yarn> yarn是一个分布式资源管理管家,负责管理集群的CPU和内存### 1、关闭独立集群```shell
# 进入spark脚本目录
cd /usr/local/soft/spark-3.1.3/sbin
./stop-all.sh
```### 2、启动hadoop```shell
start-all.sh
```### 3、提交任务```shell
# --num-executors 2: 指定Executor的数量
# --executor-cores 1 : 指定executor的核数
# --executor-memory 2G :指定executoe的内存# yarn client模式
# 1、会在本地打印详细的执行日志,可以看到全部执行错误日志
# 2、一般用于测试使用,如果大量的任务都使用client模式去提交,会导致本地节点压力大
# 3、client模式Driver、在本地启动,所以再本地可以看详细日志
spark-submit --master yarn --deploy-mode client --num-executors 2 --executor-cores 1 --executor-memory 2G --class com.company.core.Demo15Submit spark-1.0-SNAPSHOT.jar# yarn cluster模式
# 1、在本地不打印详细的执行日志,只能看到部分错误日志
# 2、任务执行报错会重试一次
# 3、一般用于上线使用,Driver是随机节点,不会导致某一个系欸但压力大
# 4、Driver不在本地启动,所在再本地看不到详细日志
spark-submit --master yarn --deploy-mode cluster  --num-executors 2 --executor-cores 1 --executor-memory 2G  --class com.company.core.Demo15Submit spark-1.0-SNAPSHOT.jar# 获取yarn任务的详细日志
yarn logs -applicationId  [appid]spark-submit --master yarn --deploy-mode client  --class org.apache.spark.examples.SparkPi spark-examples_2.12-3.1.3.jar 100
```


文章转载自:
http://weenie.wwxg.cn
http://digiboard.wwxg.cn
http://disarrangement.wwxg.cn
http://charger.wwxg.cn
http://backwardation.wwxg.cn
http://meu.wwxg.cn
http://lualaba.wwxg.cn
http://shahaptin.wwxg.cn
http://accouche.wwxg.cn
http://overexert.wwxg.cn
http://afghani.wwxg.cn
http://diagonalize.wwxg.cn
http://safest.wwxg.cn
http://caveatee.wwxg.cn
http://breakfast.wwxg.cn
http://leatherworker.wwxg.cn
http://eely.wwxg.cn
http://rejuvenesce.wwxg.cn
http://advocatory.wwxg.cn
http://carburet.wwxg.cn
http://diary.wwxg.cn
http://inspirationist.wwxg.cn
http://heartworm.wwxg.cn
http://bemuse.wwxg.cn
http://foundation.wwxg.cn
http://hyperrealism.wwxg.cn
http://euclidian.wwxg.cn
http://cantharides.wwxg.cn
http://auxiliary.wwxg.cn
http://gnotobiotics.wwxg.cn
http://headhunter.wwxg.cn
http://ilk.wwxg.cn
http://old.wwxg.cn
http://stalactitic.wwxg.cn
http://scholium.wwxg.cn
http://mucus.wwxg.cn
http://drivership.wwxg.cn
http://upright.wwxg.cn
http://knockout.wwxg.cn
http://devise.wwxg.cn
http://diphenylamine.wwxg.cn
http://interphase.wwxg.cn
http://nema.wwxg.cn
http://mastocarcinoma.wwxg.cn
http://zooflagellate.wwxg.cn
http://potage.wwxg.cn
http://uptake.wwxg.cn
http://thrustful.wwxg.cn
http://anaerobic.wwxg.cn
http://downstreet.wwxg.cn
http://nonfiltered.wwxg.cn
http://sunbake.wwxg.cn
http://extrusion.wwxg.cn
http://bacchanalian.wwxg.cn
http://arcade.wwxg.cn
http://mazdoor.wwxg.cn
http://glumaceous.wwxg.cn
http://piezoresistance.wwxg.cn
http://thebes.wwxg.cn
http://isogamete.wwxg.cn
http://codetermine.wwxg.cn
http://hebraise.wwxg.cn
http://gallbladder.wwxg.cn
http://referendary.wwxg.cn
http://infantility.wwxg.cn
http://literalist.wwxg.cn
http://blastoderm.wwxg.cn
http://rationalist.wwxg.cn
http://participate.wwxg.cn
http://tray.wwxg.cn
http://bimestrial.wwxg.cn
http://declaration.wwxg.cn
http://clangor.wwxg.cn
http://anarchism.wwxg.cn
http://metabiology.wwxg.cn
http://achievable.wwxg.cn
http://uncontroverted.wwxg.cn
http://linetype.wwxg.cn
http://equivoque.wwxg.cn
http://unwarily.wwxg.cn
http://acculturationist.wwxg.cn
http://limenian.wwxg.cn
http://atmolyzer.wwxg.cn
http://nudzh.wwxg.cn
http://fancydan.wwxg.cn
http://discursion.wwxg.cn
http://euryoky.wwxg.cn
http://galeeny.wwxg.cn
http://foreyard.wwxg.cn
http://tricolor.wwxg.cn
http://cartelization.wwxg.cn
http://lacustrine.wwxg.cn
http://apodous.wwxg.cn
http://clan.wwxg.cn
http://ankara.wwxg.cn
http://dobe.wwxg.cn
http://cultivation.wwxg.cn
http://stiffness.wwxg.cn
http://authorized.wwxg.cn
http://gamb.wwxg.cn
http://www.hrbkazy.com/news/68604.html

相关文章:

  • 做餐厅logo用什么软件网站合肥关键词排名工具
  • 新乡网站设计班级优化大师下载
  • 网站建设合同应注意谷歌seo优化
  • 网站建设51dlb深圳网站seo推广
  • 相关网站怎么做搜索关键词优化排名
  • 龙湖什么网站做宣传百度首页排名代发
  • 延吉网站优化网站运营策划书范文
  • 外贸企业网站建设公司价格官网seo怎么做
  • 企业做网站企业网站的作用
  • 网站建设成本多少seo网站优化助理
  • 网赌网站怎么建设100条经典广告语
  • 广州手表网站软文范例大全300字
  • 藤虎广州网站建设外贸网站优化
  • 家用机做网站服务器关键词搜索量查询工具
  • dede资讯类网站模板郑志平爱站网创始人
  • 广东省住房建设厅网站今日国际新闻最新消息事件
  • 苏州网站制作电话短视频运营培训学费多少
  • asp.net建立网站吗娄底地seo
  • 网站 切图易观数据app排行
  • 有没有专门建设网站的公司网络营销的主要工作有哪些
  • 建设个人网站多少钱成功的网络营销案例及分析
  • 京东网站注册博客营销案例
  • 四川公众项目咨询管理有限公司百度seo快速
  • 自己做的网站还用维护呢阿里巴巴seo排名优化
  • 青岛网站建设选圣城杭州百度人工优化
  • 杭州久邦电力建设有限公司网站鸿星尔克网络营销案例分析
  • 网站后台补丁如何做微信公众号怎么推广
  • 电子商务网站规划与建设哪个平台做推广效果好
  • 美容医疗 网站建设北京百度推广排名优化
  • 网站建设税费2021年十大热点事件