欧美free性护士vide0shd,老熟女,一区二区三区,久久久久夜夜夜精品国产,久久久久久综合网天天,欧美成人护士h版

目錄

柚子快報(bào)邀請(qǐng)碼778899分享:Spark在大數(shù)據(jù)集群下的部署

柚子快報(bào)邀請(qǐng)碼778899分享:Spark在大數(shù)據(jù)集群下的部署

http://yzkb.51969.com/

Spark部署文檔

前提:需要保證配置好了三臺(tái)裝好hadoop的虛擬機(jī)hadoop102,hadoop103,hadoop104

下載地址

https://dlcdn.apache.org/spark/spark-3.2.0/spark-3.2.0-bin-hadoop3.2.tgz

條件

PYTHON 推薦3.8JDK 1.8

解壓

解壓下載的Spark安裝包

tar -zxvf spark-3.2.0-bin-hadoop3.2.tgz -C /export/server/

環(huán)境變量

配置Spark由如下5個(gè)環(huán)境變量需要設(shè)置

SPARK_HOME: 表示Spark安裝路徑在哪里PYSPARK_PYTHON: 表示Spark想運(yùn)行Python程序, 那么去哪里找python執(zhí)行器JAVA_HOME: 告知Spark Java在哪里HADOOP_CONF_DIR: 告知Spark Hadoop的配置文件在哪里HADOOP_HOME: 告知Spark Hadoop安裝在哪里

這5個(gè)環(huán)境變量 都需要配置在: /etc/profile中

上傳Spark安裝包

將下載好的spark-3.2.0-bin-hadoop3.2.tgz上傳這個(gè)文件到Linux服務(wù)器中

將其解壓, 本文將其解壓(安裝)到: /export/server內(nèi).

tar -zxvf spark-3.2.0-bin-hadoop3.2.tgz -C /export/server/

由于spark目錄名稱很長(zhǎng), 給其一個(gè)軟鏈接:

ln -s /export/server/spark-3.2.0-bin-hadoop3.2 /export/server/spark

測(cè)試

bin/pyspark

bin/pyspark 程序, 可以提供一個(gè) 交互式的 Python解釋器環(huán)境, 在這里面可以寫普通python代碼, 以及spark代碼

在這個(gè)環(huán)境內(nèi), 可以運(yùn)行spark代碼

sc.parallelize([1,2,3,4,5]).map(lambda x: x + 1).collect()

注意:parallelize和map` 都是spark提供的API

WEB UI (4040)

Spark程序在運(yùn)行的時(shí)候, 會(huì)綁定到機(jī)器的4040端口上。如果4040端口被占用, 會(huì)順延到4041 … 4042…

4040端口是一個(gè)WEBUI端口, 可以在瀏覽器內(nèi)打開:輸入:服務(wù)器ip:4040 即可打開。

打開監(jiān)控頁(yè)面后, 可以發(fā)現(xiàn) 在程序內(nèi)僅有一個(gè)Driver。因?yàn)槲覀兪荓ocal模式, Driver即管理 又 干活。同時(shí), 輸入jps,可以看到local模式下的唯一進(jìn)程存在。這個(gè)進(jìn)程 即是master也是worker

bin/spark-shell - 了解

同樣是一個(gè)解釋器環(huán)境, 和bin/pyspark不同的是, 這個(gè)解釋器環(huán)境 運(yùn)行的不是python代碼, 而是scala程序代碼

scala> sc.parallelize(Array(1,2,3,4,5)).map(x=> x + 1).collect()

res0: Array[Int] = Array(2, 3, 4, 5, 6)

這個(gè)僅作為了解即可, 因?yàn)檫@個(gè)是用于scala語(yǔ)言的解釋器環(huán)境

bin/spark-submit (PI)

作用: 提交指定的Spark代碼到Spark環(huán)境中運(yùn)行

使用方法:

# 語(yǔ)法

bin/spark-submit [可選的一些選項(xiàng)] jar包或者python代碼的路徑 [代碼的參數(shù)]

# 示例

bin/spark-submit /export/server/spark/examples/src/main/python/pi.py 10

# 此案例 運(yùn)行Spark官方所提供的示例代碼 來計(jì)算圓周率值. 后面的10 是主函數(shù)接受的參數(shù), 數(shù)字越高, 計(jì)算圓周率越準(zhǔn)確.

對(duì)比

功能bin/spark-submitbin/pysparkbin/spark-shell功能提交java\scala\python代碼到spark中運(yùn)行提供一個(gè)python解釋器環(huán)境用來以python代碼執(zhí)行spark程序提供一個(gè)scala解釋器環(huán)境用來以scala代碼執(zhí)行spark程序特點(diǎn)提交代碼用解釋器環(huán)境 寫一行執(zhí)行一行解釋器環(huán)境 寫一行執(zhí)行一行使用場(chǎng)景正式場(chǎng)合, 正式提交spark程序運(yùn)行測(cè)試\學(xué)習(xí)\寫一行執(zhí)行一行\(zhòng)用來驗(yàn)證代碼等測(cè)試\學(xué)習(xí)\寫一行執(zhí)行一行\(zhòng)用來驗(yàn)證代碼等

Anaconda On Linux 安裝 (單臺(tái)服務(wù)器)

安裝

上傳安裝包:

下載地址:(https://www.anaconda.com/products/individual#Downloads)

上傳: Anaconda3-2021.05-Linux-x86_64.sh`文件到Linux服務(wù)器上

