Copy files to remote computer using ssh

Using scp command for secure copying file to remote machine:

Example:

 

Kill Linux process

Filter processes by string pattern (let it be “java” processes):

Find my process in resulted list and kill by id:

Kill all processes by “java” pattern:

 

s3cmd WARNING: Retrying failed request

I used s3cmd cp and s3cmd sync commands to copy files from source s3 folder to s3 destination. Copying  is too slow, I see many attempts, failed by timeout, like this

In ~/.s3cfg file I found socket_timeout setting, which is 100 by default. Setting it to 1000 helped me:

 

Eclipse: could not load the Tomcat server configuration

Starting Tomcat7 from Eclipse produced an error:
Could not load the Tomcat server configuration at /usr/share/tomcat7/conf. The configuration may be corrupt or incomplete.

Solution:

Tomcat7 split into different folders by default. Eclipse expects Tomcat to be in one folder. To resolve, we create symbolic links in Tomcat home dir.

Now Eclipse should be able to start Tomcat.

Apache Spark error on start: java.lang.NoClassDefFoundError: org/apache/spark/SparkConf

Starting a simple Spark project in IntelliJ Idea and getting an exception:

Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/spark/SparkConf
at …
Caused by: java.lang.ClassNotFoundException: org.apache.spark.SparkConf
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
… 2 more

Solution:

Change Spark dependencies scope from provided to compile in pom.xml

 

 

 

 

 

Spark SQL: load parquet in Spark Shell

I have my data in parquet format and want to load and query it using Spark SQL.

Start Spark shell

Load parquet folder to table

Now we can use this table for SQL queries: