Friday, 9 November 2018

How many open files ? "Too many open files"

I saw this today: -

[09/11/18 11:18:19:403 GMT] 00000176 FileDocument  E   ADMR0104E: The system is unable to read document /opt/ibm/WebSphere/AppServer/profiles/Dmgr01/config/temp/download/cells/odm892Cell01/cell.xml: java.io.IOException: Too many open files

during an IBM ODM Rules build.

This was a new RHEL 7.6 VM.

Guess what I'd forgotten ?

Yep, my ulimits etc.

<snip>
Set Ulimits etc.

vi /etc/security/limits.d/20-nproc.conf

# - nofile - max number of open files
wasadmin   soft    nofile  65536
wasadmin   hard    nofile  65536

# - nproc - max number of processes
wasadmin   soft    nproc   16384
wasadmin   hard    nproc   16384


vi /etc/security/limits.conf

* hard nofile 10240
* soft nofile 10240


vi /etc/sysctl.conf

fs.file-max = 524288
</snip>

A few vi commands and a reboot later, and we're good to go.

Thursday, 8 November 2018

Ubuntu 18.04 - Changing the hostname

So I did not realise that it's now so hard to change a hostname in Ubuntu, I've obviously been spoilt in the past.

I assumed that it was a case of: -

sudo hostname hostname.domain.com
sudo vi /etc/hostname
sudo vi /etc/hosts
sudo reboot

but, alas, no longer - it's now more like: -

sudo hostnamectl set-hostname icpboot.uk.ibm.com
sudo vi /etc/cloud/cloud.cfg
sudo vi /etc/hosts
sudo reboot

Whilst I'm on a rant n' roll, the mechanism for changing an IP address has also changed ….

Now it's more like this: -

sudo vi /etc/netplan/50-cloud-init.yaml 

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        ens33:
            addresses:
            - 192.168.1.200/24
            gateway4: 192.168.1.1

            nameservers:
                addresses:
                - 9.9.9.9
                - 8.8.8.8
                - 1.1.1.1
                search: []
            optional: true
    version: 2


which is nice.

Thursday, 1 November 2018

Apple TV Screensavers - On the Mac !

I've had this installed for a while, but noticed that it was a little more clunky since I had upgraded to macOS Mojave 10.14.1.

Thankfully, the oh-so-excellent author, John Coates, has updated it :-)

Aerial is a Mac screensaver based on the new Apple TV screensaver that displays the Aerial movies Apple shot over New York, San Francisco, Hawaii, China, etc. Starting with version 1.4, this also includes the new ISS videos available in tvOS 12!

Aerial is completely open source, so feel free to contribute to its development.




Docker CE on Ubuntu 18.10

That'll teach me to use the latest n' greatest Ubuntu 18.10 ( aka Cosmic ): -

sudo add-apt-repository \
>    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
>    $(lsb_release -cs) \
>    stable"


Get:1 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Hit:2 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease                                                  
Get:3 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]                                                          
Hit:4 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease                                                                            
Ign:5 https://download.docker.com/linux/ubuntu cosmic InRelease          
Err:6 https://download.docker.com/linux/ubuntu cosmic Release
  404  Not Found [IP: 13.35.198.99 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu cosmic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.


sudo apt-get update

Get:1 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Hit:2 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease                                              
Get:3 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]                                                          
Hit:4 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease                                                                              
Ign:5 https://download.docker.com/linux/ubuntu cosmic InRelease
Err:6 https://download.docker.com/linux/ubuntu cosmic Release
  404  Not Found [IP: 13.35.198.85 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu cosmic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

Note that the add-apt command uses this: -

lsb_release -cs

which returns: -

cosmic

I checked this: -





which explains it - there's no stable release.

Easily hacked :-)

sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   bionic \
   stable"


Hit:1 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease
Get:2 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]
Get:3 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Get:4 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]                                                                         
Hit:5 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease           
Get:6 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [2,414 B]
Fetched 231 kB in 1s (405 kB/s)
Reading package lists... Done

which pulls the stable release from the bionic ( Ubuntu 18.04 ) release instead.

sudo apt-get update

