In this example we launch an H2 server, but it doesnt matter; same for any Java process.
Create a password file at ~/.jmxremote.password
using $JRE_HOME/lib/management/jmxremote.password
as a template.
JMX_PORT=1616
First, find PID of the Java process (e.g by using jps -lvm
).
Use jstat
to get measurements on the usage/capacity of the several memory pools of the heap (see also man jstat
). The results are reported in kbytes.
Get heap capacity, usually referred to as commited size (i.e memory allocated from the OS), by summing up S0C
, S1C
, EC
, OC
columns:
jstat -gc ${pid} | gawk '{if (NR > 1) {printf("%.0fk\n", ($1 + $2 + $5 + $7))}}'
-- | |
-- An example of a function returning a (single) record of (integer, integer, text) | |
-- | |
CREATE OR REPLACE FUNCTION examine_change_of_status( | |
IN status text, IN prev_status text, | |
-- output parameters (correspond to fields of returned record) | |
OUT a_count integer, OUT b_count integer, OUT answer text) | |
AS $body$ | |
BEGIN |
Let's assume that the FQDN name of the server will be registry.localdomain
, and the service will be exposed as https://registry.localdomain:8443/
.
Create an environment file .env
for the docker-compose project. An example content:
COMPOSE_PROJECT_NAME=registry_localdomain
# Run with: ansible-playbook -b | |
--- | |
- hosts: all | |
pre_tasks: | |
- command: lsb_release -is | |
register: lsb_release_distributor_result |
In this example, we directly instruct Docker to maintain a volume backed by NFS storage. Another way, of course, is to mount the NFS folder at the system level (afterwards, any container can bind-mount it).
By adding a Docker volume backed by NFS, Docker engine will take care of mounting/unmounting based on how containers are using this volume.
See also this comment:
Let /dev/sdb
be the USB device.
Create 1 VFAT partition at /dev/sdb1
and mount at /mnt/usb0
.
Install GRUB on the device:
grub-install --boot-directory=/mnt/usb0/boot /dev/sdb
Now, all files needed by GRUB (e.g modules for filesystems) are under /mnt/usb0/boot/grub
.
package com.example.hello_spreadsheet; | |
import java.io.Serializable; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.TimeZone; |
An example service
definition under /etc/systemd/system/foo.service
:
[Unit]
Description=Foo Service
After=network.target
[Service]