Memoria de despliegue de Apache Tomcat

Llevamos trabajando con Tomcat aproximadamente 5 años.
Lo usamos principalmente para poner en línea estas aplicaciones:

  • Geoserver
  • Geonetwork

Memoria de instalación de Apache Tomcat

Memoria de instalación de Geoserver

Versión actual: (2022-11-28)

  • Producción: 2.17.0
  • Desarrollo: 2.22.0

Básicamente Geoserver es Plug and PLay. En versiones anteriores se tuvieron problemas como la dependencia de Java 8, lo cual ya está superado.

Agregar proyecciones a Geoserver

Guía usada:

Se necesitó agregar la proyección MAGNA SIRGAS Origen Nacional 9377.

Se siguió la guía

Memoria de instalación de Geonetwork

Versión actual: (2022-11-28)

  • Producción: 3.10.2.0 (se eliminó)
  • Desarrollo: 4.2.2 (instalada con errores)

Tiene múltiples pereques (problemitas de instalación)

Aquí algunos de los que hemos tenido que resolver:

Instalación y manejo de la base de datos:

Uso con Postgresql

De entrada hay una falla en la documentación pues no es clara y da por hecho varios pasos.

  • Una vez se cuente con una ruta estable se solicitará la modificación de la documentación

Problemas:

Elastich Search.

Las últimas versiones vienen con la dependencia de uso con ElasticSearch

Opciones
  1. Instrucciones para instalación: https://geonetwork-opensource.org/manuals/4.0.x/en/install-guide/installing-index.html

  2. Instalación de prueba (trial) creada en: https://9785fa361b4c4286bfb62f1346d7f709.us-central1.gcp.cloud.es.io:9243/app/integrations/detail/fleet_server-1.2.0/policies?addAgentToPolicyId=9663ee90-a15f-11ed-bc5c-4f012e02d99a

Datos de acceso:


id: 9663ee90-a15f-11ed-bc5c-4f012e02d99a
revision: 2
outputs:
  default:
    type: elasticsearch
    hosts:
      - 'https://629f0e1bd9984f889f0c9e3688915e81.us-central1.gcp.cloud.es.io:443'
    username: '${ES_USERNAME}'
    password: '${ES_PASSWORD}'
output_permissions:
  default:
    _elastic_agent_monitoring:
      indices:
        - names:
            - logs-elastic_agent.apm_server-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.apm_server-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-elastic_agent.auditbeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.auditbeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-elastic_agent.cloudbeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.cloudbeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-elastic_agent-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.elastic_agent-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.endpoint_security-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-elastic_agent.endpoint_security-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-elastic_agent.filebeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.filebeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-elastic_agent.fleet_server-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.fleet_server-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-elastic_agent.heartbeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.heartbeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-elastic_agent.metricbeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.metricbeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-elastic_agent.osquerybeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.osquerybeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-elastic_agent.packetbeat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-elastic_agent.packetbeat-default
          privileges:
            - auto_configure
            - create_doc
    _elastic_agent_checks:
      cluster:
        - monitor
    47747b52-9485-4650-b6ec-a2945cda8805:
      indices:
        - names:
            - logs-system.auth-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-system.syslog-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-system.application-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-system.security-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - logs-system.system-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.cpu-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.diskio-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.filesystem-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.fsstat-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.load-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.memory-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.network-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.process-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.process.summary-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.socket_summary-default
          privileges:
            - auto_configure
            - create_doc
        - names:
            - metrics-system.uptime-default
          privileges:
            - auto_configure
            - create_doc
agent:
  download:
    sourceURI: 'https://artifacts.elastic.co/downloads/'
  monitoring:
    enabled: true
    use_output: default
    namespace: default
    logs: true
    metrics: true
