<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PostgreSQL on AsherSu's Blog</title><link>https://ashersu.cn/en/tags/postgresql/</link><description>Recent content in PostgreSQL on AsherSu's Blog</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Tue, 24 Nov 2026 00:10:00 +0800</lastBuildDate><atom:link href="https://ashersu.cn/en/tags/postgresql/index.xml" rel="self" type="application/rss+xml"/><item><title>OpenNMS Distributed Deployment: Source Build, Remote Debugging, and Minion Configuration</title><link>https://ashersu.cn/en/posts/opennms-distributed-deployment/</link><pubDate>Tue, 24 Nov 2026 00:10:00 +0800</pubDate><guid>https://ashersu.cn/en/posts/opennms-distributed-deployment/</guid><description>&lt;p&gt;This article records the main steps and failure modes encountered while building OpenNMS from source and deploying a Core and Minion topology.&lt;/p&gt;&#10;&lt;h2 id="prerequisites"&gt;&lt;a href="#prerequisites" class="header-anchor"&gt;&lt;/a&gt;Prerequisites&#13;&#10;&lt;/h2&gt;&lt;ol&gt;&#10;&lt;li&gt;Prepare a machine with at least &lt;code&gt;8 GB&lt;/code&gt; of memory.&lt;/li&gt;&#10;&lt;li&gt;Install Java 17.&lt;/li&gt;&#10;&lt;li&gt;Ensure that Maven Central and the required dependency repositories are reachable.&lt;/li&gt;&#10;&lt;li&gt;Use a PostgreSQL version supported by the target OpenNMS release. For the environment described here, that means a version earlier than PostgreSQL 17.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="build-opennms-from-source"&gt;&lt;a href="#build-opennms-from-source" class="header-anchor"&gt;&lt;/a&gt;Build OpenNMS from source&#13;&#10;&lt;/h2&gt;&lt;p&gt;Clone the &lt;a class="link" href="https://github.com/OpenNMS/opennms" target="_blank" rel="noopener"&#13;&#10; &gt;OpenNMS repository&lt;/a&gt;, then run the project scripts:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;span class="lnt"&gt;6&#10;&lt;/span&gt;&lt;span class="lnt"&gt;7&#10;&lt;/span&gt;&lt;span class="lnt"&gt;8&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;ulimit&lt;/span&gt; -n &lt;span class="m"&gt;65535&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt install bzip2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./clean.pl&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./compile.pl -DskipTests&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./assemble.pl -p dir&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./target/opennms-33.1.4/bin/runjava -s&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./target/opennms-33.1.4/bin/install -dis&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./target/opennms-33.1.4/bin/opennms -vt start&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;When tests fail during assembly, use:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./assemble.pl -p dir -DskipTests&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Keep a custom Maven repository outside the OpenNMS source tree. The assembly process packages source directories, so a repository placed inside the checkout can make the generated archive unexpectedly large.&lt;/p&gt;&#10;&lt;h2 id="user-and-permission-failures"&gt;&lt;a href="#user-and-permission-failures" class="header-anchor"&gt;&lt;/a&gt;User and permission failures&#13;&#10;&lt;/h2&gt;&lt;p&gt;If startup scripts report that the configured user does not exist or lacks permissions, review the &lt;code&gt;RUNAS&lt;/code&gt; value in the &lt;code&gt;runjava&lt;/code&gt;, &lt;code&gt;install&lt;/code&gt;, and &lt;code&gt;opennms&lt;/code&gt; scripts. For a controlled test environment, it can be set explicitly:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RUNAS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Use a dedicated service account and minimal permissions for a production deployment.&lt;/p&gt;&#10;&lt;h2 id="postgresql-authentication"&gt;&lt;a href="#postgresql-authentication" class="header-anchor"&gt;&lt;/a&gt;PostgreSQL authentication&#13;&#10;&lt;/h2&gt;&lt;p&gt;A common installation failure is:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The server requested SCRAM-based authentication,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;but the password is an empty string.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;This means the installer reached PostgreSQL but did not receive a valid password. Verify the OpenNMS datasource configuration, the database role password, and the matching &lt;code&gt;pg_hba.conf&lt;/code&gt; rule. Test the same credentials with &lt;code&gt;psql&lt;/code&gt; before rerunning the OpenNMS installer.&lt;/p&gt;&#10;&lt;h2 id="remote-debugging"&gt;&lt;a href="#remote-debugging" class="header-anchor"&gt;&lt;/a&gt;Remote debugging&#13;&#10;&lt;/h2&gt;&lt;p&gt;Enable the JVM debug agent on port &lt;code&gt;8001&lt;/code&gt;, then create a Remote JVM Debug configuration in IntelliJ IDEA. Bind the debug listener to a trusted interface only, and restrict the port with a firewall or SSH tunnel because the Java debug protocol must not be exposed publicly.&lt;/p&gt;&#10;&lt;p&gt;The OpenNMS web interface is available on port &lt;code&gt;8980&lt;/code&gt; by default.&lt;/p&gt;&#10;&lt;h2 id="core-and-minion-deployment"&gt;&lt;a href="#core-and-minion-deployment" class="header-anchor"&gt;&lt;/a&gt;Core and Minion deployment&#13;&#10;&lt;/h2&gt;&lt;p&gt;The distributed topology consists of:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;OpenNMS Core for event processing, persistence, alarms, and the web console.&lt;/li&gt;&#10;&lt;li&gt;Minion close to monitored networks for collection and remote execution.&lt;/li&gt;&#10;&lt;li&gt;gRPC for communication between Core and Minion.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The critical checks are:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Core exposes the configured gRPC endpoint.&lt;/li&gt;&#10;&lt;li&gt;Minion can resolve and reach the Core address.&lt;/li&gt;&#10;&lt;li&gt;Certificates, credentials, and location identifiers match.&lt;/li&gt;&#10;&lt;li&gt;The Minion appears online in the OpenNMS console.&lt;/li&gt;&#10;&lt;li&gt;A test collection or scan can be executed from the expected location.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Treat network reachability, authentication, and location configuration as separate concerns. Verifying them independently makes distributed deployment failures much easier to diagnose.&lt;/p&gt;&#10;</description></item></channel></rss>