Dietrich Schroff

Subscribe to Dietrich Schroff feed
Dietrich Schroffhttps://plus.google.com/101232877473830670008noreply@blogger.comBlogger439125
Updated: 8 hours 33 min ago

Firefox tab crashes by loading maps.google.com on ubuntu 16.04

Sun, 2018-02-18 10:21
On a ubuntu 16.04 system firefox crashes by loading maps.google.com:

 The only way to fix this was going to "about:config":

On this page search for "webgl.disabled" and change the value from false
to true:

After that, maps.google.com loads without any problem...

Docker-Machine: how to create a docker vm on a remote virtualbox server

Sun, 2018-02-11 01:37
After doing some first steps with docker, i wanted to test docker-swarm. Because of the limited resources of my notebook, i was looking for a Linux with a minimal footprint. In the context of setting up VMs for docker-swarm i found a log of articles about doing that with the tool docker-machine.
It sounds like this tool can create VMs just with one command. (here the documentation).

So let's give it a try:
(You have to install docker-machine first, but you do not need to install docker itself)
~$ docker-machine create --driver virtualbox test
Creating CA: /home/schroff/.docker/machine/certs/ca.pem
Creating client certificate: /home/schroff/.docker/machine/certs/cert.pem
Running pre-create checks...
(test) Image cache directory does not exist, creating it at /home/schroff/.docker/machine/cache...
(test) No default Boot2Docker ISO found locally, downloading the latest release...
(test) Latest release for github.com/boot2docker/boot2docker is v17.11.0-ce
(test) Downloading /home/schroff/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v17.11.0-ce/boot2docker.iso...
(test) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(test) Copying /home/schroff/.docker/machine/cache/boot2docker.iso to /home/schroff/.docker/machine/machines/test/boot2docker.iso...
(test) Creating VirtualBox VM...
(test) Creating SSH key...
(test) Starting the VM...
(test) Check network to re-create if needed...
(test) Found a new host-only adapter: "vboxnet0"
(test) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env testWow.
After this command inside my virtualbox a new machine shows up with 1GB RAM, 20 GB HDD (dynamic allocated), 2 network adapters (1x NAT, 1x host only).




But it is not possible to create VMs on a remote Virtualbox server. The CLI does not allow to give a remote server IP:

But for some other environments it is possible to deploy VMs on a remote site:

--vmwarevsphere-vcenter: IP/hostname for vCenter (or ESXi if connecting directly to a single host)If your preferred virtualization engine supports remote servers, you can check here:

Nevertheless docker-machine is an excellent tool. If you are interested in creating a swarm, read this tutorial.
The homepage of the OS boot2docker can be found here.

Talking about Microservices: A journey to Docker / Snap / CoreOS / Unbuntu Core / Docker-Swarm

Wed, 2018-02-07 13:11
A few months ago (13th august 2017) i started my personal journey into this new hype called microservices:

I thought the best way for me to get in touch was to begin with CoreOS. Within 2 weeks i got some first impressions:

But after these steps i realized, that next step on this road is kubernetes. It is clear that cluster scheduler like kubernetes can not be run on a single machine - so i tried to get another access to microservices: Snap and UbuntuCore:
In november 2017 it was clear, that both UbuntuCore and CoreOS are some building blocks for microservices, but i was not really on the right track.
Back to kubernetes? Kubernetes relies on containers. So i started with docker:
Nearly 3 months later i still did not get in touch with kubernetes - but i think docker swarm is a cluster scheduler, too. And it is really easy to run.

