How Do You Troubleshoot SonarQube Not Starting Correctly and ce.Log Not Being Created Properly?

Problem scenario
You are running SonarQube.  The service seems to start (based on the output of “sudo systemctl status sonar”).  But based on an nmap command on your server’s external IP address, you see no service is listening.  You go to the logs directory and cannot find the ce.log file.  You cannot reach the web UI for SonarQube.  How do you fix this problem?

Possible Solution #1
Look at your sonar.properties file. 

How Do You Troubleshoot the Kubernetes Error “Metrics not available or pod default/kubia-xxx-bmb”?

Problem scenario
You run “kubectl top pod” but you receive an error such as this:

‘Metrics not available or pod default/kubia-xxx-bmb, age: 1hr10m…   error: Metrics not available for pod default/kubia-xxx-bmb, age: 1hr10m”‘

What should you do?

Updated on 9/2/19.

Solution
Wait five minutes.  Then re-run this command: kubectl top pod

The source of this question and answer were taken from page 432 of Kubernetes in Action by Marko Luksa published in 2018 by Manning. 

How Do You Troubleshoot the Ansible Message “ERROR! the role was not found”?

Problem scenario
You run ansible-playbook on a playbook (e.g., .yaml file) that uses a role.  It fails with the message “ERROR! the role was not found”.  How do you correct this problem?

Solution
Find the ansible.cfg file.  Look at the roles_path stanza.  Add or modify the path that you want Ansible to look at for a role every time the Ansible playbook runs.

How Do You Install Memcached on an Ubuntu Server?

Problem scenario
You want to try out Memcached.  How do you install memcached and php-memcached to test it?

Solution
(These directions were based on ServerMom.org directions.)

1.  Run these commands:

sudo apt-get -y update
sudo apt -y install memcached php-memcached php7.0 apache2
  # apache2 is not necessary but useful for testing purposes

2.  Create this file:
sudo vi /var/www/html/info.php # add the three lines below

<?php
phpinfo(); …

How Do You Find the Most Recently Modified Files in Linux?

Problem scenario
Someone was doing a web conference and modified several files.  You have forgotten what files she modified.  How do you find the files that were modified most recently on a Linux server?

Solution
Run this command:

find $1 -type f -exec stat –format ‘%Y :%y %n’ “{}” \; | sort -nr | cut -d: -f2- | head

How Do You Troubleshoot a C Program That Prints a Warning Message like “expects argument of type ‘char*’, but argument 2 has type ‘int’ [-Wformat=]”?

Problem scenario
You compile a C program (with gcc foobar.cc) but you get an error message like this:

“foofbar1.cc:71…: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘int’ [-Wformat=]
   printf (“y is a %s\n”, y);
                           ^  “

What do you do to not get this error?

Solution
While the code compiles, the executable may not run. 

How Do You Write an Ansible Playbook to Transfer a Compressed File and Unzip It without Using Linux Utilities?

Problem scenario
You have installed Ansible and configured it to work with other servers (managed nodes).  You want to write an Ansible playbook that will work with Linux managed nodes with three requirements:

1.  Transfer a compressed file from a web sever without wget.
2.  Uncompress a .zip file without unzip.
3.  Work without passwordless SSH authentication to the managed nodes.

How do you accomplish this with using Ansible-supported features?

What is GitOps?

Question
What is GitOps?

Answer
GitOps is a declarative method of managing infrastructure that is driven by committing code into a version control system. GitOps is an indirect, and usually imperative, approach to systems administration that gives a detailed history of past operations.  GitOps is the practice of adding code to a Git repository to trigger an operational event (such as rebooting a server, creating a user account,

How Do You Get the SonarQube Service to Remain on when It Stops Shortly after Being Started?

Problem scenario
You start SonarQube and the service seems to come up.  You see TCP port connection activity.  It does not stay up long enough to log in.  

You have SonarQube installed on a Linux server.  SonarQube starts, but it does not remain running because it dies out.  It stops running after 30 seconds of being started.  

In /opt/sonarqube/es.log you see a message like this:  “2018.05.23 17:01:53 WARN 

How Can Conway’s Law Avoid Conflicting with the DevOps Movement?

Organizational structures are created by business leaders.  A constellation of specialists in theory can be very productive for modular codebases where the work is distributed intelligently.

Conway’s Law is “[a]ny organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization’s communication structure.” Conway’s Law indirectly asserts that the Unix philosophy of having things be modular is achievable best by loosely-coupled groups rather than tightly-coupled groups (such as an aggregation of mini-groups into one business unit) according to WhatIs.com.