21/05/13 10:24:47 WARN Utils: Your hostname, zhanghedeMacBook resolves to a loopback address: 127.0.0.1; using 192.168.1.123 instead (on interface en0) 21/05/13 10:24:47 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address 21/05/13 10:24:48 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Setting default log level to "WARN". To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel). Spark context Web UI available at http://192.168.1.123:4040 Spark context available as 'sc' (master = local[*], app id = local-1620872693690). Spark session available as 'spark'. Welcome to ____ __ / __/__ ___ _____/ /__ _\ \/ _ \/ _ `/ __/ '_/ /___/ .__/\_,_/_/ /_/\_\ version 3.1.1 /_/ Using Scala version 2.12.10 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_261) Type in expressions to have them evaluated. Type :help for more information.
启动spark的单机shell,这里可以看到spark的web页面是http://192.168.1.123:4040,如果使用SparkContext对象则使用sc即可,master = local[*], app id = local-1620872693690,本地环境