Hit:1 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease
Get:2 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]                              
Hit:3 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease                                                                                        
Hit:4 https://download.docker.com/linux/ubuntu bionic InRelease                                                                                         
Get:5 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Fetched 164 kB in 1s (322 kB/s)                                
Reading package lists… Done


sudo apt-get install docker-ce

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  wmdocker
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  aufs-tools cgroupfs-mount git git-man liberror-perl pigz
Suggested packages:
  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed
  aufs-tools cgroupfs-mount docker-ce git git-man liberror-perl pigz
0 to upgrade, 7 to newly install, 0 to remove and 5 not to upgrade.
Need to get 44.8 MB of archives.
After this operation, 230 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu cosmic/universe amd64 pigz amd64 2.4-1 [57.4 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu cosmic/universe amd64 aufs-tools amd64 1:4.9+20170918-2 [104 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu cosmic/universe amd64 cgroupfs-mount all 1.4 [6,320 B]
Get:4 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 liberror-perl all 0.17026-1 [26.6 kB]
Get:5 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce amd64 18.06.1~ce~3-0~ubuntu [40.2 MB]
Get:6 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 git-man all 1:2.19.1-1ubuntu1 [822 kB]
Get:7 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 git amd64 1:2.19.1-1ubuntu1 [3,529 kB]
Fetched 44.8 MB in 42s (1,064 kB/s)                                                                                                                         
Selecting previously unselected package pigz.
(Reading database ... 133402 files and directories currently installed.)
Preparing to unpack .../0-pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) ...
Selecting previously unselected package aufs-tools.
Preparing to unpack .../1-aufs-tools_1%3a4.9+20170918-2_amd64.deb ...
Unpacking aufs-tools (1:4.9+20170918-2) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../2-cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../3-docker-ce_18.06.1~ce~3-0~ubuntu_amd64.deb ...
Unpacking docker-ce (18.06.1~ce~3-0~ubuntu) ...
Selecting previously unselected package liberror-perl.
Preparing to unpack .../4-liberror-perl_0.17026-1_all.deb ...
Unpacking liberror-perl (0.17026-1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../5-git-man_1%3a2.19.1-1ubuntu1_all.deb ...
Unpacking git-man (1:2.19.1-1ubuntu1) ...
Selecting previously unselected package git.
Preparing to unpack .../6-git_1%3a2.19.1-1ubuntu1_amd64.deb ...
Unpacking git (1:2.19.1-1ubuntu1) ...
Setting up aufs-tools (1:4.9+20170918-2) ...
Setting up docker-ce (18.06.1~ce~3-0~ubuntu) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Setting up git-man (1:2.19.1-1ubuntu1) ...
Setting up liberror-perl (0.17026-1) ...
Setting up cgroupfs-mount (1.4) ...
Processing triggers for libc-bin (2.28-0ubuntu1) ...
Processing triggers for systemd (239-7ubuntu10) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up pigz (2.4-1) ...
Setting up git (1:2.19.1-1ubuntu1) …

sudo docker version

Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:24:51 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:23:15 2018
  OS/Arch:          linux/amd64
  Experimental:     false

I am living in the past - missing ifconfig on Ubuntu

I've just rolled a new VM comprising Ubuntu 18.10, ready to build a Docker/Jenkins/Maven/Git/Liberty PoC environment.

First thing I did was to check my IP address: -

ifconfig

Command 'ifconfig' not found, but can be installed with:

sudo apt install net-tools


Ewwwww :-(

This helped: -



so I tried that: -

ip address show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:2a:65:d1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.153.131/24 brd 192.168.153.255 scope global dynamic noprefixroute ens33
       valid_lft 1793sec preferred_lft 1793sec
    inet6 fe80::a101:3792:6392:ec9c/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever


I then dived back into the past: -

sudo apt install net-tools

[sudo] password for hayd: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed
  net-tools
0 to upgrade, 1 to newly install, 0 to remove and 5 not to upgrade.
Need to get 197 kB of archives.
After this operation, 811 kB of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 net-tools amd64 1.60+git20161116.90da8a0-2ubuntu1 [197 kB]
Fetched 197 kB in 0s (1,454 kB/s)
Selecting previously unselected package net-tools.
(Reading database ... 133345 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20161116.90da8a0-2ubuntu1_amd64.deb ...
Unpacking net-tools (1.60+git20161116.90da8a0-2ubuntu1) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up net-tools (1.60+git20161116.90da8a0-2ubuntu1) ...

and now I'm back there: -

ifconfig -a

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.153.131  netmask 255.255.255.0  broadcast 192.168.153.255
        inet6 fe80::a101:3792:6392:ec9c  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:2a:65:d1  txqueuelen 1000  (Ethernet)
        RX packets 5522  bytes 6355504 (6.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2406  bytes 252125 (252.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 328  bytes 24805 (24.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 328  bytes 24805 (24.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Good to be back !!!

Wednesday, 31 October 2018

Eclipse Luna on macOS Mojave - Not working, now working

I've just deployed Eclipse Luna on my Mac, which is running macOS 10.14.1 Mojave: -

tar xvzf /Volumes/DaveHaySSD/Software/Eclipse/eclipse-jee-luna-SR2-macosx-cocoa-x86_64.tar.gz 

...
x eclipse/
x eclipse/artifacts.xml
x eclipse/features/

x eclipse/Eclipse.app/Contents/
x eclipse/Eclipse.app/Contents/Info.plist
x eclipse/Eclipse.app/Contents/MacOS/
x eclipse/Eclipse.app/Contents/MacOS/eclipse
x eclipse/Eclipse.app/Contents/MacOS/eclipse.ini
x eclipse/Eclipse.app/Contents/Resources/
x eclipse/Eclipse.app/Contents/Resources/Eclipse.icns
x eclipse/dropins/
x eclipse/.eclipseproduct
x eclipse/epl-v10.html

...

When I launch it: -

./eclipse 

or: -

./eclipse -data ~/Documents/workspace.odm

it starts up OK but I can't navigate Eclipse using mouse or keyboard: -


I suspected that this MAY be the new Mojave security feature: -


but to no avail.

Thankfully, this was soluble / solvable.

I was starting Eclipse by hand from where I'd extracted it: -

cd /Users/davidhay/eclipse
./eclipse

org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  Will retry after the state location is initialized.

but didn't see any exceptions.

When I dug into the folder further: -

cd /Users/davidhay/eclipse
ls -al

total 568
drwxr-xr-x@  14 davidhay  staff     448 31 Oct 14:40 .
drwxr-xr-x+  70 davidhay  staff    2240 31 Oct 14:16 ..
-rw-r--r--@   1 davidhay  staff      60 28 Jan  2015 .eclipseproduct
drwxr-xr-x@   3 davidhay  staff      96 19 Feb  2015 Eclipse.app
-rw-r--r--@   1 davidhay  staff  254883 19 Feb  2015 artifacts.xml
drwxr-xr-x@  14 davidhay  staff     448 31 Oct 14:40 configuration
drwxr-xr-x@   2 davidhay  staff      64 19 Feb  2015 dropins
lrwxr-xr-x@   1 davidhay  staff      34 19 Feb  2015 eclipse -> Eclipse.app/Contents/MacOS/eclipse
-rw-r--r--@   1 davidhay  staff   12638 28 Jan  2015 epl-v10.html
drwxr-xr-x@ 163 davidhay  staff    5216 19 Feb  2015 features
-rw-r--r--@   1 davidhay  staff    9013 28 Jan  2015 notice.html
drwxr-xr-x@   4 davidhay  staff     128 19 Feb  2015 p2
drwxr-xr-x@ 845 davidhay  staff   27040 19 Feb  2015 plugins
drwxr-xr-x@   3 davidhay  staff      96 19 Feb  2015 readme

so I tried this: -

cd /Users/davidhay/eclipse/Eclipse.app/Contents/MacOS
./eclipse 

org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: /Users/davidhay/Documents/workspace.odm/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.5.1.20150109-1820.xml
org.eclipse.m2e.logback.configuration: Initializing logback

or: -

./eclipse -data ~/Documents/workspace.odm

org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: /Users/davidhay/Documents/workspace.odm/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.5.1.20150109-1820.xml
org.eclipse.m2e.logback.configuration: Initializing logback


and all is now working, keyboard and mouse-wise.

Nice :-)

IBM ODM - WASX7025E: Error found in String ""; cannot create ObjectName

Following on from earlier posts, I'm now building a Decision Server cluster: -

/opt/ibm/WebSphere/AppServer/profiles/Dmgr01/bin/createODMDecisionServerCluster.sh -clusterPropertiesFile /opt/ibm/WebSphere/AppServer/profiles/Dmgr01/bin/odm/ODMDecisionServerCluster.properties -adminUsername wasadmin -adminPassword passw0rd

which almost immediately failed: -

Starting the cluster creation process, more traces are available in /opt/ibm/WebSphere/AppServer/profiles/Dmgr01/logs/odm

Creating ODM Decision Server cluster creation, please wait ...
ODM Decision Server cluster fail, please check /opt/ibm/WebSphere/AppServer/profiles/Dmgr01/logs/odm


I checked the logs: -

cat  /opt/ibm/WebSphere/AppServer/profiles/Dmgr01/logs/odm/step1-createODMDecisionServerCluster.log

...
WASX7017E: Exception received while running file "/opt/ibm/WebSphere/AppServer/profiles/Dmgr01/bin/odm/createODMDecisionServerCluster.py"; exception information: com.ibm.ws.scripting.ScriptingException: WASX7025E: Error found in String ""; cannot create ObjectName.
...

I checked the source property file: -

cat /opt/ibm/WebSphere/AppServer/profiles/Dmgr01/bin/odm/ODMDecisionServerCluster.properties

#
#   Licensed Materials - Property of IBM
#   5725-B69 5655-Y17 5655-Y31
#   Copyright IBM Corp. 1987, 2018. All Rights Reserved.
#
#   Note to U.S. Government Users Restricted Rights:
#   Use, duplication or disclosure restricted by GSA ADP Schedule
#   Contract with IBM Corp.
#

#
# Cluster base configuration 
#
cluster.name=DecisionServerCluster
virtualhost.name=default_host
res.console.server.name=RulesMgrSrv
# Specify a comma separated list of nodes to add in the cluster
cluster.member.nodes=Node1
res.console.node=Dmgr

cluster.servers.maxHeapSize=4096
cluster.servers.initialHeapSize=1096

# These JVM options are recommanded settings for better performance.
# You may have at lest 6 CPU cores to be able to enable it.
# To apply this recommandation please uncomment the following line
#cluster.servers.jvm.args=-Xgcpolicy:gencon -Xgcthreads6

#
# Database configuration
#   Supported database type:
#       - DB2
#       - Oracle
#       - MSSQL
#       - PostgreSQL
#
database.type=DB2
database.jdbcDriverPath=/opt/ibm/WebSphere/AppServer/universalDriver/lib/db2jcc4.jar;/opt/ibm/WebSphere/AppServer/universalDriver/lib/db2jcc_license_cu.jar
database.name=RESDB
database.hostname=workflow.uk.ibm.com
database.port=60006
database.user=db2user1
database.password=passw0rd

and realised where I'd gone wrong.

I had: -

res.console.node=Dmgr

whereas I should've had: -

res.console.node=Node1

as per this: -



Once I fixed it, all was well: -

/opt/ibm/WebSphere/AppServer/profiles/Dmgr01/bin/createODMDecisionServerCluster.sh -clusterPropertiesFile /opt/ibm/WebSphere/AppServer/profiles/Dmgr01/bin/odm/ODMDecisionServerCluster.properties -adminUsername wasadmin -adminPassword passw0rd

Starting the cluster creation process, more traces are available in /opt/ibm/WebSphere/AppServer/profiles/Dmgr01/logs/odm

Creating ODM Decision Server cluster creation, please wait ...
Configuring ODM Decision Server datasource ...
Installing ODM Decision Server eXecution Unit ...
Installing ODM Decision Server RES Console ...
Installing ODM Decision Server HTDS in your cluster ...
Installing ODM Decision Server SSP in your cluster ...
Starting up your ODM Decision Server cluster ...
ODM Decision Server cluster statup invoked, it may make take a while before your cluster should be available.
Creating ODM Decision Server cluster configuration completed.