How Do You Use a YAML File or a YAML Manifest in Kubernetes?

Problem scenario
Kubernetes can use YAML files for configuration. The book Kubernetes in Action by Luksa refers to these files as manifests (pages 148), YAML manifests (page 155) or “pod manifests” (page 451). The Kubernetes website refers to this YAML file as “the PodSpec” here. Pod templates are defined inside these .yaml files (as a subset of the file itself). How do you use these YAML files?

How Do You Troubleshoot an Error like This in Groovy “groovy.lang.MissingMethodException”?

Problem scenario
You run a Groovy program like this: groovy foobar.groovy

You see this message:

Caught: groovy.lang.MissingMethodException: No signature of method: java.lang.Boolean.call() is applicable for argument types: (foobar$_run_closure5$_closure6) values: [foobar$_run_closure5$_closure6@6150c3ec]
Possible solutions: wait(), any(), wait(long), and(java.lang.Boolean), each(groovy.lang.Closure), any(groovy.lang.Closure)
groovy.lang.MissingMethodException: No signature of method: java.lang.Boolean.call() is applicable for argument types: (foobar$_run_closure5$_closure6) values: [foobar$_run_closure5$_closure6@6150c3ec]
Possible solutions: wait(), any(), wait(long), and(java.lang.Boolean), each(groovy.lang.Closure), any(groovy.lang.Closure)
at foobar$_run_closure5.doCall(foobar.groovy:56)

What should you do?

When You Have Two Branches in a Git Repo, How Can You Reconcile the Differences When You Merge Them?

Problem scenario
When you have created a branch of a Git repo, and there have been changes made to the master branch and this second branch you created, what are your options?

Possible Solution #1. You can merge the two branches (e.g., with a pull request). One branch will prevail if there are any conflicts. You can select which branch to prevail with GitLab,

How Do You Find the Storage Space Displaced by a Directory and All of Its Files and Subdirectories on a Linux server?

Problem scenario
How do you find the space used on the disk (e.g., hard disk, SAN or NAS) from the files and subdirectories of a given directory via a Linux command prompt?

Problem scenario
Run a command such as this: sudo du -sh /path/to/subdirectory

It will show you how much space is being consumed (or utilized) by the “subdirectory”.

How Do You Write the Equivalent of a “hello world” Program with Machine Learning in Python?

Problem scenario
You want to be able to say you ran a machine learning program. You know some Python basic. What do you do to write a very simple machine learning program?

Solution
Prerequisite
This assumes that pip has been installed. If you need assistance see this posting.

Procedures

1.

How Do You Troubleshoot Cassandra when It Hangs on the Message “ColumnFamilyStore.java Initializing”?

Problem scenario
You start Cassandra with this command: ./bin/cassandra
You see one of the following messages:

INFO [MigrationStage:1] 2018-04-06 19:01:07,144 ColumnFamilyStore.java:391 – Initializing system_auth.resource_role_permissons_index
INFO [MigrationStage:1] 2018-04-06 19:01:07,163 ColumnFamilyStore.java:391 – Initializing system_auth.role_members

No progress is happening. What should you do?

Solution
Possible Solution #1. Try rebooting the server. This could help the problem.

How Do You Troubleshoot the Java Program Message “com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown database foobar”?

Problem scenario
Your Java program returns this message: “com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown database foobar”

What should you do?

Possible solution #1
Are you using Amazon Aurora? AWS has a MySQL PaaS offering. You may have a section of the Java code that looks like this:

Connection con=DriverManager.getConnection(“jdbc:mysql://foobar-us-west-2b.abcdefghijk.us-west-2.rds.amazonaws.com:3306/foobar”)

Remove the last “foobar” from the end. The connection string should look like this for Aurora databases:

jdbc:mysql://foobar-us-west-2b.abcdefghijk.us-west-2.rds.amazonaws.com:3306/foobar

Recompile the program.

In Python, What Are Some Advantages with Calling a Function or as a New Thread?

Question
Python supports the creation of new threads for [bound or unbound] functions. They can help with multiprocessing. New threads are ideal for non-blocking operations like serving a GUI. If you want a server to begin certain operations in parallel with others, you may want to use new threads as opposed to new processes (which can provide the same parallel processing benefit).

How Do You Troubleshoot the Message “ERROR: but there is no HDFS_DATANODE_USER defined.”?

Problem scenarios
One of the following apply to you.

Situation 1:
You run “start-dfs.sh” and it seems to work, but the “jps” command does not show that “DataNode” is running.

OR

Situation 2:
You run “sudo bash start-dfs.sh” but you receive this message:

ERROR: Attempting to operate on hdfs datanode as root
ERROR: but there is no HDFS_DATANODE_USER defined.

How Do You Troubleshoot Permissions Errors in the /home/ directory of a Linux server?

Problem scenario
You want to create files in the /home/ directory of your user. You are getting permission errors in the /home/ directory but the permissions are 777 and you are the user who is the owner of the directory, what should you do?

Possible Solution #1

1. Run this command: sudo service autofs stop
2. Make files or directories in home.