{"id":19607,"date":"2017-06-23T06:31:38","date_gmt":"2017-06-22T22:31:38","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/06\/23\/opennms-centos-7-%e5%ae%a2%e8%a3%bd%e5%8c%96%e5%ae%89%e8%a3%9d%e5%85%89%e7%a2%9f\/"},"modified":"2017-06-23T06:31:38","modified_gmt":"2017-06-22T22:31:38","slug":"opennms-centos-7-%e5%ae%a2%e8%a3%bd%e5%8c%96%e5%ae%89%e8%a3%9d%e5%85%89%e7%a2%9f","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/06\/23\/opennms-centos-7-%e5%ae%a2%e8%a3%bd%e5%8c%96%e5%ae%89%e8%a3%9d%e5%85%89%e7%a2%9f\/","title":{"rendered":"OpenNMS CentOS 7 \u5ba2\u88fd\u5316\u5b89\u88dd\u5149\u789f"},"content":{"rendered":"<p>\u5229\u7528\u6642\u9593\u5b8c\u6210\uff0c\u63a1\u624b\u52d5\u7684\u65b9\u5f0f\u4f86\u9032\u884c\u5f8c\u7e8c\u7684\u8a2d\u5b9a\u5de5\u4f5c<br \/>\u5728 \/root \u76ee\u9304\u4e0b\u653e\u7f6e README \u6a94\u6848\uff0c\u8aaa\u660e\u8a2d\u5b9a\u7684\u6b65\u9a5f\uff01<\/p>\n<p># <span style=\"color: #ff0000;\">cat \/root\/README<\/span><br \/><span style=\"color: #0000ff;\"># \u5e95\u4e0b\u8acb\u4ee5 root \u8eab\u4efd\u57f7\u884c<\/span><br \/><span style=\"color: #0000ff;\"># Java \u8a2d\u5b9a<\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">\/opt\/opennms\/bin\/runjava -s<\/span><\/span><br \/><span style=\"color: #0000ff;\">#<\/span><br \/><span style=\"color: #0000ff;\"># PostgreSQL Server\u521d\u59cb\u5316\u8cc7\u6599\u5eab<\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">\/usr\/bin\/postgresql-setup initdb<\/span><\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">sed -i &#8216;\/^host\/s\/&#8230;..$\/md5\/&#8217; \/var\/lib\/pgsql\/data\/pg_hba.conf[@more@]<\/span><\/span><span style=\"color: #0000ff;\">#<\/span><br \/><span style=\"color: #0000ff;\"># \u91cd\u65b0\u555f\u52d5 PostgreSQL Server<\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">systemctl enable postgresql.service<\/span><\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">systemctl restart postgresql.service<\/span><\/span><br \/><span style=\"color: #0000ff;\">#<\/span><br \/><span style=\"color: #0000ff;\"># PostgreSQL Server \u8cc7\u6599\u5eab\u8a2d\u5b9a\u5e33\u865f\u53ca\u5bc6\u78bc<\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">sudo -u postgres psql -c &#8220;CREATE USER opennms WITH PASSWORD &#8216;\u5bc6\u78bc&#8217;;&#8221;<\/span><\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">sudo -u postgres psql -c &#8220;CREATE DATABASE opennms;&#8221;<\/span><\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">sudo -u postgres psql -c &#8220;GRANT ALL PRIVILEGES ON DATABASE opennms to opennms;&#8221;<\/span><\/span><br \/><span style=\"color: #0000ff;\">#<\/span><br \/><span style=\"color: #0000ff;\"># OpenNMS \u8cc7\u6599\u5eab\u5e33\u865f\u53ca\u5bc6\u78bc\u8a2d\u5b9a<\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">sed -i -e &#8216;s\/password=&#8221;opennms&#8221;\/password=&#8221;\u5bc6\u78bc&#8221;\/&#8217; -e &#8216;s\/password=&#8221;&#8221;\/password=&#8221;\u5bc6\u78bc&#8221;\/&#8217;\u00a0 -e &#8216;s\/user-name=&#8221;postgres&#8221;\/user-name=&#8221;opennms&#8221;\/&#8217; \/opt\/opennms\/etc\/opennms-datasources.xml<\/span><\/span><br \/><span style=\"color: #0000ff;\">#<\/span><br \/><span style=\"color: #0000ff;\"># \u521d\u59cb\u5316 OpenNMS<\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">\/opt\/opennms\/bin\/install -dis<\/span><\/span><br \/><span style=\"color: #0000ff;\">#<\/span><br \/><span style=\"color: #0000ff;\"># RRD \u8a2d\u5b9a<\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">sed -i &#8216;\/MultithreadedJniRrdStrategy\/s\/^#org\/org\/&#8217; \/opt\/opennms\/etc\/rrd-configuration.properties<\/span><\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">sed -i &#8216;\/rrd2\/s\/^#opennms\/opennms\/&#8217; \/opt\/opennms\/etc\/rrd-configuration.properties<\/span><\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">sed -i &#8216;\/rrd2\/s\/^#org\/org\/&#8217; \/opt\/opennms\/etc\/rrd-configuration.properties<\/span><\/span><br \/><span style=\"color: #ff0000;\">#<\/span><br \/><span style=\"color: #0000ff;\"># OpenNMS \u555f\u52d5\u4e26\u8a2d\u5b9a\u958b\u6a5f\u6642\u555f\u52d5<\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">systemctl enable opennms.service<\/span><\/span><br \/><span style=\"color: #0000ff;\"># <span style=\"color: #ff0000;\">systemctl start opennms.service<\/span><\/span><\/p>\n<p>\u57f7\u884c<span style=\"color: #ff0000;\">\u7d05\u5b57<\/span>\u90e8\u5206\u7684\u6307\u4ee4<\/p>\n<p>\u5982\u679c\u78b0\u5230 SELinux \u7684\u554f\u984c\uff0c\u53ef\u4ee5\u5148\u8a66\u8457\u95dc\u6389\uff01<br \/># <span style=\"color: #ff0000;\">sed -i &#8216;s\/^(SELINUX=).*$\/1&#8221;disabled\/&#8217; \/etc\/selinux\/config<\/span><br \/># <span style=\"color: #ff0000;\">sync;sync;sync;reboot<\/span><\/p>\n<p>\u5982\u679c\u8981\u53d6\u6d88 OpenNMS \u81ea\u52d5\u66f4\u65b0<br \/># <span style=\"color: #ff0000;\">sed -i &#8216;\/gpgcheck\/aenable=0&#8217; \/etc\/yum.repos.d\/opennms-repo-stable-rhel7.repo<\/span><br \/>\u53cd\u4e4b<br \/># <span style=\"color: #ff0000;\">sed -i &#8216;s\/enable=0\/enable=1\/&#8217; \/etc\/yum.repos.d\/opennms-repo-stable-rhel7.repo<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5229\u7528\u6642\u9593\u5b8c\u6210\uff0c\u63a1\u624b\u52d5\u7684\u65b9\u5f0f\u4f86\u9032\u884c\u5f8c\u7e8c\u7684\u8a2d\u5b9a\u5de5\u4f5c\u5728 \/root \u76ee\u9304\u4e0b\u653e\u7f6e README \u6a94\u6848\uff0c\u8aaa\u660e\u8a2d\u5b9a\u7684\u6b65\u9a5f\uff01 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/06\/23\/opennms-centos-7-%e5%ae%a2%e8%a3%bd%e5%8c%96%e5%ae%89%e8%a3%9d%e5%85%89%e7%a2%9f\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008OpenNMS CentOS 7 \u5ba2\u88fd\u5316\u5b89\u88dd\u5149\u789f\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,151,150],"tags":[],"class_list":["post-19607","post","type-post","status-publish","format-standard","hentry","category-c-78462","category-c-78534","category-c-78533"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["689383"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19607"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=19607"}],"version-history":[{"count":0,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19607\/revisions"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=19607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=19607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=19607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}