Ubuntu without a grub menu

I tried to hide the grub menu you generally see when you boot an Ubuntu Linux machine, but to no avail. I had altered the time out and time out style by setting them to:

GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0

But my machine still waited ten seconds. Turns out the grub scripts check if there is more than one OS installed on the machine. If there is, the time out is always 10 seconds.

I could fix this by editing /etc/grub.d/30_os-prober and setting quick_boot to 0. Odd to set it to 0 to speed things up, but it worked.

Of course you have to run update-grub, if you alter this script.

Spring Boot 2.7.x and Elasticsearch

It has been a long time since I did anything with Elasticsearch and I wanted to give it a go again. So I spun up a Spring Boot application through the Spring Initializr and downloaded the latest and greatest Elasticsearch, version 8.x.x.

I then could not get it to work and found that Spring Data Elasticsearch 4.4.5 only supports Elasticsearch 7.17.6. So I downloaded that and did the following.

I added the following to $ES_HOME/config/elasticsearch.yml:

xpack.security.enabled: true
discovery.type: single-node

We are running Elasticsearch as a single node. That is why I set the discovery.type.

Then I started Elasticsearch and setup passwords. If you don’t enable security, Elasticsearch logs a message every time you send a request to it, stating you’re doing unsafe things.

I set the passwords by executing:

$ES_HOME/bin/elasticsearch-setup-passwords auto

Elasticsearch then spits out the passwords for the various accounts. As I am only playing around with Elasticsearch and this is no a production setting, I am using the elastic account in Spring Boot.

What I did next was configure Elasticsearch in Spring Boot:

@Configuration
public class ElasticConfiguration extends AbstractElasticsearchConfiguration {

    @Override
    public RestHighLevelClient elasticsearchClient() {
        final ClientConfiguration clientConfiguration = 
            ClientConfiguration.builder()
                .connectedTo("localhost:9200")
                .withBasicAuth("elastic","<password>")
                .build();

        return RestClients.create(clientConfiguration).rest();
    }
}

Of course you would want put the username and password in a configuration file and not code, but we are just horsing around here.

Then it is just a matter of making a repository and a storage object and you are good to go:

public interface UserRepository extends ElasticsearchRepository<User, String> {
}

The User object looks like this:

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

@Document(indexName = "user")
public class User {
    @Id
    private String id;
    private String username;
    private String department;
}

High Availability Kubernetes cluster

Yesterday a computer, which I had ordered quite a while ago, finally arrived. It is an Intel NUC 10i7FNH with 64GB of memory and a 500GB Samsung 970 EVO Plus. I now have three of these. All the same specs.

I bought them over a period of several months. The 10i7FNH is not the most current model, still the price of every machine I bought was higher than the previous one. Between the first and the last machine there is a price difference of 160 euros. Quite a difference if you take into account the first one cost 790 euros. It is just another effect of COVID-19. Let us hope we can leave this whole pandemic behind us soon.

The Kubernetes cluster now has 144GB of RAM to run applications in. There are three master nodes for High Availability and three master nodes also means etcd has reached quorum.

Adding another master and worker node to a running Kubernetes cluster is quite a job. I could not have done it without the help from this article.

Now I can safely wait for one of the SSDs to break. Master nodes write so much data to disk, it’s just a matter of time before one of the consumer SSDs in the nodes breaks. Or at least that is my expectation. We will see.

Continuous Integration drama

When I read that Bitbucket Server is going to be discontinued in the future, I could have done two things. I could have waited as I could still use Bitbucket Server for quite a long time or I could go out and search for a new solution. I did the latter. Well, at least the searching part. I am still trying to find the best solution.

I am still trying to work with Bitbucket Cloud, but I am running into some issues:

  1. I am still not very pleased with having to put the credentials for my Nexus server into someone’s web application.
  2. Pipelines in Bitbucket Cloud aren’t very fast.
  3. Creating a Docker image with the spring-boot-maven-plugin fails at this time and it seems this problem isn’t going to be fixed any time soon.

I’d better have a look at gitlab and see what it can do for me, but there’s a good chance I’ll stick with Bitbucket Cloud and my own Jenkins server. More on that later.

And then my Bitbucket server died

One day I moved all my LXC containers to one host. This was done to use one of my NUCs as a Roon ROCK server. Moving the containers was easy with LXC. Just take a snapshot of the container and copy it to another server. Start it there and well, that was that.

In the back of my head a voice was telling me that all my LXC containers have boot.autostart set to true. The voice was telling also telling me this might become an issue. What if the Bitbucket server starts before the PostgreSQL server running on the same host?

Anyway, quite soon, after a few reboots, I got into trouble. Bitbucket was stuck at “Migrating home directory”.

I’m not saying booting all containers at the same time is the problem. It might be. It might also be that I shutdown down the SQL server before Bitbucket.

Looking for a solution wasn’t easy as I couldn’t find anything in the Bitbucket logs:

******@bitbucket ERROR: function aurora_version() does not exist at character 8

Apparently there is some sort of PostgreSQL implementation you can run on the Amazon cloud that is called Aurora. You learn something new every day…

I thought I had found the root cause, but also realised that all the people mentioning these log messages weren’t saying their server didn’t boot.

Then I started googling the message “Migrating home directory” and quickly had a solution. It seems my database was locked. This statement allowed my server to boot Bitbucket successfully again:

UPDATE DATABASECHANGELOGLOCK SET LOCKED=false, LOCKGRANTED=null, LOCKEDBY=null where ID=1;

The dreadful missing JDK dialog on macOS

I’m not a fan of Eclipse or products derived from Eclipse. I think they’re slow, not very intuitive and the program state never seems to be up to date, but sometimes unfortunately there’s no alternative.

Sometimes I use Apache Directory Studio to edit my LDAP data. Today I installed Directory studio, but it wouldn’t start because it couldn’t find the JDK. I have unwrapped several JDK tar balls in my /opt directory, but Directory Studio doesn’t know that.

Of course I immediately started googling and a lot of people mentioned to put -vm <path to java> in the Contents/Eclipse/ApacheDirectoryStudio.ini inside the application’s folder in /Applications. This unfortunately didn’t work for me.

I started checking other files in the application folder and found Contents/Info.plist. Inside the array tag in that file at the bottom there’s a comment about using a particular Java version. Adding this to that array tag did the trick: <string>-vm</string><string>/somepath/java</string>

Just now I have installed Eclipse to see if it suffers from the same problem out of the box and it does. The solution is the same for Eclipse. Just add the vm information in the Info.plist in the Contents folder in the Eclipse application folder.