From ed6d937fc30254c3dff21a9e4c36022b34707a00 Mon Sep 17 00:00:00 2001 From: icey-yu <1186114839@qq.com> Date: Wed, 18 Dec 2024 16:35:08 +0800 Subject: [PATCH] chore: node exporter --- .env | 1 + config/openim-api.yml | 2 +- config/openim-msggateway.yml | 5 ++--- config/openim-msgtransfer.yml | 2 +- config/openim-push.yml | 4 ++-- config/openim-rpc-auth.yml | 4 ++-- config/openim-rpc-conversation.yml | 4 ++-- config/openim-rpc-friend.yml | 4 ++-- config/openim-rpc-group.yml | 4 ++-- config/openim-rpc-msg.yml | 4 ++-- config/openim-rpc-third.yml | 4 ++-- config/openim-rpc-user.yml | 4 ++-- config/prometheus.yml | 2 +- config/share.yml | 1 + docker-compose.yml | 18 ++++++++++++++++++ 15 files changed, 41 insertions(+), 22 deletions(-) diff --git a/.env b/.env index 4a39255b80..a615e5096f 100644 --- a/.env +++ b/.env @@ -6,6 +6,7 @@ ETCD_IMAGE=quay.io/coreos/etcd:v3.5.13 PROMETHEUS_IMAGE=prom/prometheus:v2.45.6 ALERTMANAGER_IMAGE=prom/alertmanager:v0.27.0 GRAFANA_IMAGE=grafana/grafana:11.0.1 +NODE_EXPORTER_IMAGE=prom/node-exporter:v1.7.0 OPENIM_WEB_FRONT_IMAGE=openim/openim-web-front:release-v3.8.1 OPENIM_ADMIN_FRONT_IMAGE=openim/openim-admin-front:release-v1.8.3 diff --git a/config/openim-api.yml b/config/openim-api.yml index f063005ec5..103c36f953 100644 --- a/config/openim-api.yml +++ b/config/openim-api.yml @@ -14,6 +14,6 @@ prometheus: autoSetPorts: true # Prometheus listening ports, must match the number of api.ports # It will only take effect when autoSetPorts is set to false. - ports: [ 12002 ] + ports: # This address can be accessed via a browser grafanaURL: diff --git a/config/openim-msggateway.yml b/config/openim-msggateway.yml index b7d6d98477..812df90f7b 100644 --- a/config/openim-msggateway.yml +++ b/config/openim-msggateway.yml @@ -6,15 +6,14 @@ rpc: autoSetPorts: true # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports # It will only take effect when autoSetPorts is set to false. - ports: [ 10140, 10141, 10142, 10143, 10144, 10145, 10146, 10147, 10148, 10149, 10150, 10151, 10152, 10153, 10154, 10155 ] + ports: prometheus: # Enable or disable Prometheus monitoring enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup # It will only take effect when autoSetPorts is set to false. - ports: [ 12140, 12141, 12142, 12143, 12144, 12145, 12146, 12147, 12148, 12149, 12150, 12151, 12152, 12153, 12154, 12155 ] - + ports: # IP address that the RPC/WebSocket service listens on; setting to 0.0.0.0 listens on both internal and external IPs. If left blank, it automatically uses the internal network IP listenIP: 0.0.0.0 diff --git a/config/openim-msgtransfer.yml b/config/openim-msgtransfer.yml index 39b23b222e..52d6a805e1 100644 --- a/config/openim-msgtransfer.yml +++ b/config/openim-msgtransfer.yml @@ -5,4 +5,4 @@ prometheus: autoSetPorts: true # List of ports that Prometheus listens on; each port corresponds to an instance of monitoring. Ensure these are managed accordingly # It will only take effect when autoSetPorts is set to false. - ports: [ 12020, 12021, 12022, 12023, 12024, 12025, 12026, 12027, 12028, 12029, 12030, 12031, 12032, 12033, 12034, 12035 ] + ports: diff --git a/config/openim-push.yml b/config/openim-push.yml index dcc8f1aec9..e983246203 100644 --- a/config/openim-push.yml +++ b/config/openim-push.yml @@ -8,7 +8,7 @@ rpc: autoSetPorts: true # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports # It will only take effect when autoSetPorts is set to false. - ports: [ 10170, 10171, 10172, 10173, 10174, 10175, 10176, 10177, 10178, 10179, 10180, 10181, 10182, 10183, 10184, 10185 ] + ports: prometheus: @@ -16,7 +16,7 @@ prometheus: enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup # It will only take effect when autoSetPorts is set to false. - ports: [ 12170, 12171, 12172, 12173, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 12182, 12183, 12184, 12185, 12186 ] + ports: maxConcurrentWorkers: 3 #Use geTui for offline push notifications, or choose fcm or jpns; corresponding configuration settings must be specified. diff --git a/config/openim-rpc-auth.yml b/config/openim-rpc-auth.yml index 5d6d85b2f2..c42e556c4d 100644 --- a/config/openim-rpc-auth.yml +++ b/config/openim-rpc-auth.yml @@ -8,14 +8,14 @@ rpc: autoSetPorts: true # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports # It will only take effect when autoSetPorts is set to false. - ports: [ 10200 ] + ports: prometheus: # Enable or disable Prometheus monitoring enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup # It will only take effect when autoSetPorts is set to false. - ports: [ 12200 ] + ports: tokenPolicy: # Token validity period, in days diff --git a/config/openim-rpc-conversation.yml b/config/openim-rpc-conversation.yml index eaedfe21f8..e722ac2b00 100644 --- a/config/openim-rpc-conversation.yml +++ b/config/openim-rpc-conversation.yml @@ -8,11 +8,11 @@ rpc: autoSetPorts: true # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports # It will only take effect when autoSetPorts is set to false. - ports: [ 10220 ] + ports: prometheus: # Enable or disable Prometheus monitoring enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup # It will only take effect when autoSetPorts is set to false. - ports: [ 12220 ] + ports: diff --git a/config/openim-rpc-friend.yml b/config/openim-rpc-friend.yml index 920c4860ba..e722ac2b00 100644 --- a/config/openim-rpc-friend.yml +++ b/config/openim-rpc-friend.yml @@ -8,11 +8,11 @@ rpc: autoSetPorts: true # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports # It will only take effect when autoSetPorts is set to false. - ports: [ 10240 ] + ports: prometheus: # Enable or disable Prometheus monitoring enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup # It will only take effect when autoSetPorts is set to false. - ports: [ 12240 ] + ports: diff --git a/config/openim-rpc-group.yml b/config/openim-rpc-group.yml index c48065cca8..252f64c288 100644 --- a/config/openim-rpc-group.yml +++ b/config/openim-rpc-group.yml @@ -8,14 +8,14 @@ rpc: autoSetPorts: true # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports # It will only take effect when autoSetPorts is set to false. - ports: [ 10260 ] + ports: prometheus: # Enable or disable Prometheus monitoring enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup # It will only take effect when autoSetPorts is set to false. - ports: [ 12260 ] + ports: enableHistoryForNewMembers: true diff --git a/config/openim-rpc-msg.yml b/config/openim-rpc-msg.yml index d078546228..17fd3b8f47 100644 --- a/config/openim-rpc-msg.yml +++ b/config/openim-rpc-msg.yml @@ -8,14 +8,14 @@ rpc: autoSetPorts: true # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports # It will only take effect when autoSetPorts is set to false. - ports: [ 10280 ] + ports: prometheus: # Enable or disable Prometheus monitoring enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup # It will only take effect when autoSetPorts is set to false. - ports: [ 12280 ] + ports: # Does sending messages require friend verification diff --git a/config/openim-rpc-third.yml b/config/openim-rpc-third.yml index 95a50fac42..7169e6c611 100644 --- a/config/openim-rpc-third.yml +++ b/config/openim-rpc-third.yml @@ -8,14 +8,14 @@ rpc: autoSetPorts: true # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports # It will only take effect when autoSetPorts is set to false. - ports: [ 10300 ] + ports: prometheus: # Enable or disable Prometheus monitoring enable: true # List of ports that Prometheus listens on; these must match the number of rpc.ports to ensure correct monitoring setup # It will only take effect when autoSetPorts is set to false. - ports: [ 12300 ] + ports: object: diff --git a/config/openim-rpc-user.yml b/config/openim-rpc-user.yml index 3a13358955..337cacd35f 100644 --- a/config/openim-rpc-user.yml +++ b/config/openim-rpc-user.yml @@ -8,11 +8,11 @@ rpc: autoSetPorts: true # List of ports that the RPC service listens on; configuring multiple ports will launch multiple instances. These must match the number of configured prometheus ports # It will only take effect when autoSetPorts is set to false. - ports: [ 10320 ] + ports: prometheus: # Whether to enable prometheus enable: true # Prometheus listening ports, must be consistent with the number of rpc.ports # It will only take effect when autoSetPorts is set to false. - ports: [ 12320 ] + ports: diff --git a/config/prometheus.yml b/config/prometheus.yml index d176bfcbd8..0b13326d17 100644 --- a/config/prometheus.yml +++ b/config/prometheus.yml @@ -25,7 +25,7 @@ scrape_configs: # prometheus fetches application services - job_name: node_exporter static_configs: - - targets: [ 127.0.0.1:20500 ] + - targets: [ 127.0.0.1:19100 ] - job_name: openimserver-openim-api http_sd_configs: diff --git a/config/share.yml b/config/share.yml index 0ed59f2cde..a5fbeac75b 100644 --- a/config/share.yml +++ b/config/share.yml @@ -5,4 +5,5 @@ imAdminUserID: [ imAdmin ] # 1: For Android, iOS, Windows, Mac, and web platforms, only one instance can be online at a time multiLogin: policy: 1 + # max num of tokens in one end maxNumOneEnd: 30 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4334790e19..51dd4d04f0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -194,3 +194,21 @@ services: volumes: - ${DATA_DIR:-./}/components/grafana:/var/lib/grafana network_mode: host + + node-exporter: + image: ${NODE_EXPORTER_IMAGE} + container_name: node-exporter + restart: always + profiles: + - m + volumes: + - /proc:/host/proc:ro + - /sys:/host/sys:ro + - /:/rootfs:ro + command: + - '--path.procfs=/host/proc' + - '--path.sysfs=/host/sys' + - '--path.rootfs=/rootfs' + - '--web.listen-address=:19100' + network_mode: host +