inputs:
  - id: logfile-system-47747b52-9485-4650-b6ec-a2945cda8805
    name: system-1
    revision: 1
    type: logfile
    use_output: default
    meta:
      package:
        name: system
        version: 1.23.1
    data_stream:
      namespace: default
    package_policy_id: 47747b52-9485-4650-b6ec-a2945cda8805
    streams:
      - id: logfile-system.auth-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.auth
          type: logs
        ignore_older: 72h
        paths:
          - /var/log/auth.log*
          - /var/log/secure*
        exclude_files:
          - .gz$
        multiline:
          pattern: ^\s
          match: after
        tags:
          - system-auth
        processors:
          - add_locale: null
      - id: logfile-system.syslog-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.syslog
          type: logs
        paths:
          - /var/log/messages*
          - /var/log/syslog*
        exclude_files:
          - .gz$
        multiline:
          pattern: ^\s
          match: after
        processors:
          - add_locale: null
        ignore_older: 72h
  - id: winlog-system-47747b52-9485-4650-b6ec-a2945cda8805
    name: system-1
    revision: 1
    type: winlog
    use_output: default
    meta:
      package:
        name: system
        version: 1.23.1
    data_stream:
      namespace: default
    package_policy_id: 47747b52-9485-4650-b6ec-a2945cda8805
    streams:
      - id: winlog-system.application-47747b52-9485-4650-b6ec-a2945cda8805
        name: Application
        data_stream:
          dataset: system.application
          type: logs
        condition: '${host.platform} == ''windows'''
        ignore_older: 72h
      - id: winlog-system.security-47747b52-9485-4650-b6ec-a2945cda8805
        name: Security
        data_stream:
          dataset: system.security
          type: logs
        condition: '${host.platform} == ''windows'''
        ignore_older: 72h
      - id: winlog-system.system-47747b52-9485-4650-b6ec-a2945cda8805
        name: System
        data_stream:
          dataset: system.system
          type: logs
        condition: '${host.platform} == ''windows'''
        ignore_older: 72h
  - id: system/metrics-system-47747b52-9485-4650-b6ec-a2945cda8805
    name: system-1
    revision: 1
    type: system/metrics
    use_output: default
    meta:
      package:
        name: system
        version: 1.23.1
    data_stream:
      namespace: default
    package_policy_id: 47747b52-9485-4650-b6ec-a2945cda8805
    streams:
      - id: system/metrics-system.cpu-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.cpu
          type: metrics
        metricsets:
          - cpu
        cpu.metrics:
          - percentages
          - normalized_percentages
        period: 10s
      - id: system/metrics-system.diskio-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.diskio
          type: metrics
        metricsets:
          - diskio
        diskio.include_devices: null
        period: 10s
      - id: system/metrics-system.filesystem-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.filesystem
          type: metrics
        metricsets:
          - filesystem
        period: 1m
        processors:
          - drop_event.when.regexp:
              system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)
      - id: system/metrics-system.fsstat-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.fsstat
          type: metrics
        metricsets:
          - fsstat
        period: 1m
        processors:
          - drop_event.when.regexp:
              system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)
      - id: system/metrics-system.load-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.load
          type: metrics
        metricsets:
          - load
        condition: '${host.platform} != ''windows'''
        period: 10s
      - id: system/metrics-system.memory-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.memory
          type: metrics
        metricsets:
          - memory
        period: 10s
      - id: system/metrics-system.network-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.network
          type: metrics
        metricsets:
          - network
        period: 10s
        network.interfaces: null
      - id: system/metrics-system.process-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.process
          type: metrics
        metricsets:
          - process
        period: 10s
        process.include_top_n.by_cpu: 5
        process.include_top_n.by_memory: 5
        process.cmdline.cache.enabled: true
        process.cgroups.enabled: false
        process.include_cpu_ticks: false
        processes:
          - .*
      - id: >-
          system/metrics-system.process.summary-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.process.summary
          type: metrics
        metricsets:
          - process_summary
        period: 10s
      - id: >-
          system/metrics-system.socket_summary-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.socket_summary
          type: metrics
        metricsets:
          - socket_summary
        period: 10s
      - id: system/metrics-system.uptime-47747b52-9485-4650-b6ec-a2945cda8805
        data_stream:
          dataset: system.uptime
          type: metrics
        metricsets:
          - uptime
        period: 10s
  - id: fleet-server-fleet_server-c4408ff2-566f-47b8-bcd7-d18f459eaa0d
    name: fleet_server-1
    revision: 1
    type: fleet-server
    use_output: default
    meta:
      package:
        name: fleet_server
        version: 1.2.0
    data_stream:
      namespace: default
    package_policy_id: c4408ff2-566f-47b8-bcd7-d18f459eaa0d
    server:
      port: 8220
      host: 0.0.0.0

