Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Dev-Jam 2019 - Container & OpenNMS

68 Aufrufe

Veröffentlicht am

Talk from Ronny Trommer about OpenNMS and running them in containers, focused on Docker.

Veröffentlicht in: Technologie
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

Dev-Jam 2019 - Container & OpenNMS

  1. 1. Container & OpenNMS
  2. 2. Operations
  3. 3. Docker & Docker Compose DockerHub Account
  4. 4. http://tiny.cc/dj2019docker
  5. 5. http://tiny.cc/dj2019docker docker-compose up -d Start database and horizon services in background
  6. 6. http://tiny.cc/dj2019docker docker-compose stop [service] Stops all services or a specific one.
 The last state is preserved.
  7. 7. http://tiny.cc/dj2019docker docker-compose down -v Stops all services or a specific one.
 Last state is removed. Deletes also Volumes!
  8. 8. Upgrade
  9. 9. Backup etc, rrd, reports and database 1. Stop horizon: docker-compose stop horizon 2. Backup database:
 docker-compose exec database 
 pg_dump -W -U horizonuser 
 -Fc -f /tmp/opennms.pgsql.gz horizondb 3. Get backup file from container:
 docker cp postgresql:/tmp/opennms.pgsql.gz . 4. docker inspect horizon | grep data-horizon-rrd 
 demo_data-horizon-rrd:/opt/opennms/share/rrd:rw", "Name": "demo_data-horizon-rrd", "Source": "/var/lib/docker/volumes/demo_data-horizon-rrd/_data",
  10. 10. Initialise a new etc and apply changes 1. Delete the content of your ./etc directory 2. Bump the image version 3. Initalise a pristine etc from the new version with
 docker-compose run horizon -i 4. Restore your modified config files and start
  11. 11. Merge changes from identified configs 1. Backup files you have modified 2. Merge your modified files, it means check XML schema changes. Use
 https://github.com/opennms/opennms-etc-pristine
 with your target version for the merge
  12. 12. docker-compose exec horizon diff -rq -EBbw ./etc share/etc-pristine | grep "Only in ./etc[/|:]" docker-compose exec horizon 
 diff -rq -EBbw ./etc share/etc-pristine | grep "differ" docker-compose exec horizon 
 diff -rq -EBbw ./etc share/etc-pristine | grep "Only in share/etc-pristine[/|:]" 1. Identify changed configuration files
  13. 13. docker-compose exec horizon diff -rq -EBbw ./etc share/etc-pristine | grep "Only in ./etc[/|:]" docker-compose exec horizon 
 diff -rq -EBbw ./etc share/etc-pristine | grep "differ" docker-compose exec horizon 
 diff -rq -EBbw ./etc share/etc-pristine | grep "Only in share/etc-pristine[/|:]" 1. Identify changed configuration files NMS-12129
  14. 14. volumes:
 - ./etc-overlay:/opt/opennms-overlay Overlay Directory Everything is copied and overwrites files in the directory
 /opt/opennms Use it for files which are not changed from the Web UI
 - opennms.properties.d
 - Poller Configuration - Notification Commands Changes from the Web UI get overwritten on next restart: - SNMP Communities - Users, Groups, Destination Paths, - Notifications, Thresholds, etc.
  15. 15. Troubleshooting
  16. 16. 1. docker-compose logs -f horizon 2. docker-compose exec horizon bash 3. docker-compose run horizon -t 4. environment:
 - JAVA_OPTS=-XX:+UseG1GC 5. docker cp <container-id>:/path/src /path/dest 6. Start with JPDA debugger:
 
 JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,address=$*:8001,suspend=n
  17. 17. Development
  18. 18. • Build OCI with the CI/CD • Integrate in Test environment • Docker Images as artefacts • Test the OCI itself • target is Horizon 25
  19. 19. • horizon-core-web -> horizon • Simplify overlay directories • Run with OpenShift as non-root • POC with confd
  20. 20. Challenges
  21. 21. Karaf Containers
  22. 22. 926MiB 567MiB 232MiB 127MiB CentOS 7 OpenJDK Dependencies OpenNMS
  23. 23. Runtime configs Start-up configs
  24. 24. Double-click to edit • Double-click to edit

×