What will i do next? Some tests to failure/failover/failback scenarios. 

    Ubuntu 17.10: s2disk/hibernate broken with kernel 4.13.0-32

    Sat, 2018-02-03 14:22
    Last week my notebook refused to startup after s2disk/hibernate. The resume process started up to 100% and then the screen went black and everything stopped...

    Hmm...
    First idea: Something disappeared inside the grub configuration.

    But this was okay.

    After nearly one hour my last try was booting an old kernel. And with
    schroff@zerberus:/boot$ uname -a
    Linux zerberus 4.13.0-17-generic #20-Ubuntu SMP Mon Nov 6 10:04:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linuxs2disk and resume worked again...


    Bash: How to trim/truncate variables / get substrings

    Sat, 2018-01-27 12:53
    In a comment to one of the most useless commands postings was shown how to use the rev command to get the last component of  the path out of a log file:
    cat log | grep pattern | rev | cut -d '/' -f 1 | revIf you only have one variable filled with a path, you can get the last component very easy:
    schroff@zerberus:~$ myvar=/ab/cd/ef/gh
    schroff@zerberus:~$ echo ${myvar##*\/}
    gh?

    ## removes the longest matching string for the pattern "*\/" from the beginning (the slash has to be escaped with a backslash).

    schroff@zerberus:~$ echo ${myvar#*\/}
    ab/cd/ef/gh# removes the shortest matching pattern. Here only the starting "/"

    % and %% removes everything from the end up to the pattern:
    schroff@zerberus:~$ echo ${myvar%\/*}
    /ab/cd/ef
    schroff@zerberus:~$ echo ${myvar%%\/*}Here the content of the bash manpage:
           ${parameter#word}
           ${parameter##word}
    Remove matching prefix pattern.  The word is expanded to produce a pattern just
    as in pathname expansion.  If the pattern matches the beginning of the value of
    parameter,  then the result of the expansion is the expanded value of parameter
    with the shortest matching pattern (the ``#'' case)  or  the  longest  matching
    pattern (the ``##'' case) deleted.  If parameter is @ or *, the pattern removal
    operation is applied to each positional parameter in turn, and the expansion is
    the resultant list.  If parameter is an array variable subscripted with @ or *,
    the pattern removal operation is applied to each member of the array  in  turn,
    and the expansion is the resultant list.

           ${parameter%word}
           ${parameter%%word}
    Remove matching suffix pattern.  The word is expanded to produce a pattern just
    as in pathname expansion.  If the pattern matches a  trailing  portion  of  the
    expanded  value  of parameter, then the result of the expansion is the expanded
    value of parameter with the shortest matching pattern (the ``%'' case)  or  the
    longest  matching  pattern  (the ``%%'' case) deleted.  If parameter is @ or *,
    the pattern removal operation is applied to each positional parameter in  turn,
    and  the  expansion  is  the resultant list.  If parameter is an array variable
    subscripted with @ or *, the pattern removal operation is applied to each  mem‐
    ber of the array in turn, and the expansion is the resultant list.

    Java 9: JDK without subfolder JRE

    Thu, 2018-01-25 15:09
    In older JDK releases the directory structure was:
    bin
    db
    include
    jre
    libWith JEP 220 the jre folder was removed.


    A JDK image no longer contains a jre subdirectory, as noted above. Existing code that assumes the existence of that directory might not work correctly.But this does not mean that there is no JRE any more. You can still download the JRE. There are some minor changes to the JRE like:
    The bin directory in a JRE image contains a few commands that were previously found only in JDK images, namely appletvieweridlj,jrunscript, and jstatd. As with the previous item, these changes are a consequence of the way in which components that contain both APIs and tools were modularized.For both version the files rt.jar, tools.jar and dt.jar are removed:
    JDK and JRE images no longer contain the files lib/rt.jar,lib/tools.jarlib/dt.jar, and other internal JAR files, as noted above. Existing code that assumes the existence of these files might not work correctly.But this should not be a problem:
    Class and resource files previously found in lib/dt.jar and visible only when that file was added to the class path are now visible via the bootstrap class loader and present in both the JRE and the JDK. Everyone who delivers Java applications should read  JEP 220 and check, what has to be changed...

    Oracle SOA Suite 12c: Configuring the SOA Suite Weblogic Server

    Mon, 2018-01-22 14:45
    After
     i had to run the
    ./config.shinside the home/oracle/Oracle/Middleware/Oracle_Home/oracle_common/common/bin

















    And then after a
    ./startWeblogic.shinside /bin in the directory, which was configured in the first screenshot of the config.sh, i can open the console:


    Oracle SOA Suite: Installing the Fusion Middleware SOA Suite

    Sun, 2018-01-21 14:30
    After the installation of the Fusion Middleware Infrastructur the next step is to install the SOA Suite software.

    The software can be found here:



    The first try failed with this error:

    java -d64 -jar fmw_12.2.1.3.0_soa_quickstart.jar
    Launcher-Logdatei ist /tmp/OraInstall2017-10-07_11-47-20PM/launcher2017-10-07_11-47-20PM.log.
    Nicht genügend freier Speicherplatz in /tmp/orcl3797124329273264119.tmp, um das Installationsprogramm zu extrahieren. Aktuell 2796 MB. Erforderlich 3532 MB.Ok. Some cleanups inside /tmp and then:









    Next step: Run the config.sh to create a SOA Suite Server....

    Docker-CE: How to modify containers with overlays / How to add directories to a standard docker image

    Sun, 2018-01-14 13:01
    After some experiments with docker i wanted to run a tomcat with my own configuration (e.g. memory settings, ports, ...).


    My first idea was: Download tomcat, configure everything and then build an image.
    BUT: After i learned how to use the -v (--volume) flag for adding some file via the docker command to an image i was wondering, wether creating a new image with only the additional files on top of standard tomcat docker image.

    So first step is to take a look at all local images:
    # docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    558MB
    friendlyhello       latest              976ee2bb47bf        3 days ago          148MB
    tomcat              latest              11df4b40749f        8 days ago          558MB
    I can use tomcat:latest. (if it is not there just pull it: docker pull tomcat)
    Next step is to create a directory and add all the directories which you want to override.
    For my example:
    mkdir conftomcat
    cd conftomcat
    mkdir binInto the bin directory i put all the files from the tomcat standard container:
    # ls bin
    bootstrap.jar  catalina-tasks.xml  commons-daemon-native.tar.gz  daemon.sh  setclasspath.sh  startup.sh       tool-wrapper.sh
    catalina.sh    commons-daemon.jar  configtest.sh                 digest.sh  shutdown.sh      tomcat-juli.jar  version.sh
    Inside the catalina.sh i added -Xmx384M.
    In conftomcat i created the following Dockerfile:
    FROM tomcat:latest
    WORKDIR /usr/local/tomcat/bin
    ADD status /usr/local/tomcat/webapps/mystatus
    ADD bin /usr/local/tomcat/bin
    ENTRYPOINT [ "/usr/local/tomcat/bin/catalina.sh" ]
    CMD [ "run"]And as you can see i added my index.jsp which is inside status (s. this posting).
    Ok. Let's see, if my plan works:
    #docker build  -t  mytomcat .ending build context to Docker daemon  375.8kB
    Step 1/6 : FROM tomcat:latest
     ---> 11df4b40749f
    Step 2/6 : WORKDIR /usr/local/tomcat/bin
     ---> Using cache
     ---> 5696a9ab99cb
    Step 3/6 : ADD status /usr/local/tomcat/webapps/mystatus
     ---> 1bceea5af515
    Step 4/6 : ADD bin /usr/local/tomcat/bin
     ---> e8d3a386a7f0
    Step 5/6 : ENTRYPOINT [ "/usr/local/tomcat/bin/catalina.sh" ]
     ---> Running in a04038032bb7
    Removing intermediate container a04038032bb7
     ---> 4c8fda05df18
    Step 6/6 : CMD [ "run"]
     ---> Running in cce378648e7a
    Removing intermediate container cce378648e7a
     ---> 72ecfe2aa4a7
    Successfully built 72ecfe2aa4a7
    Successfully tagged mytomcat:latest
    and then start:
    docker run -p 4001:8080 mytomcat Let's check the memory settings:
    $ ps aux|grep java
    root      2313 20.7  8.0 2418472 81236 ?       Ssl  19:51   0:02 /docker-java-home/jre/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xmx394M -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
    Yes - changed to 384M.
    And check the jsp:



    Yippie!
    As you can see, i have the standard tomcat running with an override inside the configuration to 384M. So it should be easy to add certificates, WARs, ... to such a standard container.

    Ubuntu Intel Spectre/Meltdown update

    Sat, 2018-01-13 08:48
    One week after the rumors about Spectre and Meltdown (s. Project Zero Blog) my Ubuntu 17.10 got the Intel microcode patch:


    root@zerberus:~# apt-get upgrade
    Paketlisten werden gelesen... Fertig
    Abhängigkeitsbaum wird aufgebaut.      
    Statusinformationen werden eingelesen.... Fertig
    Paketaktualisierung (Upgrade) wird berechnet... Fertig
    Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
      linux-headers-4.13.0-17 linux-headers-4.13.0-17-generic
      linux-image-4.13.0-17-generic linux-image-extra-4.13.0-17-generic
    Verwenden Sie »apt autoremove«, um sie zu entfernen.
    Die folgenden Pakete sind zurückgehalten worden:
      linux-generic linux-headers-generic linux-image-generic
    Die folgenden Pakete werden aktualisiert (Upgrade):
      gir1.2-javascriptcoregtk-4.0 gir1.2-poppler-0.18 gir1.2-webkit2-4.0
      intel-microcode libjavascriptcoregtk-4.0-18 libpoppler-glib8 libpoppler68
      libruby2.3 libwebkit2gtk-4.0-37 libwebkit2gtk-4.0-37-gtk2 linux-libc-dev
      poppler-utils ruby2.3
    13 aktualisiert, 0 neu installiert, 0 zu entfernen und 3 nicht aktualisiert.
    Es müssen 30,5 MB an Archiven heruntergeladen werden.
    Nach dieser Operation werden 321 kB Plattenplatz zusätzlich benutzt.
    Möchten Sie fortfahren? [J/n]

    Holen:1 http://de.archive.ubuntu.com/ubuntu artful-updates/universe amd64 libwebkit2gtk-4.0-37-gtk2 amd64 2.18.5-0ubuntu0.17.10.1 [9.026 kB]
    Holen:2 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 libwebkit2gtk-4.0-37 amd64 2.18.5-0ubuntu0.17.10.1 [11,2 MB]                                                      
    Holen:3 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 libjavascriptcoregtk-4.0-18 amd64 2.18.5-0ubuntu0.17.10.1 [4.052 kB]                                              
    Holen:4 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 gir1.2-webkit2-4.0 amd64 2.18.5-0ubuntu0.17.10.1 [67,6 kB]                                                        
    Holen:5 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 gir1.2-javascriptcoregtk-4.0 amd64 2.18.5-0ubuntu0.17.10.1 [21,0 kB]                                              
    Holen:6 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 poppler-utils amd64 0.57.0-2ubuntu4.2 [141 kB]                                                                    
    Holen:7 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 libpoppler-glib8 amd64 0.57.0-2ubuntu4.2 [108 kB]                                                                 
    Holen:8 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 libpoppler68 amd64 0.57.0-2ubuntu4.2 [787 kB]                                                                     
    Holen:9 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 gir1.2-poppler-0.18 amd64 0.57.0-2ubuntu4.2 [18,4 kB]                                                             
    Holen:10 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 linux-libc-dev amd64 4.13.0-25.29 [963 kB]                                                                       
    Holen:11 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 intel-microcode amd64 3.20180108.0~ubuntu17.10.1 [1.090 kB]                                                       Holen:12 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 libruby2.3 amd64 2.3.3-1ubuntu1.2 [2.972 kB]                                                                     
    Holen:13 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 ruby2.3 amd64 2.3.3-1ubuntu1.2 [41,0 kB]                                                                         
    Es wurden 30,5 MB in 25 s geholt (1.186 kB/s).                                                                                                                                          
    (Lese Datenbank ... 391417 Dateien und Verzeichnisse sind derzeit installiert.)
    Vorbereitung zum Entpacken von .../00-libwebkit2gtk-4.0-37-gtk2_2.18.5-0ubuntu0.17.10.1_amd64.deb ...
    Entpacken von libwebkit2gtk-4.0-37-gtk2:amd64 (2.18.5-0ubuntu0.17.10.1) über (2.18.4-0ubuntu0.17.10.1) ...
    Vorbereitung zum Entpacken von .../01-libwebkit2gtk-4.0-37_2.18.5-0ubuntu0.17.10.1_amd64.deb ...
    Entpacken von libwebkit2gtk-4.0-37:amd64 (2.18.5-0ubuntu0.17.10.1) über (2.18.4-0ubuntu0.17.10.1) ...
    Vorbereitung zum Entpacken von .../02-libjavascriptcoregtk-4.0-18_2.18.5-0ubuntu0.17.10.1_amd64.deb ...
    Entpacken von libjavascriptcoregtk-4.0-18:amd64 (2.18.5-0ubuntu0.17.10.1) über (2.18.4-0ubuntu0.17.10.1) ...
    Vorbereitung zum Entpacken von .../03-gir1.2-webkit2-4.0_2.18.5-0ubuntu0.17.10.1_amd64.deb ...
    Entpacken von gir1.2-webkit2-4.0:amd64 (2.18.5-0ubuntu0.17.10.1) über (2.18.4-0ubuntu0.17.10.1) ...
    Vorbereitung zum Entpacken von .../04-gir1.2-javascriptcoregtk-4.0_2.18.5-0ubuntu0.17.10.1_amd64.deb ...
    Entpacken von gir1.2-javascriptcoregtk-4.0:amd64 (2.18.5-0ubuntu0.17.10.1) über (2.18.4-0ubuntu0.17.10.1) ...
    Vorbereitung zum Entpacken von .../05-poppler-utils_0.57.0-2ubuntu4.2_amd64.deb ...
    Entpacken von poppler-utils (0.57.0-2ubuntu4.2) über (0.57.0-2ubuntu4.1) ...
    Vorbereitung zum Entpacken von .../06-libpoppler-glib8_0.57.0-2ubuntu4.2_amd64.deb ...
    Entpacken von libpoppler-glib8:amd64 (0.57.0-2ubuntu4.2) über (0.57.0-2ubuntu4.1) ...
    Vorbereitung zum Entpacken von .../07-libpoppler68_0.57.0-2ubuntu4.2_amd64.deb ...
    Entpacken von libpoppler68:amd64 (0.57.0-2ubuntu4.2) über (0.57.0-2ubuntu4.1) ...
    Vorbereitung zum Entpacken von .../08-gir1.2-poppler-0.18_0.57.0-2ubuntu4.2_amd64.deb ...
    Entpacken von gir1.2-poppler-0.18:amd64 (0.57.0-2ubuntu4.2) über (0.57.0-2ubuntu4.1) ...
    Vorbereitung zum Entpacken von .../09-linux-libc-dev_4.13.0-25.29_amd64.deb ...
    Entpacken von linux-libc-dev:amd64 (4.13.0-25.29) über (4.13.0-21.24) ...
    Vorbereitung zum Entpacken von .../10-intel-microcode_3.20180108.0~ubuntu17.10.1_amd64.deb ...
    Entpacken von intel-microcode (3.20180108.0~ubuntu17.10.1) über (3.20170707.1) ...
    Vorbereitung zum Entpacken von .../11-libruby2.3_2.3.3-1ubuntu1.2_amd64.deb ...
    Entpacken von libruby2.3:amd64 (2.3.3-1ubuntu1.2) über (2.3.3-1ubuntu1.1) ...
    Vorbereitung zum Entpacken von .../12-ruby2.3_2.3.3-1ubuntu1.2_amd64.deb ...
    Entpacken von ruby2.3 (2.3.3-1ubuntu1.2) über (2.3.3-1ubuntu1.1) ...
    intel-microcode (3.20180108.0~ubuntu17.10.1) wird eingerichtet ...update-initramfs: deferring update (trigger activated)
    intel-microcode: microcode will be updated at next boot
    linux-libc-dev:amd64 (4.13.0-25.29) wird eingerichtet ...
    gir1.2-javascriptcoregtk-4.0:amd64 (2.18.5-0ubuntu0.17.10.1) wird eingerichtet ...
    Trigger für libc-bin (2.26-0ubuntu2) werden verarbeitet ...
    Trigger für man-db (2.7.6.1-2) werden verarbeitet ...
    libjavascriptcoregtk-4.0-18:amd64 (2.18.5-0ubuntu0.17.10.1) wird eingerichtet ...
    libruby2.3:amd64 (2.3.3-1ubuntu1.2) wird eingerichtet ...
    libpoppler68:amd64 (0.57.0-2ubuntu4.2) wird eingerichtet ...
    libpoppler-glib8:amd64 (0.57.0-2ubuntu4.2) wird eingerichtet ...
    poppler-utils (0.57.0-2ubuntu4.2) wird eingerichtet ...
    libwebkit2gtk-4.0-37:amd64 (2.18.5-0ubuntu0.17.10.1) wird eingerichtet ...
    libwebkit2gtk-4.0-37-gtk2:amd64 (2.18.5-0ubuntu0.17.10.1) wird eingerichtet ...
    gir1.2-poppler-0.18:amd64 (0.57.0-2ubuntu4.2) wird eingerichtet ...
    ruby2.3 (2.3.3-1ubuntu1.2) wird eingerichtet ...
    gir1.2-webkit2-4.0:amd64 (2.18.5-0ubuntu0.17.10.1) wird eingerichtet ...
    Trigger für initramfs-tools (0.125ubuntu12) werden verarbeitet ...
    update-initramfs: Generating /boot/initrd.img-4.13.0-21-generic
    Trigger für libc-bin (2.26-0ubuntu2) werden verarbeitet ...


    So note the "intel-microcode" package, which states:
    intel-microcode: microcode will be updated at next boot

    And after the reboot:
    schroff@zerberus:~$ dmesg | grep microcode
    [    0.000000] microcode: microcode updated early to revision 0xc2, date = 2017-11-16
    [    1.400728] microcode: sig=0x406e3, pf=0x40, revision=0xc2
    [    1.401060] microcode: Microcode Update Driver: v2.2.

    Oracle SOA Suite: Installating the Fusion Middleware Infrastructure

    Wed, 2018-01-10 12:44
    After setting up the database (installation, instance setup) and the SOA Suite repository (via rcu) the next step is to install the Oracle Weblogic Infrastructure.

    The software can be downloaded here:

    (You have to choose "Fusion Middleware Infrastructure Installer)

    The unzip the downloaded zip:
     fmw_12.2.1.3.0_infrastructure_Disk1_1of1.zipand run it: 
    java -d64 -jar fmw_12.2.1.3.0_infrastructure.jar Because the Oracle documentation does not contain pictures of the installer, here the screenshots:










    Next step is to run the config.sh to configure the Application server domain.

    Review at amazon: Kubernetes: Up & Running

    Sun, 2018-01-07 10:44
    Between christmas and new year i read

    The authors state:
    "This practical guide shows you how Kubernetes and container technology can help you achieve new levels of velocity, agility, reliability, and efficiency."I think, yes - this is a practial guide, but within only 166 pages it is far too short to give relevant insights into Kubernetes. There are many commands and YAMLs shown, but the book misses a didactic preparation. Some chapters can only be understand, if you have read some later chapters.

    But for only 25€ you get a good start, if you are willing to read the book twice ;-)

    If you are interested, take a look at my review at amazon.com. (This time amazon.de refused my review. ;-)

    Docker-Swarm: How to run a mysql database...

    Thu, 2018-01-04 06:44
    After several tests with docker swarm (setting up a swarm, running with more than on master, running a webserver in a swarm) i am thinking about running a mysql database in a swarm.

    If you are running a mysql database on one docker host, you have to set up a docker volume, because otherwise data inside the container is gone, if you restart your database container. You can follow this tutorial, which says, you have to run
    docker run --name=mysql1 -d mysql/mysql-server:tagbut there is the persistent volume missing. If you try this one, you are on the right way:
    docker run --name mysqldb --volumes-from mysql_data -v /var/lib/mysql:/var/l
    ib/mysql -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_DATABASE=sample -e MYSQL
    _ROOT_PASSWORD=supersecret -it -p 3306:3306 mysql
    The problem is, that you have to create a container, mysql_data which contains a volume.

    What about running a mysql database just with a volume?

    First idea is to create a docker volume:

    alpine:~#  docker volume create mysql_data
    mysql_data
    alpine:~# docker volume ls
    DRIVER              VOLUME NAME
    local               mysql_data And then start the mysql database:
     alpine:~# docker run --name mysqldb  -v mysql_data:/var/lib/mysql -e MYSQL_USER=mysql
    -e MYSQL_PASSWORD=mysql -e MYSQL_DATABASE=sample -e MYSQL_ROOT_PASSWORD=supersecret -i
    t -p 3306:3306 mysql

    Initializing database
    2017-12-10T12:25:38.890958Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2017-12-10T12:25:39.114910Z 0 [Warning] InnoDB: New log files created, LSN=45790
    2017-12-10T12:25:39.192006Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
    2017-12-10T12:25:39.269224Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 3b5276c6-dda5-11e7-847f-0242ac110002.
    2017-12-10T12:25:39.293895Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
    2017-12-10T12:25:39.296705Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
    2017-12-10T12:25:39.734384Z 1 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:39.734823Z 1 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:39.735089Z 1 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:39.735325Z 1 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:39.735530Z 1 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:39.735734Z 1 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:39.735969Z 1 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:39.736171Z 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
    Database initialized
    Initializing certificates
    Generating a 2048 bit RSA private key
    ............+++
    ...........................................................................................................................................................................................................+++
    unable to write 'random state'
    writing new private key to 'ca-key.pem'
    -----
    Generating a 2048 bit RSA private key
    .......................+++
    .......+++
    unable to write 'random state'
    writing new private key to 'server-key.pem'
    -----
    Generating a 2048 bit RSA private key
    .......................+++
    .............+++
    unable to write 'random state'
    writing new private key to 'client-key.pem'
    -----
    Certificates initialized
    MySQL init process in progress...
    2017-12-10T12:25:42.948452Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2017-12-10T12:25:42.949739Z 0 [Note] mysqld (mysqld 5.7.20) starting as process 87 ...
    2017-12-10T12:25:42.952799Z 0 [Note] InnoDB: PUNCH HOLE support available
    2017-12-10T12:25:42.953188Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2017-12-10T12:25:42.953550Z 0 [Note] InnoDB: Uses event mutexes
    2017-12-10T12:25:42.953828Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
    2017-12-10T12:25:42.954120Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
    2017-12-10T12:25:42.954451Z 0 [Note] InnoDB: Using Linux native AIO
    2017-12-10T12:25:42.954900Z 0 [Note] InnoDB: Number of pools: 1
    2017-12-10T12:25:42.955173Z 0 [Note] InnoDB: Using CPU crc32 instructions
    2017-12-10T12:25:42.956841Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
    2017-12-10T12:25:42.965639Z 0 [Note] InnoDB: Completed initialization of buffer pool
    2017-12-10T12:25:42.969568Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
    2017-12-10T12:25:42.982838Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
    2017-12-10T12:25:43.001695Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
    2017-12-10T12:25:43.002427Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
    2017-12-10T12:25:43.028474Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
    2017-12-10T12:25:43.029519Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
    2017-12-10T12:25:43.029785Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
    2017-12-10T12:25:43.030165Z 0 [Note] InnoDB: Waiting for purge to start
    2017-12-10T12:25:43.080873Z 0 [Note] InnoDB: 5.7.20 started; log sequence number 2565377
    2017-12-10T12:25:43.085057Z 0 [Note] Plugin 'FEDERATED' is disabled.
    2017-12-10T12:25:43.097783Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
    2017-12-10T12:25:43.111653Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
    2017-12-10T12:25:43.112695Z 0 [Warning] CA certificate ca.pem is self signed.
    2017-12-10T12:25:43.112387Z 0 [Note] InnoDB: Buffer pool(s) load completed at 171210 12:25:43
    2017-12-10T12:25:43.122126Z 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:43.122654Z 0 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:43.122922Z 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:43.123172Z 0 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:43.123424Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:43.123655Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:43.125278Z 0 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:43.125625Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:43.130811Z 0 [Note] Event Scheduler: Loaded 0 events
    2017-12-10T12:25:43.131463Z 0 [Note] mysqld: ready for connections.
    Version: '5.7.20'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server (GPL)
    2017-12-10T12:25:43.131789Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
    2017-12-10T12:25:43.132034Z 0 [Note] Beginning of list of non-natively partitioned tables
    2017-12-10T12:25:43.141674Z 0 [Note] End of list of non-natively partitioned tables
    Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
    Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
    Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
    2017-12-10T12:25:45.325153Z 5 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.326169Z 5 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.326766Z 5 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.327430Z 5 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.328439Z 5 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.329236Z 5 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.330139Z 5 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.330625Z 5 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
    mysql: [Warning] Using a password on the command line interface can be insecure.
    mysql: [Warning] Using a password on the command line interface can be insecure.
    mysql: [Warning] Using a password on the command line interface can be insecure.
    mysql: [Warning] Using a password on the command line interface can be insecure.
    2017-12-10T12:25:45.355944Z 9 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.356363Z 9 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.356743Z 9 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.357080Z 9 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.357407Z 9 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.358138Z 9 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.358579Z 9 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:45.358825Z 9 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.

    2017-12-10T12:25:45.360088Z 0 [Note] Giving 0 client threads a chance to die gracefully
    2017-12-10T12:25:45.360365Z 0 [Note] Shutting down slave threads
    2017-12-10T12:25:45.360562Z 0 [Note] Forcefully disconnecting 0 remaining clients
    2017-12-10T12:25:45.360757Z 0 [Note] Event Scheduler: Purging the queue. 0 events
    2017-12-10T12:25:45.360982Z 0 [Note] Binlog end
    2017-12-10T12:25:45.361681Z 0 [Note] Shutting down plugin 'ngram'
    2017-12-10T12:25:45.361897Z 0 [Note] Shutting down plugin 'BLACKHOLE'
    2017-12-10T12:25:45.362098Z 0 [Note] Shutting down plugin 'partition'
    2017-12-10T12:25:45.362285Z 0 [Note] Shutting down plugin 'ARCHIVE'
    2017-12-10T12:25:45.362470Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
    2017-12-10T12:25:45.362653Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
    2017-12-10T12:25:45.362844Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
    2017-12-10T12:25:45.363019Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
    2017-12-10T12:25:45.363206Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
    2017-12-10T12:25:45.363455Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
    2017-12-10T12:25:45.363740Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
    2017-12-10T12:25:45.364038Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
    2017-12-10T12:25:45.364313Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
    2017-12-10T12:25:45.364603Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
    2017-12-10T12:25:45.364886Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
    2017-12-10T12:25:45.365129Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
    2017-12-10T12:25:45.365333Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
    2017-12-10T12:25:45.365507Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
    2017-12-10T12:25:45.365678Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
    2017-12-10T12:25:45.365846Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
    2017-12-10T12:25:45.366026Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
    2017-12-10T12:25:45.366214Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
    2017-12-10T12:25:45.366413Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
    2017-12-10T12:25:45.366616Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
    2017-12-10T12:25:45.366799Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
    2017-12-10T12:25:45.366976Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
    2017-12-10T12:25:45.367142Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
    2017-12-10T12:25:45.367305Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
    2017-12-10T12:25:45.367467Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
    2017-12-10T12:25:45.367628Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
    2017-12-10T12:25:45.367796Z 0 [Note] Shutting down plugin 'INNODB_CMP'
    2017-12-10T12:25:45.367978Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
    2017-12-10T12:25:45.368141Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
    2017-12-10T12:25:45.368307Z 0 [Note] Shutting down plugin 'INNODB_TRX'
    2017-12-10T12:25:45.368469Z 0 [Note] Shutting down plugin 'InnoDB'
    2017-12-10T12:25:45.368926Z 0 [Note] InnoDB: FTS optimize thread exiting.
    2017-12-10T12:25:45.369212Z 0 [Note] InnoDB: Starting shutdown...
    2017-12-10T12:25:45.469927Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
    2017-12-10T12:25:45.471353Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 171210 12:25:45
    2017-12-10T12:25:47.118138Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12169663
    2017-12-10T12:25:47.125477Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
    2017-12-10T12:25:47.126721Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
    2017-12-10T12:25:47.127496Z 0 [Note] Shutting down plugin 'MyISAM'
    2017-12-10T12:25:47.128253Z 0 [Note] Shutting down plugin 'CSV'
    2017-12-10T12:25:47.128958Z 0 [Note] Shutting down plugin 'MEMORY'
    2017-12-10T12:25:47.129665Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
    2017-12-10T12:25:47.130679Z 0 [Note] Shutting down plugin 'sha256_password'
    2017-12-10T12:25:47.131807Z 0 [Note] Shutting down plugin 'mysql_native_password'
    2017-12-10T12:25:47.132756Z 0 [Note] Shutting down plugin 'binlog'
    2017-12-10T12:25:47.135910Z 0 [Note] mysqld: Shutdown complete


    MySQL init process done. Ready for start up.

    2017-12-10T12:25:47.379637Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2017-12-10T12:25:47.381062Z 0 [Note] mysqld (mysqld 5.7.20) starting as process 1 ...
    2017-12-10T12:25:47.383987Z 0 [Note] InnoDB: PUNCH HOLE support available
    2017-12-10T12:25:47.384373Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2017-12-10T12:25:47.384612Z 0 [Note] InnoDB: Uses event mutexes
    2017-12-10T12:25:47.384828Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
    2017-12-10T12:25:47.385024Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
    2017-12-10T12:25:47.385229Z 0 [Note] InnoDB: Using Linux native AIO
    2017-12-10T12:25:47.385591Z 0 [Note] InnoDB: Number of pools: 1
    2017-12-10T12:25:47.385887Z 0 [Note] InnoDB: Using CPU crc32 instructions
    2017-12-10T12:25:47.387049Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
    2017-12-10T12:25:47.393069Z 0 [Note] InnoDB: Completed initialization of buffer pool
    2017-12-10T12:25:47.395207Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
    2017-12-10T12:25:47.406539Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
    2017-12-10T12:25:47.417533Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
    2017-12-10T12:25:47.418058Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
    2017-12-10T12:25:47.433202Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
    2017-12-10T12:25:47.434200Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
    2017-12-10T12:25:47.434456Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
    2017-12-10T12:25:47.434855Z 0 [Note] InnoDB: Waiting for purge to start
    2017-12-10T12:25:47.485468Z 0 [Note] InnoDB: 5.7.20 started; log sequence number 12169663
    2017-12-10T12:25:47.487084Z 0 [Note] Plugin 'FEDERATED' is disabled.
    2017-12-10T12:25:47.500417Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
    2017-12-10T12:25:47.502089Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
    2017-12-10T12:25:47.511981Z 0 [Warning] CA certificate ca.pem is self signed.
    2017-12-10T12:25:47.516700Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
    2017-12-10T12:25:47.517640Z 0 [Note] IPv6 is available.
    2017-12-10T12:25:47.518010Z 0 [Note]   - '::' resolves to '::';
    2017-12-10T12:25:47.518467Z 0 [Note] Server socket created on IP: '::'.
    2017-12-10T12:25:47.523590Z 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:47.524079Z 0 [Warning] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:47.524350Z 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:47.524623Z 0 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:47.524854Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:47.525118Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:47.527817Z 0 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:47.528270Z 0 [Note] InnoDB: Buffer pool(s) load completed at 171210 12:25:47
    2017-12-10T12:25:47.528542Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
    2017-12-10T12:25:47.532739Z 0 [Note] Event Scheduler: Loaded 0 events
    2017-12-10T12:25:47.533402Z 0 [Note] mysqld: ready for connections.
    Version: '5.7.20'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
    2017-12-10T12:25:47.533772Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
    2017-12-10T12:25:47.534079Z 0 [Note] Beginning of list of non-natively partitioned tables
    2017-12-10T12:25:47.541968Z 0 [Note] End of list of non-natively partitioned tables
    and everything works like expected:
    alpine:~# docker ps
    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
    a6d0d908f034        mysql               "docker-entrypoint..."   3 minutes ago       Up 3 minutes        0.0.0.0:3306->3306/tcp   mysqldb
    alpine:~# docker exec -it a6d0d908f034  mysql -u root -psupersecret
    mysql: [Warning] Using a password on the command line interface can be insecure.
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 4
    Server version: 5.7.20 MySQL Community Server (GPL)

    Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> exit
    ByeIf i create the following:
    mysql> create database mydb;Query OK, 1 row affected (0.00 sec)
    mysql> use mydb
    Database changed
    mysql> create table mytable ( id int);
    Query OK, 0 rows affected (0.03 sec)and inside the volume:
    alpine:/# docker volume inspect mysql_data
    [
        {
            "CreatedAt": "2017-12-10T12:30:53Z",
            "Driver": "local",
            "Labels": {},
            "Mountpoint": "/var/lib/docker/volumes/mysql_data/_data",
            "Name": "mysql_data",
            "Options": {},
            "Scope": "local"
        }
    ]
    alpine:/# ls -l /var/lib/docker/volumes/mysql_data/_data/mydb/
    total 112
    -rw-r-----    1 999      ping            65 Dec 10 12:30 db.opt
    -rw-r-----    1 999      ping          8556 Dec 10 12:31 mytable.frm
    -rw-r-----    1 999      ping         98304 Dec 10 12:31 mytable.ibdBut after stopping the mysql database, i got the following on the next start:

    alpine:~# docker run --name mysqldb  -v mysql_data:/var/lib/mysql -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_DATABASE=sample -e MYSQL_ROOT_PASSWORD=supersecret -it -p 3306:3306 mysq
    l
    docker: Error response from daemon: Conflict. The container name "/mysqldb" is already in use by container "a6d0d908f03466181682666affb390650179c322f2848d32f2c72fab828f980c". You have to remove (or rename) that container to be able to reuse that name.
    See 'docker run --help'. OK. I have to change the "--name" (--> mysqldb2):
    alpine:/# docker exec -it mysqldb2  mysql -u root -psupersecret
    mysql: [Warning] Using a password on the command line interface can be insecure.
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 3
    Server version: 5.7.20 MySQL Community Server (GPL)

    Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> show databases
        -> ;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mydb               |
    | mysql              |
    | performance_schema |
    | sample             |
    | sys                |
    +--------------------+
    6 rows in set (0.01 sec)Yippie! The data is still there!







    Shortcomings of this approach:
    • Each time you start the mysql database on a new host, you have to run "docker volume create..."
      If you create a container with this volume (s. here oder there) you can skip this "docker volume create".
    • Both approaches will not work on docker swarm. The data is local to a node and not shared. One idea: Use a NFS mountpoint to redistribute the volume to all nodes.

    Docker-Swarm: Running with more than one manager-node / How to add a secondary manager or multiple managers

    Sat, 2017-12-30 06:41
    Adding additional masters to a docker swarm is very easy. I just followed the documentation:

    On the manager i ran the following command:
    alpine:~# docker swarm join-token manager
    To add a manager to this swarm, run the following command:

        docker swarm join --token SWMTKN-1-3b7f69d3wgty0u68oab8724z07fkyvgc0w8j37ng1l7jsmbghl-5nrni6ksqnkljvqpp59m5gfh1 192.168.178.46:2377And on the node:
    node03:~# docker swarm join --token SWMTKN-1-3b7f69d3wgty0u68oab8724z07fkyvgc0w8j37ng1
    l7jsmbghl-5nrni6ksqnkljvqpp59m5gfh1 192.168.178.46:2377

    This node joined a swarm as a manager.The new state of the cluster shows:
    alpine:~# docker  info | grep -A 23 Swarm
    Swarm: active
     NodeID: wy1z8jxmr1cyupdqgkm6lxhe2
     Is Manager: true
     ClusterID: wkbjyxbcuohgdqc3amhl9umlq
     Managers: 2
     Nodes: 4

     Orchestration:
      Task History Retention Limit: 5
     Raft:
      Snapshot Interval: 10000
      Number of Old Snapshots to Retain: 0
      Heartbeat Tick: 1
      Election Tick: 3
     Dispatcher:
      Heartbeat Period: 5 seconds
     CA Configuration:
      Expiry Duration: 3 months
      Force Rotate: 0
     Autolock Managers: false
     Root Rotation In Progress: false
     Node Address: 192.168.178.46
     Manager Addresses:
      192.168.178.46:2377
      192.168.178.50:2377
    If you want to use a new token just run:
    alpine:~# docker  swarm join-token --rotate  manager
    Successfully rotated manager join token.

    To add a manager to this swarm, run the following command:

        docker swarm join --token SWMTKN-1-3b7f69d3wgty0u68oab8724z07fkyvgc0w8j37ng1l7jsmbghl-cgy143mwghbfoozt0b8li2587 192.168.178.46:2377

    Docker-CE: Setting up a tomcat in less than a minute and running your JSP...

    Wed, 2017-12-13 15:14
    Last time i wrote about processes and files of a docker container hosting the docker example myapp.py.
    Next step was to run a tomcat with a small application inside.

    This can be done with theses commands:
    1. Get tomcat from the docker library:
      # docker pull tomcat
      Using default tag: latest
      latest: Pulling from library/tomcat
      3e17c6eae66c: Pull complete
      fdfb54153de7: Pull complete
      a4ca6e73242a: Pull complete
      5161d2a139e2: Pull complete
      7659b327f9ec: Pull complete
      ce47e69f11ad: Pull complete
      7d946df3a3d8: Pull complete
      a57cba73d797: Pull complete
      7e6f56cdb523: Pull complete
      06e4787b3ca5: Pull complete
      c760cb7e43cb: Pull complete
      ad6d0815df5c: Pull complete
      d7e1da09fc22: Pull complete
      Digest: sha256:a069d49c414bad0d98f5a4d7f9b7fdd318ccc451dc535084480c8aead68272d2
      Status: Downloaded newer image for tomcat:latest
    2. Test the tomcat:
      # docker run -p 4000:8080 tomcat
      20-Nov-2017 20:38:11.754 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.23
      20-Nov-2017 20:38:11.762 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Sep 28 2017 10:30:11 UTC
      20-Nov-2017 20:38:11.762 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.23.0
      ....
      ....
      org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
      20-Nov-2017 20:41:59.928 INFO [Thread-5] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]
       

    This was easy.
    Now create your JSP and run it:
    1. create a directory
      mkdir tomcatstatus
    2. create a jsp inside this direcotry
      vi tomcatstatus/index.jsp
      and insert the following content:
      <%@ page language="java" import="java.util.*" %>


      Host name : <%=java.net.InetAddress.getLocalHost().getHostName() %>

      Server Version: <%= application.getServerInfo() %>

      Servlet Version: <%= application.getMajorVersion() %>.<%= application.getMinorVersion(
      ) %>
      JSP Version: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersio
      n() %>
    3. Run docker
      docker run -v /home/schroff/tomcatstatus:/usr/local/tomcat/webapps/status -p 4000:8080 tomcat
    4. Connect to port 4000:

    Wow - i am really stunned how fast the tomcat was setup and the jsp was launched. No installation of java (ok, this is only apt install) and no setup procedure for Apache tomcat (ok, this is just a tar -zxvf). But if i want to run more than one installation - docker is faster than repeating the installation or copying files.  Really cool!


    (One thing i forgot: Installation of docker onto your server)

    Docker-Swarm: Running a minimal webserver in a swarm

    Sun, 2017-12-10 12:32
    In my last posting to docker swarm i created a swarm on virtualbox with alpine linux with a hdd footprint of 290MB per node:
    There are some tutorials out there with running a nginx or a java webserver in a container but >100MB for each node seems far to much for my tests.

    So i decided to create a application which listens on port 8080 with netcat. I created a directory ncweb with ncweb.sh:
    ncweb# cat ncweb.sh
    #!/bin/bash
    sed -i  's/Hostname:.*/Hostname: '$HOSTNAME'/g' index.html
    while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; cat index.html;}  | nc  -l -p 8080; done 2&>1 logfileand a index.html:
    ncweb# cat index.html
    <html>
      <head>
        <title>"Hello, World"</title>
      </head>
      <body bgcolor=white>
        <table border="0" cellpadding="10">
          <tr>
            <td>
              <h1>"Hello, World"</h1>
            </td>
          </tr>
        </table>
      </body>
    </html>The Dockerfile looks like this:
    # cat Dockerfile
    FROM alpine
    WORKDIR /tmp
    ADD .  /tmp
    ENTRYPOINT [ "/tmp/ncweb.sh" ]After that i created the container:
    ncweb# docker build -t ncweb:0.2 .
    Sending build context to Docker daemon  4.096kB
    Step 1/5 : FROM alpine
     ---> 053cde6e8953
    Step 2/5 : WORKDIR /tmp
     ---> Using cache
     ---> c3e11ac3773b
    Step 3/5 : RUN mkdir ncweb
     ---> Using cache
     ---> d9e634c03cd1
    Step 4/5 : ADD .  /tmp
     ---> 95f022aacc1c
    Step 5/5 : ENTRYPOINT [ "/tmp/ncweb.sh" ]
     ---> Running in c1a9e8cee248
     ---> 6880521f68e4
    Removing intermediate container c1a9e8cee248
    Successfully built 6880521f68e4
    Successfully tagged ncweb:0.2And let's do a test without docker swarm:
    ncweb# docker run -p 8080:8080  ncweb
    But running this as a service fails:
    # docker service create --replicas=1 --name myweb ncweb:0.2
    image ncweb:0.2 could not be accessed on a registry to record
    its digest. Each node will access ncweb:0.2 independently,
    possibly leading to different nodes running different
    versions of the image.
    n0himwum38bqzd8ob1vf8zhip
    overall progress: 0 out of 1 tasks
    1/1: No such image: ncweb:0.2
    ^COperation continuing in background.
    Use `docker service ps n0himwum38bqzd8ob1vf8zhip` to check progress.and:
    # docker service ps n0himwum38bqzd8ob1vf8zhip
    ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE                 ERROR                        PORTS
    8tjsuae9jv8o        myweb.1             ncweb:0.2           node01              Ready               Rejected 3 seconds ago        "No such image: ncweb:0.2"  
    qp24ssxb5bl5         \_ myweb.1         ncweb:0.2           alpine              Shutdown            Failed 36 seconds ago         "task: non-zero exit (2)"   
    zwfgcatk7zyi         \_ myweb.1         ncweb:0.2           node01              Shutdown            Rejected about a minute ago   "No such image: ncweb:0.2"  
    v4a7zkb85yd4         \_ myweb.1         ncweb:0.2           node01              Shutdown            Rejected about a minute ago   "No such image: ncweb:0.2"  
    ycjftjusv484         \_ myweb.1         ncweb:0.2           node01              Shutdown            Rejected about a minute ago   "No such image: ncweb:0.2"  
     
    # docker service rm n0himwum38bqzd8ob1vf8zhip
    n0himwum38bqzd8ob1vf8zhip
    The error "No such image..." is happening, because the container ncweb is only in the repository of my master.
    The easiest way for my test environment is to distribute the local image to all nodes:
    # docker save ncweb:0.3 | ssh 192.168.178.47 docker load
    The authenticity of host '192.168.178.47 (192.168.178.47)' can't be established.
    ECDSA key fingerprint is SHA256:2/8O/SE1fGJ4f5bAQls5txrKMbqZfMmiZ+Tha/WFKxA.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '192.168.178.47' (ECDSA) to the list of known hosts.
    root@192.168.178.47's password:
    Loaded image: ncweb:0.3(i have to distribute a ssh-key to all nodes)

    and then:
    alpine:~/ncweb# docker service create --replicas=1 --name myweb ncweb:0.3
    image ncweb:0.3 could not be accessed on a registry to record
    its digest. Each node will access ncweb:0.3 independently,
    possibly leading to different nodes running different
    versions of the image.# docker service ps myweb
    ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE           ERROR               PORTS
    in97xlc7azcw        myweb.1             ncweb:0.3           node01              Running             Running 8 seconds ago      
    So my nc-webserver runs on node01, but i can not access it there because i did not define any port mappings ;-(

    But finally this command did the job:
    # docker service create --replicas=1 --name myweb --publish 8080:8080  ncweb:0.3
    image ncweb:0.3 could not be accessed on a registry to record
    its digest. Each node will access ncweb:0.3 independently,
    possibly leading to different nodes running different
    versions of the image.
    runf8u9r8719sk13mkf8hh8ec
    overall progress: 1 out of 1 tasks
    1/1: running  
    verify: Service converged
    The hostname corresponds to the docker container id on node01:
    node01:~# docker ps
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    6c9434b08082        ncweb:0.3           "/tmp/ncweb.sh"     37 minutes ago      Up 37 minutes                           myweb.1.lqiyb34cuxxme2141ahsg8neu

    Remaining open points:
    • Is it possible to do a failback or limit the number of a service per node?
    • How to get a loadbalancing mechanism for a server application?
      (load balancer needed?)
    • What happens, if the manager fails / is shutdown?





    Docker-Swarm: One manager, two nodes with Alpine Linux

    Tue, 2017-12-05 16:32
    After creating a Alpine Linux VM inside virtualbox and after adding docker because of the small disk footprint (Alpine Linux: 170MB | with docker: 280MB) i performed the following steps to create a docker swarm:
    • cloning the vm twice
    • assigning a static ip to the manager node
    • create new MACs for the network interface cards on the nodes 


    Then i followed the tutorial https://docs.docker.com/engine/swarm/swarm-tutorial/create-swarm/ but without running the docker-machine commands, because i have 3 VMs and do not want to run the node on top of docker.

    manager:
    alpine:~# docker swarm init --advertise-addr 192.168.178.46
    Swarm initialized: current node (wy1z8jxmr1cyupdqgkm6lxhe2) is now a manager.

    To add a worker to this swarm, run the following command:

        docker swarm join --token SWMTKN-1-3b7f69d3wgty0u68oab8724z07fkyvgc0w8j37ng1l7jsmbghl-0yfr1eu5u66z8pinweisltmci 192.168.178.46:2377

    To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.nodes
    #     docker swarm join --token SWMTKN-1-3b7f69d3wgty0u68oab8724z07fkyvgc0w
    8j37ng1l7jsmbghl-0yfr1eu5u66z8pinweisltmci 192.168.178.46:2377
    This node joined a swarm as a worker.
    And then a check on the master:
    alpine:~# docker node ls
    ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS
    wy1z8jxmr1cyupdqgkm6lxhe2 *   alpine              Ready               Active              Leader
    pusf5o5buetjqrsmx3kzusbyt     node01              Ready               Active             
    io3z3b6nf8xbzkyzjq6sa7cuc     node02              Ready               Active             
    Run a first job:
    alpine:~# docker service create --replicas 1 --name helloworld alpine ping 192.168.178.1
    rsn6igby4f6d7uuy8eny7sbfb
    overall progress: 1 out of 1 tasks
    1/1: running  
    verify: Service converged
    But on my manager i get no output for "docker ps". But this is, because the service is not running here:
    alpine:~# docker service ps helloworld
    ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE           ERROR               PORTS
    wrrobalt4oe7        helloworld.1        alpine:latest       node01              Running             Running 2 minutes ago                      
    Node 1 shows:
    node01:~# docker ps
    CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS               NAMES
    40c5e9b2ffbc        alpine:latest       "ping 192.168.178.1"   3 minutes ago       Up 3 minutes                            helloworld.1.wrrobalt4oe7mrbhxjlweuxgk
    If i do a kill on the ping process, it is immediately restarted:
    node01:~# ps aux|grep ping
     2457 root       0:00 ping 192.168.178.1
     2597 root       0:00 grep ping
    node01:~# kill 2597
    node01:~# ps aux|grep ping
     2457 root       0:00 ping 192.168.178.1
     2600 root       0:00 grep ping
    A scale up is no problem:
    alpine:~# docker service create --replicas 2 --name helloworld alpine ping 192.168.178.1
    3lrdqdpjuqml6creswdcqpn2p
    overall progress: 2 out of 2 tasks
    1/2: running   [==================================================>]
    2/2: running   [==================================================>]
    verify: Service converged
    alpine:~# docker service ps helloworld
    ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE           ERROR               PORTS
    616scw68s8bv        helloworld.1        alpine:latest       node02              Running             Running 8 seconds ago                      
    n8ovvsw0m4id        helloworld.2        alpine:latest       node01              Running             Running 8 seconds ago                      
    And a shutdown of node02 is no problem:
    alpine:~# docker service ps helloworld
    ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE                ERROR               PORTS
    bne2enbkabfo        helloworld.1        alpine:latest       alpine              Ready               Ready 2 seconds ago                             
    616scw68s8bv         \_ helloworld.1    alpine:latest       node02              Shutdown            Running 17 seconds ago                          
    n8ovvsw0m4id        helloworld.2        alpine:latest       node01              Running             Running about a minute ago          


    After a switchoff of node01 both service are running on the remaining master:
    alpine:~# docker service ps helloworld
    ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE                ERROR               PORTS
    bne2enbkabfo        helloworld.1        alpine:latest       alpine              Running             Running about a minute ago                      
    616scw68s8bv         \_ helloworld.1    alpine:latest       node02              Shutdown            Running about a minute ago                      
    pd8dfp4133yw        helloworld.2        alpine:latest       alpine              Running             Running 2 seconds ago                           
    n8ovvsw0m4id         \_ helloworld.2    alpine:latest       node01              Shutdown            Running 2 minutes ago              
    So failover is working.
    But failback does not occur. After switching on node01 again, the service remains on the manager:
    alpine:~# docker service ps helloworld
    ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE               ERROR                         PORTS
    bne2enbkabfo        helloworld.1        alpine:latest       alpine              Running             Running 4 minutes ago                                    
    616scw68s8bv         \_ helloworld.1    alpine:latest       node02              Shutdown            Running 4 minutes ago                                    
    pd8dfp4133yw        helloworld.2        alpine:latest       alpine              Running             Running 2 minutes ago                                    
    n8ovvsw0m4id         \_ helloworld.2    alpine:latest       node01              Shutdown            Failed about a minute ago   "task: non-zero exit (255)"  
    alpine:~# docker node ls
    ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS
    wy1z8jxmr1cyupdqgkm6lxhe2 *   alpine              Ready               Active              Leader
    pusf5o5buetjqrsmx3kzusbyt     node01              Ready               Active             
    io3z3b6nf8xbzkyzjq6sa7cuc     node02              Down                Active             


    Last thing: How to stop the service?
    alpine:~# docker service rm  helloworld
    helloworld
    alpine:~# docker service ps helloworld
    no such service: helloworld
    Remaining open points:
    • Is it possible to do a failback or limit the number of a service per node?
    • How to do this with a server application?
      (load balancer needed?)
    • What happens, if the manager fails / is shutdown?

    OpenJDK 9: Limitations/shortcomings of the Jshell

    Thu, 2017-11-30 13:56
    Jshell is a quite powerful tool to do some quick explorations and to write some scripts.

    If found the following limitations:
    • No syntax highlighting
    • Only comments with // are allowed
      if you open a script file with
       /**
        *  My comments
        */
      this will work only many warnings.
      |  Error:
      |  illegal start of expression
      |   * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
      |   ^
      |  Error:
      |  illegal start of expression
      |   *
      |   ^
    • The usage of public, static, ... is quite different:
      -> public class MyClass {
      >> public int a;
      >> };
      |  Warning:
      |  Modifier 'public'  not permitted in top-level declarations, ignored
      |  public class MyClass {
      |  ^----^
      |  Added class MyClass this error is corrected:
      |      Modifier 'public'  not permitted in top-level declarations, ignored
      |      public class MyClass {
      |      ^----^
    • If you want to load a scipt with /open then tab completion does not work. The complete path including filename has to be typed / pasted.
    • If you load some example snippet, main(String[] args) is not run by default.
      Just tried with the swing tutorial from oracle:
      jshell Downloads/HelloWorldSwing.java  -> String[] mystringarray;
      |  Added variable mystringarray of type String[]

      -> HelloWorldSwing.main(mystringarray); 
    • .. 
    to be continued...

    Docker-CE: Creating a small Linux as base OS for running a Docker cluster

    Sat, 2017-11-25 15:13
    After some first steps with docker i wanted to run more than one docker node. The problem is, that i have very limited resources on my laptop.
    • CoreOS (see here)
      consumes about 600MB diskspace
    • UbuntuCore (see here)
      consumes about 1.9GB diskspace
    To setup CoreOS you have to learn ignition - otherwise every change is lost after a reboot. For UbuntuCore you have to use an UbuntuOne account to get it running.

    I heard, that Alpine Linux is an OS with a very small footprint, so i downloaded the "virtual" image and

    mounted it in my virtualbox:


    After a short startup i got the following:

    This is completely different to all other installation procedures i know. No configuration dialog just a
    localhost login:You have to enter "root" and without a password you get a banner with one important information:
    You can setup the system with the command: setup-alpineThis will guide you through a 11 step setup (read the manual). To get a installation with persistent homes, etc. you have to choose the "sys" mode.

    And then after a reboot, i have a Linux VM with 170MB.
    For my next steps (installing docker, cloning some nodes) this should be the right choice.

    [Installing docker is quite easy: remove the # before "edge/community" in /etc/apk/repositories and the run "apk update" and "apk add docker".]

    Pages