Saltstack stellt Zabbix-Dienst bereitUmfeld
[root@master salt]# Baumprodukt/ Produkt/ |-- Module | |-- Anwendung | | `-- php | | |-- Dateien | | | |-- install.sh | | | |-- oniguruma-devel-6.8.2-2.el8.x86_64.rpm | | | |-- php-7.4.24.tar.gz | | | |-- php-fpm | | | |-- php-fpm.conf | | | |-- php-fpm.service | | | `-- www.conf | | `-- install.sls | |-- Datenbank | | `--mysql | | |-- Dateien | | | |-- install.sh | | | |-- meine.cnf | | | |--mysql-5.7.34-linux-glibc2.12-x86_64.tar.gz | | | |--mysql.server | | | `--mysqld.service | | `-- install.sls | `-- Netz | `-- Apache | |-- Dateien | | |-- apr-1.7.0.tar.gz | | |-- apr-util-1.6.1.tar.gz | | |-- httpd-2.4.49.tar.gz | | |-- httpd.conf | | |-- httpd.service | | |-- index.php | | `-- install.sh | `-- install.sls `-- zabbix |-- apache.sls |-- Dateien | |-- index.php | |-- install.sh | |--mysql.conf | |-- php.ini | |-- vhosts.conf | |-- zabbix-5.4.4.tar.gz | `-- zabbix_server.conf |-- main.sls |--mysql.sls `-- zabbix.sls Installieren Sie httpd, mysql, phpInstallieren Sie httpd[root@master salt]# cat prod/modules/web/apache/install.sls Apache-Dep-Paket: Paket.installiert: -Pakete: - OpenSSL-Entwicklung - pcre-entwicklung - Expat-Entwickler -libtool -gcc - gcc-c++ - machen Apache: Benutzer.anwesend: - Shell: /sbin/nologin -createhome:false -system: wahr Apache-Download: Datei.verwaltet: - Namen: – /usr/src/apr-1.7.0.tar.gz: – Quelle: salt://modules/web/apache/files/apr-1.7.0.tar.gz – /usr/src/apr-util-1.6.1.tar.gz: – Quelle: salt://modules/web/apache/files/apr-util-1.6.1.tar.gz – /usr/src/httpd-2.4.49.tar.gz: - Quelle: salt://modules/web/apache/files/httpd-2.4.49.tar.gz /usr/lib/systemd/system/httpd.service: datei.verwaltet: - Quelle: salt://modules/web/apache/files/httpd.service - Benutzer: root - Gruppe: root - Modus: '0644' salt://modules/web/apache/files/install.sh: cmd.script /usr/local/httpd/conf/httpd.conf: Datei.verwaltet: – Quelle: salt://modules/web/apache/files/httpd.conf - Benutzer: root - Gruppe: root - Modus: '0644' [root@master salt]# cat prod/modules/web/apache/files/install.sh #!/bin/bash cd /usr/src rm -rf apr-1.7.0 apr-util-1.6.1 httpd-2.4.49 tar xf apr-1.7.0.tar.gz tar xf apr-util-1.6.1.tar.gz tar xf httpd-2.4.49.tar.gz cd /usr/src/apr-1.7.0 sed -i '/$RM "$cfgfile"/d' konfigurieren ./configure --prefix=/usr/local/apr && \ machen && machen installieren && \ cd ../apr-util-1.6.1 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && \ machen && machen installieren && \ cd ../httpd-2.4.49 ./configure --prefix=/usr/local/httpd \ --enable-so \ --enable-ssl \ --enable-cgi \ --enable-rewrite \ --mit-zlib \ --mit-pcre \ --with-apr=/usr/local/apr \ --with-apr-util=/usr/local/apr-util/ \ --enable-modules=die meisten \ --enable-mpms-shared=alle \ --mit-mpm=prefork && \ machen && machen installieren && \ systemctl daemon-reload Installieren Sie MySQL[root@master salt]# cat prod/modules/database/mysql/install.sls ncurses-kompatible Bibliotheken: pkg.installiert MySQL-Benutzer erstellen: Benutzer.anwesend: - Name: MySQL -system: wahr -createhome:false - Shell: /sbin/nologin Datenverzeichnis erstellen: datei.verzeichnis: - Name: /opt/Daten - Benutzer: mysql - Gruppe: mysql - Modus: '0755' -makedirs: wahr /usr/src/mysql-5.7.34-linux-glibc2.12-x86_64.tar.gz: datei.verwaltet: - Quelle: salt://modules/database/mysql/files/mysql-5.7.34-linux-glibc2.12-x86_64.tar.gz - Benutzer: root - Gruppe: root - Modus: '0644' salt://modules/database/mysql/files/install.sh: cmd.script Dateien übertragen: datei.verwaltet: - Namen: - /usr/local/mysql/support-files/mysql.server: - Quelle: salt://modules/database/mysql/files/mysql.server – /usr/lib/systemd/system/mysqld.service: - Quelle: salt://modules/database/mysql/files/mysqld.service [root@master salt]# cat prod/modules/database/mysql/files/install.sh #!/bin/bash cd /usr/src tar xf mysql-5.7.34-linux-glibc2.12-x86_64.tar.gz -C /usr/local ln -s /usr/local/mysql-5.7.34-linux-glibc2.12-x86_64 /usr/local/mysql chown -R mysql.mysql /usr/local/mysql* /usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --datadir=/opt/data/ echo 'export PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh Installieren Sie PHP[root@master salt]# cat prod/modules/application/php/install.sls /usr/src/oniguruma-devel-6.8.2-2.el8.x86_64.rpm: datei.verwaltet: – Quelle: salt://modules/application/php/files/oniguruma-devel-6.8.2-2.el8.x86_64.rpm - Benutzer: root - Gruppe: root - Modus: '0644' cmd.run: - Name: yum -y install /usr/src/oniguruma-devel-6.8.2-2.el8.x86_64.rpm dep-Paket-installieren: Paket.installiert: -Pakete: - libxml2 - libxml2-entwickeln - öffnet SSL - OpenSSL-Entwicklung -bzip2 - bzip2-entwicklung - libcurl - libcurl-entwicklung - libicu-entwicklung - libjpeg-turbo - libjpeg-turbo-entwicklung - libpng - libpng-Entwicklung - OpenLDAP-Entwicklung - pcre-entwicklung -Freityp - Freetype-Entwicklung -gmp - gmp-entwicklung - libmcrypt - libmcrypt-Entwicklung - Zeile lesen - Readline-Entwicklung -libxslt - libxslt-Entwicklung -mhash - mhash-entwicklung - php-mysqlnd - libsqlite3x-entwickeln - libzip-entwicklung /usr/src/php-7.4.24.tar.gz: datei.verwaltet: - Quelle: salt://modules/application/php/files/php-7.4.24.tar.gz - Benutzer: root - Gruppe: root - Modus: '0644' #salt://modules/application/php/files/install.sh: # cmd.script kopierephp: datei.verwaltet: - Namen: – /etc/init.d/php-fpm: - Quelle: salt://modules/application/php/files/php-fpm - Benutzer: root - Gruppe: root - Modus: '0755' – /usr/local/php7/etc/php-fpm.conf: – Quelle: salt://modules/application/php/files/php-fpm.conf – /usr/local/php7/etc/php-fpm.d/www.conf: - Quelle: salt://modules/application/php/files/www.conf – /usr/lib/systemd/system/php-fpm.service: – Quelle: salt://modules/application/php/files/php-fpm.service php-fpm.service: Dienst.läuft: -enable: wahr [root@master salt]# cat prod/modules/application/php/files/install.sh #!/bin/bash cd /usr/src rm -rf php-7.4.24 tar xf php-7.4.24.tar.gz cd php-7.4.24 ./configure --prefix=/usr/local/php7 \ --with-config-file-path=/etc \ --enable-fpm \ --disable-debug \ --disable-rpath \ --enable-shared \ --enable-soap \ --mit-openssl \ --enable-bcmath \ --mit-iconv \ --mit-bz2 \ --enable-calendar \ --mit-curl \ --enable-exif \ --enable-ftp \ --enable-gd \ --mit-jpeg \ --with-zlib-dir \ --mit-freetype \ --mit-gettext \ --enable-mbstring \ --enable-pdo \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --mit-readline \ --enable-shmop \ --enable-simplexml \ --enable-sockets \ --mit-zip \ --enable-mysqlnd-compression-support \ --mit-Birne \ --enable-pcntl \ --enable-posix && \ machen && machen installieren Stellen Sie die von Zabbix benötigte Lampenarchitekturumgebung bereit[root@master salt]# cat prod/zabbix/apache.sls "Entwicklungswerkzeuge": pkg.group_installiert enthalten: -modules.web.apache.install /usr/include/httpd: Datei.symlink: – Ziel: /usr/local/apache/include /usr/local/httpd/htdocs/zabbix: datei.verzeichnis: - Benutzer: root - Gruppe: root - Modus: '0775' -makedirs: wahr /usr/local/httpd/htdocs/zabbix/index.php: Datei.verwaltet: – Quelle: salt://zabbix/files/index.php - Benutzer: root - Gruppe: root - Modus: '0644' /usr/local/httpd/conf/extra/vhosts.conf: datei.verwaltet: – Quelle: salt://zabbix/files/vhosts.conf - Benutzer: root - Gruppe: root - Modus: '0644' Zabbix-Apache-Dienst: Dienst.läuft: - Name: httpd -enable: wahr [root@master salt]# cat prod/zabbix/mysql.sls Lampen-Dep-Paket: Paket.installiert: -Pakete: - ncurses-Entwicklung - OpenSSL-Entwicklung - öffnet SSL - cmake - MariaDB-Entwicklung enthalten: -modules.database.mysql.install bietet-mysql-datei: Datei.verwaltet: - Benutzer: root - Gruppe: root - Modus: '0644' - Namen: - /etc/my.cnf: - Quelle: salt://zabbix/files/my.cnf – /etc/ld.so.conf.d/mysql.conf: - Quelle: salt://zabbix/files/mysql.conf /usr/local/include/mysql: Datei.symlink: – Ziel: /usr/local/mysql/include mysqld.dienst: Dienst.läuft: -enable: wahr mysqld-Passwort festlegen: cmd.run: - Name: /usr/local/mysql/bin/mysql -e "Passwort festlegen = Passwort('123456');" Installieren Sie Zabbix[root@master salt]# cat prod/zabbix/zabbix.sls zabbix-dep-pakete: Paket.installiert: -Pakete: - Net-SNMP-Entwicklung - libevent-entwicklung zabbix: Benutzer.anwesend: - Shell: /sbin/nologin -system: wahr -createhome:false /usr/src/zabbix-5.4.4.tar.gz: datei.verwaltet: - Quelle: salt://zabbix/files/zabbix-5.4.4.tar.gz salt://zabbix/files/install.sh: cmd.script /usr/local/etc/zabbix_server.conf: Datei.verwaltet: – Quelle: salt://zabbix/files/zabbix_server.conf /var/lib/mysql: datei.verzeichnis: - Benutzer: root - Gruppe: root - Modus: '0755' /var/lib/mysql/mysql.sock: Datei.symlink: - Ziel: /tmp/mysql.sock zabbix_server: cmd.run: - Namen: -cp -r /usr/src/zabbix-5.4.4/ui/* /usr/local/httpd/htdocs/zabbix/ -zabbix_server - zabbix_agentd /etc/php.ini: datei.verwaltet: - Quelle: salt://zabbix/files/php.ini - Benutzer: root - Gruppe: root - Modus: '0644' Nachladeservice: Dienst.läuft: - neu laden: wahr - Namen: - httpd -php-fpm [root@master salt]# cat prod/zabbix/files/install.sh #!/bin/bash cd /usr/src tar xf zabbix-5.4.4.tar.gz -C /usr/src /usr/local/mysql/bin/mysql -uroot -p123456 -e "Datenbank erstellen, Zabbix-Zeichensatz UTF8, utf8_bin sortieren;" /usr/local/mysql/bin/mysql -uroot -p123456 -e „gewähre alle Privilegien auf zabbix.* an zabbix@localhost, identifiziert durch ‚123‘;“ /usr/local/mysql/bin/mysql -uroot -p123456 -e "Berechtigungen löschen;" cd /usr/src/zabbix-5.4.4/database/mysql/ /usr/local/mysql/bin/mysql -uroot -p123456 zabbix < schema.sql /usr/local/mysql/bin/mysql -uroot -p123456 zabbix < images.sql /usr/local/mysql/bin/mysql -uroot -p123456 zabbix < data.sql cd /usr/src/zabbix-5.4.4 ./configure --enable-server \ --enable-agent \ --mit-mysql \ --mit-net-snmp \ --mit-libcurl \ --with-libxml2 && \ installieren Dies ist das Ende dieses Artikels über die Bereitstellung des Zabbix-Dienstes mit Saltstack. Weitere Informationen zur Bereitstellung des Zabbix-Dienstes mit Saltstack finden Sie in früheren Artikeln auf 123WORDPRESS.COM oder in den folgenden verwandten Artikeln. Ich hoffe, Sie werden 123WORDPRESS.COM auch in Zukunft unterstützen! Das könnte Sie auch interessieren:
|
<<: Detaillierte Erläuterung der Javascript-Ereigniserfassungs- und Bubbling-Methoden
>>: Zusammenfassung der Stiländerungen des Eingabefelds vom Typ „file“
XQuery ist eine Sprache zum Extrahieren von Daten...
Einführung: Die Konfiguration von Docker, auf dem...
In letzter Zeit wurden in neuen Projekten Springc...
Inhaltsverzeichnis 1. Wenn beim Einfügen oder Änd...
Beschreibung der Installationsumgebung •Systemver...
Manchmal kann es vorkommen, dass eine SQL-Anweisu...
Inhaltsverzeichnis Vorwort Keep-Avlive-Hook-Funkt...
Transtion in Vue ist eine Kapselungskomponente f...
So verwenden Sie Iframe: Code kopieren Der Code l...
Überblick Was ist Hafen? Das englische Wort bedeu...
In diesem Artikel wird der spezifische Code für J...
Hinweis: Sie können keine bereichsbezogenen Anima...
Dieser Artikel gibt Ihnen den spezifischen JavaSc...
MySQL-Installationstutorial für Windows-Systeme h...
Inhaltsverzeichnis 1. Array-Induktion 1. Teilen S...