Getting error while starting the spark shell

While starting the spark shell, i get the below error,

Type :help for more information.17/06/19 05:31:33 ERROR SparkUI: Failed to bind SparkUIjava.net.BindException: Address already in use: Service ‘SparkUI’ failed after 16 retries! Consider explicitly setting the appropriate port for the service ‘SparkUI’ (for example spark.ui.port for SparkUI) to an available port or increasing spark.port.maxRetries.

@girinath1 Now you try to connect spark-shell. Issue has resolved.

again i get the error now,

17/06/19 06:15:41 ERROR SparkUI: Failed to bind SparkUI
java.net.BindException: Address already in use: Service ‘SparkUI’ failed after 16 retries! Consider explicitly setting the appropriate port for the service ‘SparkU
I’ (for example spark.ui.port for SparkUI) to an available port or increasing spark.port.maxRetries.

@girinath1 Use the command

spark-shell --conf spark.ui.port=22344 spark.port.maxRetries=100 --master yarn-client

if it makes you to resolve issue mark as solution.

Thank you its working now. what will the above command do… give me few lines please.

again spark shell is not getting started,

[girinandha@gw01 ~]$ spark-shell
Multiple versions of Spark are installed but SPARK_MAJOR_VERSION is not set
Spark1 will be picked by default
Java HotSpot™ 64-Bit Server VM warning: INFO: os::commit_memory(0x0000793ff9000000, 716177408, 0) failed; error=‘Cannot allocat
e memory’ (errno=12)

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 716177408 bytes for committing reserved memory.

An error report file with more information is saved as:

/home/girinandha/hs_err_pid17662.log

[girinandha@gw01 ~]$ cat /home/girinandha/hs_err_pid17662.log

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 716177408 bytes for committing reserved memory.

Possible reasons:

The system is out of physical RAM or swap space

In 32 bit mode, the process size limit was hit

Possible solutions:

Reduce memory load on the system

Increase physical memory or swap space

Check if swap backing store is full

Use 64 bit Java on a 64 bit OS

Decrease Java heap size (-Xmx/-Xms)

Decrease number of Java threads

Decrease Java thread stack sizes (-Xss)

Set larger code cache with -XX:ReservedCodeCacheSize=

This output file may be truncated or incomplete.

Out of Memory Error (os_linux.cpp:2627), pid=17662, tid=133317108836096

JRE version: (8.0_77-b03) (build )

Java VM: Java HotSpot™ 64-Bit Server VM (25.77-b03 mixed mode linux-amd64 compressed oops)

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again