[修改]修改网络模式为host,调整了各个服务的网络地址
This commit is contained in:
@@ -4,12 +4,14 @@ services:
|
||||
ports:
|
||||
- 2379:2379
|
||||
- 2380:2370
|
||||
network_mode: host
|
||||
prometheus:
|
||||
build: docker/prometheus
|
||||
ports:
|
||||
- 9090:9090
|
||||
depends_on:
|
||||
- node-exporter
|
||||
network_mode: host
|
||||
panel:
|
||||
build: management-panel
|
||||
# volumes:
|
||||
@@ -31,4 +33,5 @@ services:
|
||||
volumes:
|
||||
- '/:/host:ro'
|
||||
opcua-exporter:
|
||||
build: opcua-exporter
|
||||
build: opcua-exporter
|
||||
network_mode: host
|
||||
@@ -1,6 +1,6 @@
|
||||
backend = "etcd"
|
||||
nodes = [
|
||||
"http://etcd:2379",
|
||||
"http://127.0.0.1:2379",
|
||||
]
|
||||
watch = true
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ scrape_configs:
|
||||
- job_name: 'node_exporter'
|
||||
scrape_interval: {{ getv "/time/node_exporter_scrape_interval"}}{{ getv "/time/node_exporter_scrape_interval_unit" }}
|
||||
static_configs:
|
||||
- targets: [ 'node-exporter:9100' ]
|
||||
- targets: [ '127.0.0.1:9100' ]
|
||||
|
||||
- job_name: 'opcua_exporter'
|
||||
scrape_interval: {{ getv "/time/opcua_scrape_interval"}}{{ getv "/time/opcua_scrape_interval_unit" }}
|
||||
static_configs:
|
||||
- targets: [ 'opcua-exporter:8191' ]
|
||||
- targets: [ '127.0.0.1:8191' ]
|
||||
{{ if getv "/remote_write/state" }}
|
||||
remote_write:
|
||||
- url: {{ getv "/remote_write/url" }}
|
||||
|
||||
@@ -4,8 +4,8 @@ global:
|
||||
scrape_configs:
|
||||
- job_name: 'node_exporter'
|
||||
static_configs:
|
||||
- targets: [ '172.17.0.1:9100' ]
|
||||
- targets: [ '127.0.0.1:9100' ]
|
||||
|
||||
- job_name: 'opcua_exporter'
|
||||
static_configs:
|
||||
- targets: [ 'opcua-exporter:8191' ]
|
||||
- targets: [ '127.0.0.1:8191' ]
|
||||
@@ -5,7 +5,7 @@ FROM openeuler/openeuler:24.03 AS dev
|
||||
|
||||
# 更新系统和安装软件包
|
||||
RUN dnf update -y && \
|
||||
dnf install -y git php-cli php-bcmath php-mbstring php-pdo php-pecl-zip php-opcache php-sodium php-intl php-pear php-devel c-ares-devel libcurl-devel openssl-devel brotli brotli-devel net-tools && \
|
||||
dnf install -y git php-cli php-bcmath php-mbstring php-pdo php-pecl-zip php-opcache php-sodium php-intl php-pear php-devel c-ares-devel libcurl-devel openssl-devel brotli brotli-devel net-tools NetworkManager && \
|
||||
dnf clean all && \
|
||||
rm -rf /var/cache/dnf/*
|
||||
|
||||
@@ -43,7 +43,7 @@ RUN npm config set registry https://registry.npmmirror.com && \
|
||||
|
||||
FROM openeuler/openeuler:24.03 AS runtime
|
||||
RUN dnf update -y \
|
||||
&& dnf install php-cli php-bcmath php-mbstring php-pdo php-pecl-zip php-posix php-sodium php-xml php-intl php-opcache c-ares libcurl openssl brotli net-tools -y \
|
||||
&& dnf install php-cli php-bcmath php-mbstring php-pdo php-pecl-zip php-posix php-sodium php-xml php-intl php-opcache c-ares libcurl openssl brotli net-tools NetworkManager -y \
|
||||
&& dnf clean all && rm -rf /var/cache/dnf/*
|
||||
|
||||
RUN mkdir -p /usr/lib64/php/modules/
|
||||
|
||||
@@ -6,7 +6,7 @@ use GuzzleHttp\Client;
|
||||
class EtcdService
|
||||
{
|
||||
protected $client;
|
||||
protected $baseUri = 'http://etcd:2379/v3/'; // etcd 默认地址
|
||||
protected $baseUri = 'http://127.0.0.1:2379/v3/'; // etcd 默认地址
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ use GuzzleHttp\Client;
|
||||
class PrometheusService
|
||||
{
|
||||
protected $client;
|
||||
protected $baseUri = 'http://prometheus:9090/api/v1/'; // Prometheus 的默认地址
|
||||
protected $baseUri = 'http://127.0.0.1:9090/api/v1/'; // Prometheus 的默认地址
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
backend = "etcd"
|
||||
nodes = [
|
||||
"http://etcd:2379",
|
||||
"http://127.0.0.1:2379",
|
||||
]
|
||||
watch = true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user