安裝:

sh ./Anaconda3-2021.05-Linux-x86_64.sh

輸入yes后就安裝完成了.

安裝完成后, 退出SecureCRT 重新進(jìn)來:

看到這個(gè)Base開頭表明安裝好了.

base是默認(rèn)的虛擬環(huán)境. ?

國(guó)內(nèi)源

如果你安裝好后, 沒有出現(xiàn)base, 可以打開:/root/.bashrc這個(gè)文件, 追加如下內(nèi)容:

channels:

- defaults

show_channel_urls: true

default_channels:

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r

- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2

custom_channels:

conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

附2 spark-submit和pyspark相關(guān)參數(shù)

客戶端工具我們可以用的有:

bin/pyspark: pyspark解釋器spark環(huán)境bin/spark-shell: scala解釋器spark環(huán)境bin/spark-submit: 提交jar包或Python文件執(zhí)行的工具bin/spark-sql: sparksql客戶端工具

這4個(gè)客戶端工具的參數(shù)基本通用.

以spark-submit 為例:

bin/spark-submit --master spark://node1:7077 xxx.py

Usage: spark-submit [options] [app arguments]

Usage: spark-submit --kill [submission ID] --master [spark://...]

Usage: spark-submit --status [submission ID] --master [spark://...]

Usage: spark-submit run-example [options] example-class [example args]

Options:

--master MASTER_URL spark://host:port, mesos://host:port, yarn,

k8s://https://host:port, or local (Default: local[*]).

--deploy-mode DEPLOY_MODE 部署模式 client 或者 cluster 默認(rèn)是client

--class CLASS_NAME 運(yùn)行java或者scala class(for Java / Scala apps).

--name NAME 程序的名字

--jars JARS Comma-separated list of jars to include on the driver

and executor classpaths.

--packages Comma-separated list of maven coordinates of jars to include

on the driver and executor classpaths. Will search the local

maven repo, then maven central and any additional remote

repositories given by --repositories. The format for the

coordinates should be groupId:artifactId:version.

--exclude-packages Comma-separated list of groupId:artifactId, to exclude while

resolving the dependencies provided in --packages to avoid

dependency conflicts.

--repositories Comma-separated list of additional remote repositories to

search for the maven coordinates given with --packages.

--py-files PY_FILES 指定Python程序依賴的其它python文件

--files FILES Comma-separated list of files to be placed in the working

directory of each executor. File paths of these files

in executors can be accessed via SparkFiles.get(fileName).

--archives ARCHIVES Comma-separated list of archives to be extracted into the

working directory of each executor.

--conf, -c PROP=VALUE 手動(dòng)指定配置

--properties-file FILE Path to a file from which to load extra properties. If not

specified, this will look for conf/spark-defaults.conf.

--driver-memory MEM Driver的可用內(nèi)存(Default: 1024M).

--driver-java-options Driver的一些Java選項(xiàng)

--driver-library-path Extra library path entries to pass to the driver.

--driver-class-path Extra class path entries to pass to the driver. Note that

jars added with --jars are automatically included in the

classpath.

--executor-memory MEM Executor的內(nèi)存 (Default: 1G).

--proxy-user NAME User to impersonate when submitting the application.

This argument does not work with --principal / --keytab.

--help, -h 顯示幫助文件

--verbose, -v Print additional debug output.

--version, 打印版本

Cluster deploy mode only(集群模式專屬):

--driver-cores NUM Driver可用的的CPU核數(shù)(Default: 1).

Spark standalone or Mesos with cluster deploy mode only:

--supervise 如果給定, 可以嘗試重啟Driver

Spark standalone, Mesos or K8s with cluster deploy mode only:

--kill SUBMISSION_ID 指定程序ID kill

--status SUBMISSION_ID 指定程序ID 查看運(yùn)行狀態(tài)

Spark standalone, Mesos and Kubernetes only:

--total-executor-cores NUM 整個(gè)任務(wù)可以給Executor多少個(gè)CPU核心用

Spark standalone, YARN and Kubernetes only:

--executor-cores NUM 單個(gè)Executor能使用多少CPU核心

Spark on YARN and Kubernetes only(YARN模式下):

--num-executors NUM Executor應(yīng)該開啟幾個(gè)

--principal PRINCIPAL Principal to be used to login to KDC.

--keytab KEYTAB The full path to the file that contains the keytab for the

principal specified above.

Spark on YARN only:

--queue QUEUE_NAME 指定運(yùn)行的YARN隊(duì)列(Default: "default").

柚子快報(bào)邀請(qǐng)碼778899分享:Spark在大數(shù)據(jù)集群下的部署

http://yzkb.51969.com/

推薦文章

評(píng)論可見,查看隱藏內(nèi)容

本文內(nèi)容根據(jù)網(wǎng)絡(luò)資料整理,出于傳遞更多信息之目的,不代表金鑰匙跨境贊同其觀點(diǎn)和立場(chǎng)。

轉(zhuǎn)載請(qǐng)注明,如有侵權(quán),聯(lián)系刪除。

本文鏈接:http://gantiao.com.cn/post/19026225.html

發(fā)布評(píng)論

您暫未設(shè)置收款碼

請(qǐng)?jiān)谥黝}配置——文章設(shè)置里上傳

掃描二維碼手機(jī)訪問

文章目錄