{"id":372489,"date":"2024-05-21T05:13:27","date_gmt":"2024-05-21T05:13:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=372489"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=372489","title":{"rendered":"<span>\u0423\u043c\u043d\u044b\u0439 \u0434\u043e\u043c \u043d\u0430 openHAB+MQTT+Arduino. \u0427\u0430\u0441\u0442\u044c 1: \u041a\u043b\u0430\u0441\u0442\u0435\u0440<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c openHAB \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0421\u0442\u0430\u0432\u0438\u043c \u0434\u0432\u0430 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c High availability, \u043f\u0440\u0438 \u043e\u0442\u043a\u0430\u0437\u0435 \u0445\u043e\u0441\u0442\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0430 \u0441 openHAB \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u0418 \u0432\u0441\u0435 \u0431\u044b \u043d\u0438\u0447\u0435\u0433\u043e, \u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b HA \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0449\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u041a\u0430\u043a\u043e\u0439-\u0442\u043e NAS \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c, \u043d\u043e \u0432\u044b\u0445\u043e\u0434 \u0435\u0433\u043e \u0438\u0437 \u0441\u0442\u0440\u043e\u044f \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u0435\u043d, \u0447\u0435\u043c \u043e\u0442\u043a\u0430\u0437 \u0445\u043e\u0441\u0442\u0430. \u0410 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0430 DRBD \u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c openHAB \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0441\u043c. \u0440\u0438\u0441\u0443\u043d\u043e\u043a \u043d\u0438\u0436\u0435.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a25\/a2e\/5fe\/a25a2e5fe244e02d085672367cdd493a.png\" width=\"1690\" height=\"927\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a25\/a2e\/5fe\/a25a2e5fe244e02d085672367cdd493a.png\"\/><\/figure>\n<h4>\u0418\u0434\u0435\u044f<\/h4>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0438. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b, \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u0430\u043b\u0438\u043d\u043a\u0438 \u0438 \u0442.\u043f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b CentOS 9 Stream, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c keepalived \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043a\u0438\u0434\u044b\u0432\u0430\u043d\u0438\u044f IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e.\u00a0 \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c lsyncd \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 openHAB, \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c mosquitto \u0438, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0432\u0441\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 openHAB<\/h4>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u0442\u0443\u0442 &#8212; <a href=\"https:\/\/www.openhab.org\/docs\/installation\/linux.html\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/www.openhab.org\/docs\/installation\/linux.html<\/u><\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u0434\u043b\u044f CentOS 9 Stream \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>\/etc\/yum.repos.d\/openhab.repo<\/code>\u00a0<br \/>\u0421 \u0442\u0430\u043a\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:\u00a0<\/p>\n<p><code>[openHAB-Stable] \u00a0<br \/>name=openHAB Stable \u00a0<br \/>baseurl=https:\/\/openhab.jfrog.io\/artifactory\/openhab-linuxpkg-rpm\/stable \u00a0<br \/>gpgcheck=1 \u00a0<br \/>gpgkey=\"https:\/\/openhab.jfrog.io\/artifactory\/api\/gpg\/key\/public\" \u00a0<br \/>enabled=1<\/code><\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0434\u0435\u043b\u0430\u0435\u043c:<\/p>\n<p> # dnf update<\/p>\n<p> # dnf install openhab<\/p>\n<p> # dnf install openhab\u2011addons<\/p>\n<p> # dnf install java-17-openjdk<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 java, \u0442\u043e \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:\u00a0<br \/># dnf remove java-11-openjdk\u00a0<\/p>\n<p>\u041b\u0438\u0431\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:\u00a0<\/p>\n<p># alternatives &#8212;config java\u00a0<br \/>\u0418 \u0432\u044b\u0431\u0440\u0430\u0442\u044c 17\u044e \u0432\u0435\u0440\u0441\u0438\u044e.\u00a0<br \/>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443:<\/p>\n<p>#dnf systemctl start openhab\u00a0<\/p>\n<p>#dnf systemctl enable openhab\u00a0<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/IP:8080\" rel=\"noopener noreferrer nofollow\"><u>http:\/\/IP:8080<\/u><\/a>\u00a0<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u0430\u0441\u0442\u0435\u0440 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.\u00a0<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 keepalived\u00a0<\/h4>\n<p>\u041d\u0430 \u043e\u0431\u043e\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0438\u043c\u0435\u043d\u0430 \u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u0444\u0430\u0439\u043b <code>\/etc\/hosts<\/code>\u00a0<\/p>\n<p><code>10.20.10.41 srv-oh-01<br \/>10.20.10.42 srv-oh-02<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c VRRP \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043d\u043e\u0434\u0430\u0445:\u00a0<\/p>\n<p># dnf install keepalived\u00a0\u00a0<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f<code>\/etc\/keepalived\/keepalived.conf<\/code>:<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<p><code>vrrp_instance failover_oh { \u00a0<br \/>state BACKUP \u00a0<br \/>interface ens192 \u00a0<br \/>virtual_router_id 10 \u00a0<br \/>priority 100 \u00a0<br \/>advert_int 1 \u00a0<br \/>preempt_delay 30 \u00a0<br \/>authentication { \u00a0<br \/>auth_type AH \u00a0<br \/>auth_pass active-pass \u00a0<br \/>} \u00a0<br \/>notify \/etc\/keepalived\/oh.sh \u00a0<br \/>\u00a0<br \/>unicast_peer { \u00a0<br \/>\u00a0\u00a0 10.20.10.42 \u00a0<br \/>} \u00a0<br \/>\u00a0 virtual_ipaddress { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10.20.10.40 dev ens192 label ens192:vip\u00a0 \u00a0<br \/>\u00a0 } \u00a0<br \/>}<\/code>\u00a0<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043d\u043e\u0434\u0430\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c unicast_peer, \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 10.20.10.41.\u00a0<\/p>\n<p>\u041f\u0440\u043e\u0448\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u201cstate BACKUP\u201d, \u0430 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u043e\u0436\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u043e\u0434\u044b \u0440\u0430\u0432\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u043c\u0438 \u0438 \u043a\u0430\u043a\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0440\u0430\u043d\u044c\u0448\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f, \u0442\u043e\u0442 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c, \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043e\u0442\u043a\u0430\u0437\u0430.\u00a0<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u043c\u044b \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c notify-\u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 openHAB, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u043a\u043e \u0432\u0441\u044f\u043a\u0438\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0430\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Telegram) \u0441 \u0434\u0432\u0443\u0445 \u043d\u043e\u0434 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b:\u00a0<\/p>\n<p><code>#!\/bin\/bash \u00a0<br \/>TYPE=$1 \u00a0<br \/>NAME=$2 \u00a0<br \/>STATE=$3 \u00a0<br \/>\u00a0<br \/>case $STATE in \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"MASTER\") systemctl start openhab \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ;; \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"BACKUP\") systemctl stop openhab \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ;; \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"FAULT\")\u00a0 systemctl stop openhab \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 exit 0 \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ;; \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 *)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/usr\/bin\/logger \"oh unknown state\" \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 exit 1 \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ;; \u00a0<br \/>esac<\/code>\u00a0\u00a0<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a keepalived\u00a0<\/p>\n<p># systemctl start keepalived<br \/># systemctl enable keepalived<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043d\u043e\u0434\u0430\u0445:\u00a0<\/p>\n<p># journalctl -af\u00a0<br \/>\u0418 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u043b\u043e\u0433\u0430\u0445 \u043f\u0440\u0438 start\/stop keepalived \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u0435:\u00a0<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<p>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) Backup received priority 0\u00a0advertisement<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) Receive advertisement timeout<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) Entering MASTER STATE<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) setting VIPs.<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) Sending\/queueing gratuitous ARPs on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0systemd[1]: Started openHAB\u00a0\u2014 empowering the smart home.<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) Sending\/queueing gratuitous ARPs on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40<\/p>\n<\/div>\n<\/details>\n<p>\u042f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b keepalived \u043d\u0430 srv-oh-02, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u0430\u043b \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f vIP (10.20.10.40), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c ARP-\u043f\u0430\u043a\u0435\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f openHAB.\u00a0<\/p>\n<p>\u0418\u0442\u0430\u043a \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0435\u0448\u0435\u043d\u0430, IP \u043f\u0435\u0440\u0435\u0435\u0437\u0436\u0430\u0435\u0442, \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.\u00a0<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 lsyncd\u00a0<\/h4>\n<p>\u0412 openHAB \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043b\u0435\u0436\u0430\u0442 \u0432 \/etc\/openhab, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0432\u0435 \u0431\u0430\u0437\u044b &#8212; rrd4 (\u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0438) \u0438 jsondb (\u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b). \u0414\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c lsyncd, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 (\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 rsync) \u0441\u0438\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u0447\u0435\u043c \u0432 \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0442.\u0435. \u0441\u0435\u0440\u0432\u0435\u0440 \u0433\u0434\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043f\u043e\u0437\u0436\u0435, \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b lsyncd \u043d\u0430\u0434\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0438 SSH, \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 1-\u043c \u0434\u0435\u043b\u0430\u0435\u043c:\u00a0<\/p>\n<p># ssh-keygen<br \/># ssh-copy-id srv-oh-02<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f. \u0422\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0437\u0442\u0438 \u043d\u0430 2-\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u044d\u0442\u043e\u0442 \u0436\u0435 \u043a\u043b\u044e\u0447 \u0432 .ssh\/authorized_keys\u00a0<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c lsyncd \u043d\u0430 \u043e\u0431\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:\u00a0<\/p>\n<p># dnf install lsync\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \/etc\/lsyncd.conf, \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u043e\u0439:\u00a0<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<p><code>settings { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 logfile = \"\/var\/log\/lsyncd\/lsyncd.log\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 statusFile = \"\/var\/log\/lsyncd\/lsyncd.status\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 statusInterval = 1, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 nodaemon = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 insist = true \u00a0<br \/>} \u00a0<br \/>sync { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 default.rsync, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 source = \"\/etc\/openhab\/\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 target = \"srv-oh-02:\/etc\/openhab\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delete = 'running', \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --delay = 5, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rsync = { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -- timeout = 3000, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 update = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _extra={\"--temp-dir=\/temp-lsync\/\"}, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 times = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 archive = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 compress = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 perms = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 acls = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 owner = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 verbose = true \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 } \u00a0<br \/>} \u00a0<br \/>sync { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 default.rsync, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 source = \"\/var\/lib\/openhab\/persistence\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 target = \"srv-oh-02:\/var\/lib\/openhab\/persistence\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delete = 'running', \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --delay = 5, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rsync = { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -- timeout = 3000, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 update = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _extra={\"--temp-dir=\/temp-lsync\/\"}, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 times = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 archive = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 compress = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 perms = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 acls = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 owner = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 verbose = true \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 } \u00a0<br \/>} \u00a0<br \/>sync { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 default.rsync, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 source = \"\/var\/lib\/openhab\/jsondb\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 target = \"srv-oh-02:\/var\/lib\/openhab\/jsondb\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delete = 'running', \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --delay = 5, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rsync = { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -- timeout = 3000, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 update = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _extra={\"--temp-dir=\/temp-lsync\/\"}, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 times = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 archive = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 compress = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 perms = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 acls = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 owner = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 verbose = true \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 } \u00a0<br \/>}\u00a0<\/code><\/p>\n<\/div>\n<\/details>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0441\u0435\u043a\u0446\u0438\u044f sync \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.\u00a0<\/p>\n<p>\u041d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u0430\u044f \u0436\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u0432 target\u2019\u0430\u0445 \u043d\u0430\u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 srv-oh-01. \u0415\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043d\u043e\u0434\u0430\u0445 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>\/temp-lsync,<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.\u00a0<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043d\u043e\u0434\u0430\u0445:\u00a0<\/p>\n<p># systemctl start lsyncd<br \/># systemctl enable lsyncd<\/p>\n<p>\u041b\u043e\u0433\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0430\u043a:<br \/># tail -f \/var\/log\/lsyncd\/lsyncd.log\u00a0<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<p>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: 11:32:10 Normal: Calling rsync with filter-list of new\/modified files\/dirs \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Gas.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/ \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/ \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gGas.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gTemperature.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Motion.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Button_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Water_2.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Shutter_3.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Water_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Shutter_2.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Shutter_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Temperature.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Shutter_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gWater.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Humidity.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/Security.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/OU_Toilet_Light.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gLight.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/OU_Temperature.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Door_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Light.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Light_2.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Light_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gShutter.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Gas.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gMotion.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gWindow.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Window_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Motion.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Temperature.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Shutter_4.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Shutter_3.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Shutter_2.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gHumidity.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gDoor.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/Day.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: sending incremental file list \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/Day.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_FamilyRoom_Gas.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_FamilyRoom_Humidity.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_FamilyRoom_Light.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_FamilyRoom_Motion.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_FamilyRoom_Shutter_1.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_FamilyRoom_Shutter_2.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_FamilyRoom_Shutter_3.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_FamilyRoom_Shutter_4.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_FamilyRoom_Temperature.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Button_1.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Door_1.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Gas.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Light_1.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Light_2.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Motion.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Shutter_1.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Shutter_2.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Shutter_3.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Temperature.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Water_1.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Water_2.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/GF_Kitchen_Window_1.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/OU_Temperature.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/OU_Toilet_Light.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/Security.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/gDoor.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/gGas.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/gHumidity.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/gLight.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/gMotion.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/gShutter.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/gTemperature.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/gWater.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: rrd4j\/gWindow.rrd \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: sent 12,743 bytes\u00a0 received 161,256 bytes\u00a0 115,999.33 bytes\/sec \u00a0<br \/>Jan 24 11:32:11 srv-oh-02 lsyncd[1753681]: total size is 20,477,492\u00a0 speedup is 117.69 \u00a0Jan 24 11:32:11 srv-oh-02 lsyncd[857]: 11:32:11 Normal: Finished a list after exitcode: 0<\/p>\n<\/div>\n<\/details>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 MQTT-\u0431\u0440\u043e\u043a\u0435\u0440\u0430<\/h4>\n<p>\u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0440\u043e\u043a\u0435\u0440\u043e\u0432 &#8212; Mosquitto.\u00a0\u00a0<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430:\u00a0<\/p>\n<p># dnf install epel-release<br \/># dnf install mosquitto\u00a0<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b (<code>\/etc\/mosquitto\/mosquitto.conf<\/code>) \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <strong>password_file<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u043a:<\/p>\n<p><code>listener 1883\u00a0<br \/>log_type all\u00a0<br \/>log_dest file \/var\/log\/mosquitto\/mosquitto.log<br \/>password_file \/etc\/mosquitto\/users.txt<\/code>\u00a0<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f openhab:\u00a0<\/p>\n<p> # mosquitto_passwd -c \/etc\/mosquitto\/users.txt openhab<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u0430\u043a:\u00a0<\/p>\n<p> # mosquitto_passwd -b \/etc\/mosquitto\/users.txt user1 password\u00a0<br \/>\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0444\u0430\u0439\u043b:\u00a0<\/p>\n<p># chmod 600 \/etc\/mosquitto\/users.txt<\/p>\n<p># chown mosquitto:mosquitto \/etc\/mosquitto\/users.txt<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0442\u0443\u0442 &#8212; <a href=\"https:\/\/mosquitto.org\/man\/mosquitto_passwd-1.html\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/mosquitto.org\/man\/mosquitto_passwd-1.html<\/u><\/a>\u00a0<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a:\u00a0<\/p>\n<p># systemctl start mosquitto<br \/># systemctl enable mosquitto<\/p>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c mosquitto \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c MQTT Binding \u0432 openHAB<\/h4>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u0438\u0434\u0435\u043c \u0432 <strong><em>Add-on Store->Bindings->MQTT Binding<\/em><\/strong><em>,<\/em>  \u0436\u043c\u0435\u043c Install.\u00a0\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c MQTT bridge \u0441\u0434\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <strong><em>Settings->Things-> \u0436\u043c\u0435\u043c \u0421\u0418\u041d\u0418\u0419 \u041f\u041b\u042e\u0421->MQTT Binding-> MQTT Broker.<\/em><\/strong><\/p>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043e\u043b\u044f:<\/p>\n<p>Unique ID (\u0414\u043e\u043b\u0436\u0435\u043d \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c);<br \/>Label; <br \/>Location; <br \/>Broker Hostname\/IP; <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u201cShow advanced\u201d \u0438 \u0434\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c: <br \/>Username; <br \/>Password;<br \/>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0436\u043c\u0435\u043c \u201c<strong><em>Create Thing<\/em><\/strong>&#171;<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/45b\/371\/434\/45b3714347b4367d29b341b532d17e39.png\" width=\"852\" height=\"580\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/45b\/371\/434\/45b3714347b4367d29b341b532d17e39.png\"\/><\/figure>\n<p>\u0412 \u0441\u043f\u0438\u0441\u043a\u0435 Things \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f MQTT Broker \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0442\u0430\u0442\u044c Online.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fa0\/27a\/e6f\/fa027ae6f285a30e97e7d4a75e4e0b67.png\" width=\"797\" height=\"282\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fa0\/27a\/e6f\/fa027ae6f285a30e97e7d4a75e4e0b67.png\"\/><\/figure>\n<p>\u0416\u043c\u0435\u043c \u043e\u043f\u044f\u0442\u044c <strong>\u0421\u0418\u041d\u0418\u0419 \u041f\u041b\u042e\u0421<\/strong>, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <strong><em>MQTT Binding<\/em><\/strong> \u0438 \u0437\u0430\u0442\u0435\u043c <strong><em>Generic MQTT Thing<\/em><\/strong>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1fd\/2f1\/2cc\/1fd2f12cc98fd0c445d1dba6b9039a5e.png\" width=\"809\" height=\"513\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1fd\/2f1\/2cc\/1fd2f12cc98fd0c445d1dba6b9039a5e.png\"\/><\/figure>\n<p>\u0422\u0443\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Bridge \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u0438 \u0436\u043c\u0435\u043c <strong><em>\u201cCreate Thing\u201d<\/em><\/strong>.\u00a0\u0412\u043e\u0442 \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9c6\/fbf\/e17\/9c6fbfe17cf3ee91917e90afbadc8685.png\" width=\"809\" height=\"401\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9c6\/fbf\/e17\/9c6fbfe17cf3ee91917e90afbadc8685.png\"\/><\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u0430\u043d\u0430\u043b.\u00a0\u0416\u043c\u0435\u043c \u043d\u0430 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0439\u0441\u044f <strong><em>Generic MQTT Thing<\/em><\/strong> \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 <strong><em>Channels<\/em><\/strong>.\u00a0<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c <strong><em>&#171;Add Channel&#187;<\/em><\/strong>.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ade\/7ff\/b7d\/ade7ffb7d7e310810b4b23434e5aa542.png\" width=\"823\" height=\"783\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ade\/7ff\/b7d\/ade7ffb7d7e310810b4b23434e5aa542.png\"\/><\/figure>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043d\u0430\u043b \u0434\u043b\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0432 \u043a\u0443\u0445\u043d\u0435, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c Channel Identifier (\u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c), Label, \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c Description, \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u0438\u043f \u201cNumber\u201d, \u043e\u0442\u043a\u0440\u043e\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044f:\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/332\/9fc\/291\/3329fc291d82f82d37271783f5a4e006.png\" width=\"737\" height=\"179\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/332\/9fc\/291\/3329fc291d82f82d37271783f5a4e006.png\"\/><\/figure>\n<p>\u0422\u0443\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u201cMQTT State Topic\u201d, \u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u201cShow advanced\u201d\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5a3\/013\/3b4\/5a30133b41f5c7b5e55468abafd9c24f.png\" width=\"724\" height=\"129\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5a3\/013\/3b4\/5a30133b41f5c7b5e55468abafd9c24f.png\"\/><\/figure>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f &#8212; \u0433\u0440\u0430\u0434\u0443\u0441 \u0426\u0435\u043b\u044c\u0441\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b29\/95f\/b3f\/b2995fb3f8a0ea0c3d80411544ffc4a2.png\" width=\"724\" height=\"136\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b29\/95f\/b3f\/b2995fb3f8a0ea0c3d80411544ffc4a2.png\"\/><\/figure>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430, \u0442\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043e \u0434\u0435\u0441\u044f\u0442\u044b\u0445 \u0433\u0440\u0430\u0434\u0443\u0441\u0430. \u0416\u043c\u0435\u043c <strong><em>\u201cCreate\u201d<\/em><\/strong>.\u00a0<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 Item \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0430:\u00a0<\/p>\n<p><em>Number\u00a0\u00a0 GF_Kitchen_Temperature\u00a0 &#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 [%.1f]%unit%&#187;\u00a0\u00a0\u00a0 &lt;temperature>\u00a0\u00a0\u00a0 (GF_Kitchen, gTemperature)\u00a0\u00a0\u00a0 [&#171;Temperature&#187;]<\/em>\u00a0<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0436\u043c\u0435\u043c \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0432\u0448\u0435\u0439\u0441\u044f \u043a\u0430\u043d\u0430\u043b, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0437\u0435\u043b\u0435\u043d\u044b\u0439 \u043f\u043b\u044e\u0441\u0438\u043a <strong><em>\u201cAdd link to Item\u201d<\/em><\/strong>, \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0435 \u043e\u043a\u043e\u0448\u043a\u043e:\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0ca\/b12\/df6\/0cab12df60b37d6b8b5a73d167c96d74.png\" width=\"795\" height=\"418\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0ca\/b12\/df6\/0cab12df60b37d6b8b5a73d167c96d74.png\"\/><\/figure>\n<p>\u0422\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 Item, \u043d\u043e \u0443 \u043d\u0430\u0441 \u043e\u043d \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0436\u043c\u0435\u043c <strong><em>\u201dItem to Link\u201d<\/em><\/strong>, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u0438 \u0436\u043c\u0435\u043c <strong><em>\u201cLink\u201d<\/em><\/strong>.\u00a0<\/p>\n<p>\u0412\u0441\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0432 \u043a\u0430\u043d\u0430\u043b <code>oh\/kitchen\/temp<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u0442\u043e openHAB \u0435\u0433\u043e \u043e\u0442\u0442\u0443\u0434\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u0442.\u00a0\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5ef\/049\/51f\/5ef04951fe7d6ea08d1ffd79887711e1.png\" width=\"1573\" height=\"279\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ef\/049\/51f\/5ef04951fe7d6ea08d1ffd79887711e1.png\"\/><\/figure>\n<h4>MQTT Explorer \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043e\u0442\u043b\u0430\u0434\u043a\u0438<\/h4>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 MQTT Explorer, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043e\u0442\u0441\u044e\u0434\u0430 &#8212; <a href=\"http:\/\/mqtt-explorer.com\/\" rel=\"noopener noreferrer nofollow\"><u>http:\/\/mqtt-explorer.com\/<\/u><\/a>\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e95\/f48\/939\/e95f4893922646548217f0ef500066d5.png\" width=\"1020\" height=\"633\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e95\/f48\/939\/e95f4893922646548217f0ef500066d5.png\"\/><\/figure>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u0438 \u043c\u043e\u0436\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u044c\/\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e\u043f\u0438\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/40e\/e4d\/2b2\/40ee4d2b2b764380c86405a6bb3c692d.png\" width=\"1033\" height=\"756\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/40e\/e4d\/2b2\/40ee4d2b2b764380c86405a6bb3c692d.png\"\/><\/figure>\n<p>\u0423 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c EMQX \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u044b\u0439 MQTT, \u0438\u043b\u0438 \u043f\u043e\u0434\u043d\u044f\u0442\u044c mosquitto \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043c\u043e\u0441\u0442\u0430 \u0438 \u043a\u0430\u043a-\u0442\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 openHAB\u00a0 \u0447\u0435\u0440\u0435\u0437 lsyncd \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0422\u043e\u043f\u0438\u043a\u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 MQTT-\u0431\u0440\u043e\u043a\u0435\u0440\u0430\u0445 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043c\u043e\u0436\u043d\u043e.\u00a0<\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c openHAB. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/806343\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0430 \u043d\u0430 Arduino, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c Ethernet, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043a MQTT-\u0431\u0440\u043e\u043a\u0435\u0440\u0443 \u0438 \u0441\u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\/\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u043b\u0435 \u0438 \u0442.\u043f.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/804659\/\"> https:\/\/habr.com\/ru\/articles\/804659\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c openHAB \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0421\u0442\u0430\u0432\u0438\u043c \u0434\u0432\u0430 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c High availability, \u043f\u0440\u0438 \u043e\u0442\u043a\u0430\u0437\u0435 \u0445\u043e\u0441\u0442\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0430 \u0441 openHAB \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u0418 \u0432\u0441\u0435 \u0431\u044b \u043d\u0438\u0447\u0435\u0433\u043e, \u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b HA \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0449\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u041a\u0430\u043a\u043e\u0439-\u0442\u043e NAS \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c, \u043d\u043e \u0432\u044b\u0445\u043e\u0434 \u0435\u0433\u043e \u0438\u0437 \u0441\u0442\u0440\u043e\u044f \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u0435\u043d, \u0447\u0435\u043c \u043e\u0442\u043a\u0430\u0437 \u0445\u043e\u0441\u0442\u0430. \u0410 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0430 DRBD \u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c openHAB \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0441\u043c. \u0440\u0438\u0441\u0443\u043d\u043e\u043a \u043d\u0438\u0436\u0435.\u00a0<\/p>\n<figure class=\"full-width\"><\/figure>\n<h4>\u0418\u0434\u0435\u044f<\/h4>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0438. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b, \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u0430\u043b\u0438\u043d\u043a\u0438 \u0438 \u0442.\u043f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b CentOS 9 Stream, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c keepalived \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043a\u0438\u0434\u044b\u0432\u0430\u043d\u0438\u044f IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e.\u00a0 \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c lsyncd \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 openHAB, \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c mosquitto \u0438, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0432\u0441\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 openHAB<\/h4>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u0442\u0443\u0442 &#8212; <a href=\"https:\/\/www.openhab.org\/docs\/installation\/linux.html\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/www.openhab.org\/docs\/installation\/linux.html<\/u><\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u0434\u043b\u044f CentOS 9 Stream \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>\/etc\/yum.repos.d\/openhab.repo<\/code>\u00a0<br \/>\u0421 \u0442\u0430\u043a\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:\u00a0<\/p>\n<p><code>[openHAB-Stable] \u00a0<br \/>name=openHAB Stable \u00a0<br \/>baseurl=https:\/\/openhab.jfrog.io\/artifactory\/openhab-linuxpkg-rpm\/stable \u00a0<br \/>gpgcheck=1 \u00a0<br \/>gpgkey=\"https:\/\/openhab.jfrog.io\/artifactory\/api\/gpg\/key\/public\" \u00a0<br \/>enabled=1<\/code><\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0434\u0435\u043b\u0430\u0435\u043c:<\/p>\n<p> # dnf update<\/p>\n<p> # dnf install openhab<\/p>\n<p> # dnf install openhab\u2011addons<\/p>\n<p> # dnf install java-17-openjdk<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 java, \u0442\u043e \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:\u00a0<br \/># dnf remove java-11-openjdk\u00a0<\/p>\n<p>\u041b\u0438\u0431\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:\u00a0<\/p>\n<p># alternatives &#8212;config java\u00a0<br \/>\u0418 \u0432\u044b\u0431\u0440\u0430\u0442\u044c 17\u044e \u0432\u0435\u0440\u0441\u0438\u044e.\u00a0<br \/>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443:<\/p>\n<p>#dnf systemctl start openhab\u00a0<\/p>\n<p>#dnf systemctl enable openhab\u00a0<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/IP:8080\" rel=\"noopener noreferrer nofollow\"><u>http:\/\/IP:8080<\/u><\/a>\u00a0<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u0430\u0441\u0442\u0435\u0440 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.\u00a0<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 keepalived\u00a0<\/h4>\n<p>\u041d\u0430 \u043e\u0431\u043e\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0438\u043c\u0435\u043d\u0430 \u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u0444\u0430\u0439\u043b <code>\/etc\/hosts<\/code>\u00a0<\/p>\n<p><code>10.20.10.41 srv-oh-01<br \/>10.20.10.42 srv-oh-02<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c VRRP \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043d\u043e\u0434\u0430\u0445:\u00a0<\/p>\n<p># dnf install keepalived\u00a0\u00a0<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f<code>\/etc\/keepalived\/keepalived.conf<\/code>:<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<p><code>vrrp_instance failover_oh { \u00a0<br \/>state BACKUP \u00a0<br \/>interface ens192 \u00a0<br \/>virtual_router_id 10 \u00a0<br \/>priority 100 \u00a0<br \/>advert_int 1 \u00a0<br \/>preempt_delay 30 \u00a0<br \/>authentication { \u00a0<br \/>auth_type AH \u00a0<br \/>auth_pass active-pass \u00a0<br \/>} \u00a0<br \/>notify \/etc\/keepalived\/oh.sh \u00a0<br \/>\u00a0<br \/>unicast_peer { \u00a0<br \/>\u00a0\u00a0 10.20.10.42 \u00a0<br \/>} \u00a0<br \/>\u00a0 virtual_ipaddress { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10.20.10.40 dev ens192 label ens192:vip\u00a0 \u00a0<br \/>\u00a0 } \u00a0<br \/>}<\/code>\u00a0<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043d\u043e\u0434\u0430\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c unicast_peer, \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 10.20.10.41.\u00a0<\/p>\n<p>\u041f\u0440\u043e\u0448\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u201cstate BACKUP\u201d, \u0430 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u043e\u0436\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u043e\u0434\u044b \u0440\u0430\u0432\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u043c\u0438 \u0438 \u043a\u0430\u043a\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0440\u0430\u043d\u044c\u0448\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f, \u0442\u043e\u0442 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c, \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043e\u0442\u043a\u0430\u0437\u0430.\u00a0<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u043c\u044b \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c notify-\u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 openHAB, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u043a\u043e \u0432\u0441\u044f\u043a\u0438\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0430\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Telegram) \u0441 \u0434\u0432\u0443\u0445 \u043d\u043e\u0434 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b:\u00a0<\/p>\n<p><code>#!\/bin\/bash \u00a0<br \/>TYPE=$1 \u00a0<br \/>NAME=$2 \u00a0<br \/>STATE=$3 \u00a0<br \/>\u00a0<br \/>case $STATE in \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"MASTER\") systemctl start openhab \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ;; \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"BACKUP\") systemctl stop openhab \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ;; \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"FAULT\")\u00a0 systemctl stop openhab \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 exit 0 \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ;; \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 *)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/usr\/bin\/logger \"oh unknown state\" \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 exit 1 \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ;; \u00a0<br \/>esac<\/code>\u00a0\u00a0<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a keepalived\u00a0<\/p>\n<p># systemctl start keepalived<br \/># systemctl enable keepalived<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043d\u043e\u0434\u0430\u0445:\u00a0<\/p>\n<p># journalctl -af\u00a0<br \/>\u0418 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u043b\u043e\u0433\u0430\u0445 \u043f\u0440\u0438 start\/stop keepalived \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u0435:\u00a0<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<p>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) Backup received priority 0\u00a0advertisement<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) Receive advertisement timeout<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) Entering MASTER STATE<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) setting VIPs.<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) Sending\/queueing gratuitous ARPs on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:15\u00a0srv\u2011oh-01\u00a0systemd[1]: Started openHAB\u00a0\u2014 empowering the smart home.<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: (failover_oh) Sending\/queueing gratuitous ARPs on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40\u00a0<br \/>Jan 24 11:32:20\u00a0srv\u2011oh-01\u00a0Keepalived_vrrp[924]: Sending gratuitous ARP on ens192\u00a0for 10.20.10.40<\/p>\n<\/div>\n<\/details>\n<p>\u042f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b keepalived \u043d\u0430 srv-oh-02, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u0430\u043b \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f vIP (10.20.10.40), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c ARP-\u043f\u0430\u043a\u0435\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f openHAB.\u00a0<\/p>\n<p>\u0418\u0442\u0430\u043a \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0435\u0448\u0435\u043d\u0430, IP \u043f\u0435\u0440\u0435\u0435\u0437\u0436\u0430\u0435\u0442, \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.\u00a0<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 lsyncd\u00a0<\/h4>\n<p>\u0412 openHAB \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043b\u0435\u0436\u0430\u0442 \u0432 \/etc\/openhab, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0432\u0435 \u0431\u0430\u0437\u044b &#8212; rrd4 (\u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0438) \u0438 jsondb (\u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b). \u0414\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c lsyncd, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 (\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 rsync) \u0441\u0438\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u0447\u0435\u043c \u0432 \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0442.\u0435. \u0441\u0435\u0440\u0432\u0435\u0440 \u0433\u0434\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043f\u043e\u0437\u0436\u0435, \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b lsyncd \u043d\u0430\u0434\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0438 SSH, \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 1-\u043c \u0434\u0435\u043b\u0430\u0435\u043c:\u00a0<\/p>\n<p># ssh-keygen<br \/># ssh-copy-id srv-oh-02<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f. \u0422\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0437\u0442\u0438 \u043d\u0430 2-\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u044d\u0442\u043e\u0442 \u0436\u0435 \u043a\u043b\u044e\u0447 \u0432 .ssh\/authorized_keys\u00a0<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c lsyncd \u043d\u0430 \u043e\u0431\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:\u00a0<\/p>\n<p># dnf install lsync\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \/etc\/lsyncd.conf, \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u043e\u0439:\u00a0<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<p><code>settings { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 logfile = \"\/var\/log\/lsyncd\/lsyncd.log\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 statusFile = \"\/var\/log\/lsyncd\/lsyncd.status\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 statusInterval = 1, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 nodaemon = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 insist = true \u00a0<br \/>} \u00a0<br \/>sync { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 default.rsync, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 source = \"\/etc\/openhab\/\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 target = \"srv-oh-02:\/etc\/openhab\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delete = 'running', \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --delay = 5, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rsync = { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -- timeout = 3000, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 update = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _extra={\"--temp-dir=\/temp-lsync\/\"}, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 times = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 archive = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 compress = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 perms = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 acls = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 owner = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 verbose = true \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 } \u00a0<br \/>} \u00a0<br \/>sync { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 default.rsync, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 source = \"\/var\/lib\/openhab\/persistence\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 target = \"srv-oh-02:\/var\/lib\/openhab\/persistence\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delete = 'running', \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --delay = 5, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rsync = { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -- timeout = 3000, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 update = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _extra={\"--temp-dir=\/temp-lsync\/\"}, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 times = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 archive = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 compress = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 perms = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 acls = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 owner = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 verbose = true \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 } \u00a0<br \/>} \u00a0<br \/>sync { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 default.rsync, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 source = \"\/var\/lib\/openhab\/jsondb\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 target = \"srv-oh-02:\/var\/lib\/openhab\/jsondb\", \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delete = 'running', \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --delay = 5, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rsync = { \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -- timeout = 3000, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 update = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _extra={\"--temp-dir=\/temp-lsync\/\"}, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 times = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 archive = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 compress = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 perms = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 acls = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 owner = true, \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 verbose = true \u00a0<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 } \u00a0<br \/>}\u00a0<\/code><\/p>\n<\/div>\n<\/details>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0441\u0435\u043a\u0446\u0438\u044f sync \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.\u00a0<\/p>\n<p>\u041d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u0430\u044f \u0436\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u0432 target\u2019\u0430\u0445 \u043d\u0430\u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 srv-oh-01. \u0415\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043d\u043e\u0434\u0430\u0445 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>\/temp-lsync,<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.\u00a0<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u043d\u043e\u0434\u0430\u0445:\u00a0<\/p>\n<p># systemctl start lsyncd<br \/># systemctl enable lsyncd<\/p>\n<p>\u041b\u043e\u0433\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0430\u043a:<br \/># tail -f \/var\/log\/lsyncd\/lsyncd.log\u00a0<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<p>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: 11:32:10 Normal: Calling rsync with filter-list of new\/modified files\/dirs \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Gas.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/ \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/ \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gGas.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gTemperature.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Motion.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Button_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Water_2.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Shutter_3.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Water_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Shutter_2.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_Kitchen_Shutter_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Temperature.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Shutter_1.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/gWater.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/GF_FamilyRoom_Humidity.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/Security.rrd \u00a0<br \/>Jan 24 11:32:10 srv-oh-02 lsyncd[857]: \/rrd4j\/OU_Toilet_Light.rrd \u00a0<br \/>Jan 24 11:32:10<\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-372489","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/372489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=372489"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/372489\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=372489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=372489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=372489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}