Elasticsearch

Guías:

Siguiendo estos pasos pudimos instalar elasticsearch. Al final fue facil, solo descargar el .deb y correrlo con:

sudo dpkg -i archivo.deb

Después ingresar los parámetros por Curl fue un poco más complicado: No aceptaba los certificados via Curl y luego los http headers.

Prueba

Conectarse con usuario

curl -XGET --user elastic:afz89V2Epjh1=rZA6EFO ‘http://127.0.0.1:9200/_cluster/state?pretty

error por no usar SSL. Se pone -k y se usa https://

Error porque la guía no indica que hay que decirle que es un json

curl -k -X PUT --user elastic:password https://localhost:9200/gn-features -H “Content-Type: application/json” -d @features.json

curl -k -X PUT --user elastic:password https://localhost:9200/gn-features -H “Content-Type: application/json” -d @features.json

error:

{“error”:{“root_cause”:[{“type”:“mapper_parsing_exception”,“reason”:“Root mapping definition has unsupported parameters: [default : {dynamic_templates=[{integerType={mapping={type=integer}, match=ft_ti}}, {doubleType={mapping={type=double}, match=ftd}}, {booleanType={mapping={type=boolean}, match=ftb}}, {dateType={mapping={format=, type=double}, match=ftd}}, {dateTimeType={mapping={format=yyyy-MM-dd||yyyy-MM||yyyy||yyyy-MM-dd’T’HH:mm:ss’Z’||yyyy-MM-dd’T’HH:mm:ss||yyyy-MM-dd HH:mm:ss.S, type=date}, match=ftdt}}, {stringType={mapping={fielddata=true, type=keyword}, match=fts}}, {stringPathType={mapping={search_analyzer=keyword, fielddata=true, analyzer=pathAnalyzer, type=string}, match=ft_s_tree}}, {operationType={mapping={fielddata=true, type=keyword}, match=_op}}], properties={parent={type=keyword}, docType={type=keyword}, resourceTitle={type=keyword}, location={type=geo_point}, id={type=keyword}, featureTypeId={type=keyword}, geom={precision=10km, tree=quadtree, type=geo_shape}, resourceType={type=keyword}}}]”}],“type”:“mapper_parsing_exception”,“reason”:“Failed to parse mapping: Root mapping definition has unsupported parameters: [default : {dynamic_templates=[{integerType={mapping={type=integer}, match=ft_ti}}, {doubleType={mapping={type=double}, match=ftd}}, {booleanType={mapping={type=boolean}, match=ftb}}, {dateType={mapping={format=, type=double}, match=ftd}}, {dateTimeType={mapping={format=yyyy-MM-dd||yyyy-MM||yyyy||yyyy-MM-dd’T’HH:mm:ss’Z’||yyyy-MM-dd’T’HH:mm:ss||yyyy-MM-dd HH:mm:ss.S, type=date}, match=ftdt}}, {stringType={mapping={fielddata=true, type=keyword}, match=fts}}, {stringPathType={mapping={search_analyzer=keyword, fielddata=true, analyzer=pathAnalyzer, type=string}, match=ft_s_tree}}, {operationType={mapping={fielddata=true, type=keyword}, match=_op}}], properties={parent={type=keyword}, docType={type=keyword}, resourceTitle={type=keyword}, location={type=geo_point}, id={type=keyword}, featureTypeId={type=keyword}, geom={precision=10km, tree=quadtree, type=geo_shape}, resourceType={type=keyword}}}]”,“caused_by”:{“type”:“mapper_parsing_exception”,“reason”:“Root mapping definition has unsupported parameters: [default : {dynamic_templates=[{integerType={mapping={type=integer}, match=ft_ti}}, {doubleType={mapping={type=double}, match=ftd}}, {booleanType={mapping={type=boolean}, match=ftb}}, {dateType={mapping={format=, type=double}, match=ftd}}, {dateTimeType={mapping={format=yyyy-MM-dd||yyyy-MM||yyyy||yyyy-MM-dd’T’HH:mm:ss’Z’||yyyy-MM-dd’T’HH:mm:ss||yyyy-MM-dd HH:mm:ss.S, type=date}, match=ftdt}}, {stringType={mapping={fielddata=true, type=keyword}, match=fts}}, {stringPathType={mapping={search_analyzer=keyword, fielddata=true, analyzer=pathAnalyzer, type=string}, match=ft_s_tree}}, {operationType={mapping={fielddata=true, type=keyword}, match=_op}}], properties={parent={type=keyword}, docType={type=keyword}, resourceTitle={type=keyword}, location={type=geo_point}, id={type=keyword}, featureTypeId={type=keyword}, geom={precision=10km, tree=quadtree, type=geo_shape}, resourceType={type=keyword}}}]”}},“status”:400}

no correspondía con la versión que estamos usando. Se vuelve a comenzar incluyendo la versión correcta en el json descargado:

curl -O https://raw.githubusercontent.com/geonetwork/core-geonetwork/4.0.x/es/config/features.json

y luego otra vez subimos:

curl -k -X PUT --user elastic:afz89V2Epjh1=rZA6EFO https://localhost:9200/gn-features -H “Content-Type: application/json” -d @features.json

Error:

{“error”:{“root_cause”:[{“type”:“not_x_content_exception”,“reason”:“Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes”}],“type”:“not_x_content_exception”,“reason”:“Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes”},“status”:500}

Se intenta agregand la opción -H para indicarle el tipo de contenido:

curl -k -X PUT --user elastic:afz89V2Epjh1=rZA6EFO https://localhost:9200/gn-features -H “Content-Type: application/json” --data-binary @features.json

Segundo archivo

curl -k -X PUT --user elastic:afz89V2Epjh1=rZA6EFO https://localhost:9200/gn-records -H “Content-Type: application/json” --data-binary -d @records.json

-H" para especificar el tipo de contenido en la solicitud de curl. Podrías intentar con lo siguiente

La opción “–data-binary” le indica a curl que no debe modificar los datos en el archivo y que deben enviarse exactamente tal como están en el archivo.

Error:

{“error”:{“root_cause”:[{“type”:“not_x_content_exception”,“reason”:“Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes”}],“type”:“not_x_content_exception”,“reason”:“Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes”},“status”:500}

Ahora, podría ser un problema de integridad del archivo json o que está comprimido. se le avisa que está comprimido a ver

curl -k -X PUT --user elastic:afz89V2Epjh1=rZA6EFO https://localhost:9200/gn-features -H “Content-Type: application/json” -H “Content-Encoding: gzip” -d @features.json.gz

Kibana

Guías:

Memoria de despliegue de Apache Tomcat Llevamos trabajando con Tomcat aproximadamente 5 años. Lo usamos principalmente para poner en línea estas aplicaciones: Geoserver Geonetwork Memoria de instalación de Apache Tomcat Memoria de instalación de Geoserver Versión actual: (2022-11-28) Producción: 2.17.0 Desarrollo: 2.22.0 Básicamente Geoserver es Plug and PLay. En versiones anteriores se tuvieron problemas como la dependencia de Java 8, lo cual ya está superado. Agregar proyecciones a Geoserver Guía usada: https://docs.geoserver.org/latest/en/user/configuration/crshandling/customcrs.html Fuente de proyección: https://epsg.io/9377 Se necesitó agregar la proyección MAGNA SIRGAS Origen Nacional 9377. Se siguió la guía Memoria de instalación de Geonetwork Sitio principal: https://www.geonetwork-opensource.org/ Documentación para instalación https://www.geonetwork-opensource.org/manuals/trunk/en/install-guide/index.html https://geonetwork-opensource.org/manuals/trunk/en/administrator-guide/configuring-the-catalog/user-interface-configuration.html Versión actual: (2022-11-28) Producción: 3.10.2.0 (se eliminó) Desarrollo: 4.2.2 (instalada con errores) Tiene múltiples pereques (problemitas de instalación) Aquí algunos de los que hemos tenido que resolver: Instalación y manejo de la base de datos: Documentación: https://www.geonetwork-opensource.org/manuals/4.0.x/en/install-guide/configuring-database.html?highlight=hibernate No puede crear ni acceder a la base de datos: En el pasado se resolvió así: No podía crear un archivo gn.h2.lock (corregir). Se resolvió creando el archivo en /var/lib/tomcat9/gn.h2.lock. Definiendo desde Tomcat que no bloquee los archivos: https://stackoverflow.com/questions/14873219/how-to-prevent-file-locking-when-undeploying-a-tomcat-web-app Se debia corregir la ruta de la BD cuando se está en modo SQLLite En la actualidad: [ ] Por modificar el nombre de la carpeta y el war se perdió la instalación en producción. Se trata de instalar nuevamente y salen varios errores. curiosamente similares al que tenemos en desarrollo [ ] Uno de los errores: https://github.com/geonetwork/core-geonetwork/issues/4344 Uso con Postgresql De entrada hay una falla en la documentación pues no es clara y da por hecho varios pasos. [ ] Una vez se cuente con una ruta estable se solicitará la modificación de la documentación Problemas: Relacionado con la guía de instalación. No es claro cómo proseguir Hay varios archivos que se deben modificar: /var/lib/tomcat9//webapps/geonetwork/WEB-INF/config-bd/jdbc.properties. Allí hay un bloque de sentencias que brindan info sobre el acceso a la bd. No es claro qué hay que modificar ni qué hya que tocar: una de ellas es: jdbc:postgresql://localhost:/~/gn? -Ayuda en la lista de correo (hay que descifrarla): https://sourceforge.net/p/geonetwork/mailman/geonetwork-users/thread/CAO1MNmVb62wdokf1iZpLfs_N7ithh%3D7Whe%2BcdDBqRqgurr5%2Baw%40mail.gmail.com/#msg37248980 https://sourceforge.net/p/geonetwork/mailman/message/34144708/ Elastich Search. Las últimas versiones vienen con la dependencia de uso con ElasticSearch Opciones Instrucciones para instalación: https://geonetwork-opensource.org/manuals/4.0.x/en/install-guide/installing-index.html Instalación de prueba (trial) creada en: https://9785fa361b4c4286bfb62f1346d7f709.us-central1.gcp.cloud.es.io:9243/app/integrations/detail/fleet_server-1.2.0/policies?addAgentToPolicyId=9663ee90-a15f-11ed-bc5c-4f012e02d99a Datos de acceso: id: 9663ee90-a15f-11ed-bc5c-4f012e02d99a revision: 2 outputs: default: type: elasticsearch hosts: - 'https://629f0e1bd9984f889f0c9e3688915e81.us-central1.gcp.cloud.es.io:443' username: '${ES_USERNAME}' password: '${ES_PASSWORD}' output_permissions: default: _elastic_agent_monitoring: indices: - names: - logs-elastic_agent.apm_server-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.apm_server-default privileges: - auto_configure - create_doc - names: - logs-elastic_agent.auditbeat-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.auditbeat-default privileges: - auto_configure - create_doc - names: - logs-elastic_agent.cloudbeat-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.cloudbeat-default privileges: - auto_configure - create_doc - names: - logs-elastic_agent-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.elastic_agent-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.endpoint_security-default privileges: - auto_configure - create_doc - names: - logs-elastic_agent.endpoint_security-default privileges: - auto_configure - create_doc - names: - logs-elastic_agent.filebeat-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.filebeat-default privileges: - auto_configure - create_doc - names: - logs-elastic_agent.fleet_server-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.fleet_server-default privileges: - auto_configure - create_doc - names: - logs-elastic_agent.heartbeat-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.heartbeat-default privileges: - auto_configure - create_doc - names: - logs-elastic_agent.metricbeat-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.metricbeat-default privileges: - auto_configure - create_doc - names: - logs-elastic_agent.osquerybeat-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.osquerybeat-default privileges: - auto_configure - create_doc - names: - logs-elastic_agent.packetbeat-default privileges: - auto_configure - create_doc - names: - metrics-elastic_agent.packetbeat-default privileges: - auto_configure - create_doc _elastic_agent_checks: cluster: - monitor 47747b52-9485-4650-b6ec-a2945cda8805: indices: - names: - logs-system.auth-default privileges: - auto_configure - create_doc - names: - logs-system.syslog-default privileges: - auto_configure - create_doc - names: - logs-system.application-default privileges: - auto_configure - create_doc - names: - logs-system.security-default privileges: - auto_configure - create_doc - names: - logs-system.system-default privileges: - auto_configure - create_doc - names: - metrics-system.cpu-default privileges: - auto_configure - create_doc - names: - metrics-system.diskio-default privileges: - auto_configure - create_doc - names: - metrics-system.filesystem-default privileges: - auto_configure - create_doc - names: - metrics-system.fsstat-default privileges: - auto_configure - create_doc - names: - metrics-system.load-default privileges: - auto_configure - create_doc - names: - metrics-system.memory-default privileges: - auto_configure - create_doc - names: - metrics-system.network-default privileges: - auto_configure - create_doc - names: - metrics-system.process-default privileges: - auto_configure - create_doc - names: - metrics-system.process.summary-default privileges: - auto_configure - create_doc - names: - metrics-system.socket_summary-default privileges: - auto_configure - create_doc - names: - metrics-system.uptime-default privileges: - auto_configure - create_doc agent: download: sourceURI: 'https://artifacts.elastic.co/downloads/' monitoring: enabled: true use_output: default namespace: default logs: true metrics: true inputs: - id: logfile-system-47747b52-9485-4650-b6ec-a2945cda8805 name: system-1 revision: 1 type: logfile use_output: default meta: package: name: system version: 1.23.1 data_stream: namespace: default package_policy_id: 47747b52-9485-4650-b6ec-a2945cda8805 streams: - id: logfile-system.auth-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.auth type: logs ignore_older: 72h paths: - /var/log/auth.log* - /var/log/secure* exclude_files: - .gz$ multiline: pattern: ^\s match: after tags: - system-auth processors: - add_locale: null - id: logfile-system.syslog-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.syslog type: logs paths: - /var/log/messages* - /var/log/syslog* exclude_files: - .gz$ multiline: pattern: ^\s match: after processors: - add_locale: null ignore_older: 72h - id: winlog-system-47747b52-9485-4650-b6ec-a2945cda8805 name: system-1 revision: 1 type: winlog use_output: default meta: package: name: system version: 1.23.1 data_stream: namespace: default package_policy_id: 47747b52-9485-4650-b6ec-a2945cda8805 streams: - id: winlog-system.application-47747b52-9485-4650-b6ec-a2945cda8805 name: Application data_stream: dataset: system.application type: logs condition: '${host.platform} == ''windows''' ignore_older: 72h - id: winlog-system.security-47747b52-9485-4650-b6ec-a2945cda8805 name: Security data_stream: dataset: system.security type: logs condition: '${host.platform} == ''windows''' ignore_older: 72h - id: winlog-system.system-47747b52-9485-4650-b6ec-a2945cda8805 name: System data_stream: dataset: system.system type: logs condition: '${host.platform} == ''windows''' ignore_older: 72h - id: system/metrics-system-47747b52-9485-4650-b6ec-a2945cda8805 name: system-1 revision: 1 type: system/metrics use_output: default meta: package: name: system version: 1.23.1 data_stream: namespace: default package_policy_id: 47747b52-9485-4650-b6ec-a2945cda8805 streams: - id: system/metrics-system.cpu-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.cpu type: metrics metricsets: - cpu cpu.metrics: - percentages - normalized_percentages period: 10s - id: system/metrics-system.diskio-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.diskio type: metrics metricsets: - diskio diskio.include_devices: null period: 10s - id: system/metrics-system.filesystem-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.filesystem type: metrics metricsets: - filesystem period: 1m processors: - drop_event.when.regexp: system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) - id: system/metrics-system.fsstat-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.fsstat type: metrics metricsets: - fsstat period: 1m processors: - drop_event.when.regexp: system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) - id: system/metrics-system.load-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.load type: metrics metricsets: - load condition: '${host.platform} != ''windows''' period: 10s - id: system/metrics-system.memory-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.memory type: metrics metricsets: - memory period: 10s - id: system/metrics-system.network-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.network type: metrics metricsets: - network period: 10s network.interfaces: null - id: system/metrics-system.process-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.process type: metrics metricsets: - process period: 10s process.include_top_n.by_cpu: 5 process.include_top_n.by_memory: 5 process.cmdline.cache.enabled: true process.cgroups.enabled: false process.include_cpu_ticks: false processes: - .* - id: >- system/metrics-system.process.summary-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.process.summary type: metrics metricsets: - process_summary period: 10s - id: >- system/metrics-system.socket_summary-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.socket_summary type: metrics metricsets: - socket_summary period: 10s - id: system/metrics-system.uptime-47747b52-9485-4650-b6ec-a2945cda8805 data_stream: dataset: system.uptime type: metrics metricsets: - uptime period: 10s - id: fleet-server-fleet_server-c4408ff2-566f-47b8-bcd7-d18f459eaa0d name: fleet_server-1 revision: 1 type: fleet-server use_output: default meta: package: name: fleet_server version: 1.2.0 data_stream: namespace: default package_policy_id: c4408ff2-566f-47b8-bcd7-d18f459eaa0d server: port: 8220 host: 0.0.0.0 Elasticsearch Guías: https://www.geonetwork-opensource.org/manuals/4.0.x/en/maintainer-guide/statistics/setup-elasticsearch.html https://www.elastic.co/downloads/elasticsearch Siguiendo estos pasos pudimos instalar elasticsearch. Al final fue facil, solo descargar el .deb y correrlo con: sudo dpkg -i archivo.deb Después ingresar los parámetros por Curl fue un poco más complicado: No aceptaba los certificados via Curl y luego los http headers. Prueba Conectarse con usuario curl -XGET --user elastic:afz89V2Epjh1=rZA6EFO ‘http://127.0.0.1:9200/_cluster/state?pretty’ error por no usar SSL. Se pone -k y se usa https:// Error porque la guía no indica que hay que decirle que es un json curl -k -X PUT --user elastic:password https://localhost:9200/gn-features -H “Content-Type: application/json” -d @features.json curl -k -X PUT --user elastic:password https://localhost:9200/gn-features -H “Content-Type: application/json” -d @features.json error: {“error”:{“root_cause”:[{“type”:“mapper_parsing_exception”,“reason”:“Root mapping definition has unsupported parameters: [default : {dynamic_templates=[{integerType={mapping={type=integer}, match=ft_ti}}, {doubleType={mapping={type=double}, match=ftd}}, {booleanType={mapping={type=boolean}, match=ftb}}, {dateType={mapping={format=, type=double}, match=ftd}}, {dateTimeType={mapping={format=yyyy-MM-dd||yyyy-MM||yyyy||yyyy-MM-dd’T’HH:mm:ss’Z’||yyyy-MM-dd’T’HH:mm:ss||yyyy-MM-dd HH:mm:ss.S, type=date}, match=ftdt}}, {stringType={mapping={fielddata=true, type=keyword}, match=fts}}, {stringPathType={mapping={search_analyzer=keyword, fielddata=true, analyzer=pathAnalyzer, type=string}, match=ft_s_tree}}, {operationType={mapping={fielddata=true, type=keyword}, match=_op}}], properties={parent={type=keyword}, docType={type=keyword}, resourceTitle={type=keyword}, location={type=geo_point}, id={type=keyword}, featureTypeId={type=keyword}, geom={precision=10km, tree=quadtree, type=geo_shape}, resourceType={type=keyword}}}]”}],“type”:“mapper_parsing_exception”,“reason”:“Failed to parse mapping: Root mapping definition has unsupported parameters: [default : {dynamic_templates=[{integerType={mapping={type=integer}, match=ft_ti}}, {doubleType={mapping={type=double}, match=ftd}}, {booleanType={mapping={type=boolean}, match=ftb}}, {dateType={mapping={format=, type=double}, match=ftd}}, {dateTimeType={mapping={format=yyyy-MM-dd||yyyy-MM||yyyy||yyyy-MM-dd’T’HH:mm:ss’Z’||yyyy-MM-dd’T’HH:mm:ss||yyyy-MM-dd HH:mm:ss.S, type=date}, match=ftdt}}, {stringType={mapping={fielddata=true, type=keyword}, match=fts}}, {stringPathType={mapping={search_analyzer=keyword, fielddata=true, analyzer=pathAnalyzer, type=string}, match=ft_s_tree}}, {operationType={mapping={fielddata=true, type=keyword}, match=_op}}], properties={parent={type=keyword}, docType={type=keyword}, resourceTitle={type=keyword}, location={type=geo_point}, id={type=keyword}, featureTypeId={type=keyword}, geom={precision=10km, tree=quadtree, type=geo_shape}, resourceType={type=keyword}}}]”,“caused_by”:{“type”:“mapper_parsing_exception”,“reason”:“Root mapping definition has unsupported parameters: [default : {dynamic_templates=[{integerType={mapping={type=integer}, match=ft_ti}}, {doubleType={mapping={type=double}, match=ftd}}, {booleanType={mapping={type=boolean}, match=ftb}}, {dateType={mapping={format=, type=double}, match=ftd}}, {dateTimeType={mapping={format=yyyy-MM-dd||yyyy-MM||yyyy||yyyy-MM-dd’T’HH:mm:ss’Z’||yyyy-MM-dd’T’HH:mm:ss||yyyy-MM-dd HH:mm:ss.S, type=date}, match=ftdt}}, {stringType={mapping={fielddata=true, type=keyword}, match=fts}}, {stringPathType={mapping={search_analyzer=keyword, fielddata=true, analyzer=pathAnalyzer, type=string}, match=ft_s_tree}}, {operationType={mapping={fielddata=true, type=keyword}, match=_op}}], properties={parent={type=keyword}, docType={type=keyword}, resourceTitle={type=keyword}, location={type=geo_point}, id={type=keyword}, featureTypeId={type=keyword}, geom={precision=10km, tree=quadtree, type=geo_shape}, resourceType={type=keyword}}}]”}},“status”:400} no correspondía con la versión que estamos usando. Se vuelve a comenzar incluyendo la versión correcta en el json descargado: curl -O https://raw.githubusercontent.com/geonetwork/core-geonetwork/4.0.x/es/config/features.json y luego otra vez subimos: curl -k -X PUT --user elastic:afz89V2Epjh1=rZA6EFO https://localhost:9200/gn-features -H “Content-Type: application/json” -d @features.json Error: {“error”:{“root_cause”:[{“type”:“not_x_content_exception”,“reason”:“Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes”}],“type”:“not_x_content_exception”,“reason”:“Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes”},“status”:500} Se intenta agregand la opción -H para indicarle el tipo de contenido: curl -k -X PUT --user elastic:afz89V2Epjh1=rZA6EFO https://localhost:9200/gn-features -H “Content-Type: application/json” --data-binary @features.json Segundo archivo curl -k -X PUT --user elastic:afz89V2Epjh1=rZA6EFO https://localhost:9200/gn-records -H “Content-Type: application/json” --data-binary -d @records.json -H" para especificar el tipo de contenido en la solicitud de curl. Podrías intentar con lo siguiente La opción “–data-binary” le indica a curl que no debe modificar los datos en el archivo y que deben enviarse exactamente tal como están en el archivo. Error: {“error”:{“root_cause”:[{“type”:“not_x_content_exception”,“reason”:“Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes”}],“type”:“not_x_content_exception”,“reason”:“Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes”},“status”:500} Ahora, podría ser un problema de integridad del archivo json o que está comprimido. se le avisa que está comprimido a ver curl -k -X PUT --user elastic:afz89V2Epjh1=rZA6EFO https://localhost:9200/gn-features -H “Content-Type: application/json” -H “Content-Encoding: gzip” -d @features.json.gz Kibana Guías: https://www.elastic.co/downloads/kibana
{}