Skip to content

Building Kibana

linuxonz edited this page Nov 14, 2025 · 56 revisions

Building Kibana

The instructions provided below specify the steps to install Kibana 9.1.3 on Linux on IBM Z for following distributions:

  • RHEL (8.10, 9.4, 9.6)
  • SLES (15 SP6, 15 SP7)
  • Ubuntu (22.04, 24.04)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.
  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

1. Build using script

If you want to build Kibana using manual steps, go to STEP 2.

Use the following commands to build Kibana using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Kibana/9.1.3/build_kibana.sh

# Build Kibana
bash build_kibana.sh

If the build completes successfully, go to STEP 6. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

2. Install Dependencies

export SOURCE_ROOT=/<source_root>/
export PATCH_URL="https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Kibana/9.1.3/patch"

2.1. Install Basic Dependencies

  • RHEL (8.10, 9.4, 9.6)

    sudo yum install -y --allowerasing curl git gcc-c++ gzip make python3 java-11-openjdk-devel unzip zip tar wget patch xz pkg-config expat-devel glib2-devel meson ninja-build brotli gobject-introspection-devel coreutils ed expect file gnupg2 iproute iproute-devel iputils less openssl-devel python3-devel python3-pip python3-requests python3-setuptools python3-six python3-wheel python3-pyyaml zlib-devel
  • SLES (15 SP6, 15 SP7)

    sudo zypper addrepo --priority 199 http://download.opensuse.org/distribution/leap/15.6/repo/oss/ oss
    sudo zypper --gpg-auto-import-keys refresh -r oss
    sudo zypper install -y curl git gcc-c++ gcc11-c++ gzip make python3 java-11-openjdk-devel unzip zip tar wget patch xz which gawk pkg-config glib2-devel libexpat-devel cmake meson ninja gobject-introspection-devel coreutils ed expect file iproute2 iputils lcov less libopenssl-devel python3-devel python3-pip python3-requests python3-setuptools python3-six python3-wheel unzip zlib-devel python3-python-gnupg python3-PyYAML
  • Ubuntu (22.04, 24.04)

    sudo apt-get update
    sudo apt-get install -y curl git g++-11 gzip make python3 python-is-python3 openjdk-11-jdk unzip zip tar wget patch xz-utils build-essential pkg-config libglib2.0-dev libexpat1-dev meson ninja-build brotli libgirepository1.0-dev

2.2. Set JAVA_HOME environment variable

export JAVA_HOME=<path to java>
export PATH=$JAVA_HOME/bin:$PATH

2.3. Install Node.js

cd $SOURCE_ROOT
export NODE_JS_VERSION="22.17.1"
sudo mkdir -p /usr/local/lib/nodejs
wget https://nodejs.org/dist/v$NODE_JS_VERSION/node-v$NODE_JS_VERSION-linux-s390x.tar.xz
sudo tar xf node-v$NODE_JS_VERSION-linux-s390x.tar.xz -C /usr/local/lib/nodejs
export PATH=/usr/local/lib/nodejs/node-v$NODE_JS_VERSION-linux-s390x/bin:$PATH

2.4. Install Yarn

sudo chmod ugo+w -R /usr/local/lib/nodejs/node-v${NODE_JS_VERSION}-linux-s390x
npm install -g yarn

2.5. Install brotli (Only on SLES 15 SP6 and 15 SP7)

cd $SOURCE_ROOT
git clone --depth 1 -b v1.1.0 https://github.com/google/brotli.git
cd brotli
mkdir out && cd out
cmake -DCMAKE_BUILD_TYPE=Release .. #need cmake 3.15+
sudo cmake --build . --config Release --target install
export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH

3. Build and Install Kibana

  • Download Kibana

    cd $SOURCE_ROOT
    git clone --depth 1 -b v9.1.3 https://github.com/elastic/kibana.git
    cd kibana
  • Apply source code patch:

    cd $SOURCE_ROOT/kibana
    curl -sSL $PATCH_URL/kibana_patch.diff | git apply
  • Bootstrap Kibana

    export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
    yarn kbn bootstrap --network-timeout 1000000
    # If build fail on this then use `yarn kbn bootstrap --force-install`
  • Build Kibana

    cd $SOURCE_ROOT/kibana
    export NODE_OPTIONS="--max_old_space_size=4096"
    node scripts/build --release --skip-os-packages

4. Test (Optional)

4.1. Build the Elasticsearch Distribution

cd $SOURCE_ROOT
mkdir -p "$SOURCE_ROOT/elasticsearch"
cd "$SOURCE_ROOT/elasticsearch"
curl -sSL "https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Elasticsearch/${PACKAGE_VERSION}/build_elasticsearch.sh" > build_elasticsearch.sh
sed -i '48,77d;201,211d;247,258d' ./build_elasticsearch.sh
bash ./build_elasticsearch.sh -y -k

4.2. Build and Install ParcelWatcher

cd $SOURCE_ROOT
git clone --depth 1 -b v2.5.1 https://github.com/parcel-bundler/watcher.git
cd watcher
yarn --frozen-lockfile --ignore-scripts
npm install node-gyp -g
yarn prebuild --arch s390x -t 22.0.0
mkdir -p "${SOURCE_ROOT}/kibana/node_modules/@parcel/watcher-linux-s390x-glibc/"
cp build/Release/obj.target/watcher.node "${SOURCE_ROOT}/kibana/node_modules/@parcel/watcher-linux-s390x-glibc/"
cat << "EOF" > "${SOURCE_ROOT}/kibana/node_modules/@parcel/watcher-linux-s390x-glibc/package.json"
{
  "name": "@parcel/watcher-linux-s390x-glibc",
  "version": "2.5.1",
  "main": "watcher.node",
  "repository": {
    "type": "git",
    "url": "https://github.com/parcel-bundler/watcher.git"
  },
  "description": "A native C++ Node module for querying and subscribing to filesystem events. Used by Parcel 2.",
  "license": "MIT",
  "publishConfig": {
    "access": "public"
  },
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/parcel"
  },
  "files": [
    "watcher.node"
  ],
  "engines": {
    "node": ">= 10.0.0"
  },
  "os": [
    "linux"
  ],
  "cpu": [
    "s390x"
  ],
  "libc": [
    "glibc"
  ]
}
EOF

4.3. Build and Install Selenium (Only on RHEL)

sudo dnf install -y firefox
sudo dnf -y groupinstall 'Development Tools'
mkdir -p "$SOURCE_ROOT/selenium"
cd "$SOURCE_ROOT/selenium"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y
source "$HOME/.cargo/env"
git clone --depth=1 -b FIREFOX_128_14_0esr_RELEASE https://github.com/mozilla-firefox/firefox.git
cd firefox/testing/geckodriver/
cargo build
../../target/debug/geckodriver --version
sudo cp ../../target/debug/geckodriver /usr/local/bin/

cd "$SOURCE_ROOT/selenium"
git clone --depth=1 -b selenium-4.34.0 https://github.com/SeleniumHQ/selenium.git
cd selenium/rust
cargo build
./target/debug/selenium-manager --version
cp ./target/debug/selenium-manager "$SOURCE_ROOT"/kibana/node_modules/selenium-webdriver/bin/linux/selenium-manager

4.4. Set Test Environment

    export NODE_OPTIONS="--max-old-space-size=4096"
    export TEST_BROWSER_HEADLESS=1
    export DISABLE_BOOTSTRAP_VALIDATION=true
    export BROWSERSLIST_IGNORE_OLD_DATA=true
    export TEST_ES_FROM="$SOURCE_ROOT/elasticsearch/elasticsearch/distribution/archives/linux-s390x-tar/build/distributions/elasticsearch-${PACKAGE_VERSION}-SNAPSHOT-linux-s390x.tar.gz"

4.5. Build Kibana Platform Plugins

cd $SOURCE_ROOT/kibana
node scripts/build_kibana_platform_plugins

4.6. Run the Tests

  • Unit tests

    cd $SOURCE_ROOT/kibana
    wget $PATCH_URL/unittest.sh
    bash unittest.sh
  • Integration tests

    cd $SOURCE_ROOT/kibana
    wget $PATCH_URL/integrationtest.sh
    bash integrationtest.sh
  • Functional tests

    cd $SOURCE_ROOT/kibana
    wget $PATCH_URL/functionaltest.sh
    bash functionaltest.sh

Notes:

  • The following test case failures can be ignored as they are seen on x86 also:

    src/platform/packages/shared/kbn-test/jest.config.js
    src/platform/plugins/private/vis_types/vega/jest.config.js
    x-pack/platform/plugins/shared/ml/jest.config.js
    src/core/server/integration_tests/elasticsearch/jest.integration.config.js
    x-pack/platform/plugins/shared/fleet/jest.integration.config.js
    src/platform/test/api_integration/config.js
    src/platform/test/server_integration/http/platform/config.ts
    x-pack/platform/test/alerting_api_integration/spaces_only/tests/alerting/group4/config.ts
    x-pack/platform/test/fleet_api_integration/config.agent_policy.ts
    x-pack/platform/test/fleet_api_integration/config.epm.ts
    x-pack/platform/test/fleet_api_integration/config.event_ingested.ts
    x-pack/platform/test/fleet_api_integration/config.fleet.ts
    x-pack/platform/test/fleet_api_integration/config.package_policy.ts
    x-pack/platform/test/fleet_api_integration/config.space_awareness.ts
    x-pack/solutions/observability/test/api_integration/apis/uptime/config.ts
    x-pack/solutions/observability/test/apm_api_integration/cloud/config.ts
    x-pack/solutions/security/test/fleet_api_integration/config.package_policy.ts

  • The following test case failures can be ignored as they pass if test timeouts are increased:

    src/platform/packages/shared/kbn-es-query/jest.config.js
    src/platform/packages/shared/kbn-unified-data-table/jest.config.js
    x-pack/platform/plugins/private/upgrade_assistant/jest.config.js
    x-pack/platform/plugins/shared/index_management/jest.config.js
    x-pack/platform/plugins/shared/lens/jest.config.js
    x-pack/platform/plugins/shared/stack_connectors/jest.config.js
    x-pack/solutions/observability/packages/kbn-alerts-grouping/jest.config.js
    x-pack/solutions/observability/plugins/slo/jest.config.js
    x-pack/solutions/observability/plugins/synthetics/jest.config.js
    src/core/server/integration_tests/saved_objects/migrations/group1/jest.integration.config.js
    src/core/server/integration_tests/saved_objects/migrations/group2/jest.integration.config.js
    src/core/server/integration_tests/ui_settings/jest.integration.config.js

  • The following test case failures are not related to functionality and can be safely ignored:

    src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts src/dev/build/lib/config.test.ts

  • The following test case failures can be ignored as they require ml support which is not available on s390x:

    x-pack/solutions/observability/test/functional/config.firefox.ts
    x-pack/platform/test/alerting_api_integration/spaces_only/tests/alerting/group2/config.ts
    x-pack/platform/test/cases_api_integration/security_and_spaces/config_trial.ts
    x-pack/platform/test/api_integration/apis/ml/config.ts
    x-pack/solutions/observability/test/apm_api_integration/trial/config.ts
    x-pack/solutions/observability/test/observability_api_integration/trial/config.ts
    x-pack/solutions/observability/test/api_integration_deployment_agnostic/configs/stateful/oblt.apm.stateful.config.ts
    x-pack/solutions/observability/test/api_integration_deployment_agnostic/configs/stateful/oblt.ai_assistant.stateful.config.ts
    x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/machine_learning/trial_license_complete_tier/configs/ess.config.ts
    x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/trial_license_complete_tier/configs/ess.config.ts
    x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/edge_cases/ess_trial_license.config.ts
    x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/configs/ess.config.ts
    x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/upgrade_prebuilt_rules/diffable_rule_fields/type_specific_fields/configs/ess.config.ts
    x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/ess.config.ts
    x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/telemetry/trial_license_complete_tier/configs/ess.config.ts

  • Selenium test cases which require chromium will fail as chromium is not supported on s390x

  • Selenium test cases which require playwright will fail as playwright is not supported on s390x

  • Some X-Pack test cases will fail as X-Pack plugins are not supported on s390x

  • Some failing test cases pass when executed individually.

5. Install Kibana

cd $SOURCE_ROOT/kibana
sudo mkdir /usr/share/kibana/
sudo tar -xzf target/kibana-9.1.3-linux-s390x.tar.gz -C /usr/share/kibana --strip-components 1
sudo ln -sf /usr/share/kibana/bin/* /usr/bin/

sudo groupadd [username]
sudo chown [username]:elastic -R /usr/share/kibana/

6. Start Kibana

Kibana requires an Elasticsearch instance to be running.

Set Kibana home directory export KIBANA_HOME=/usr/share/kibana/. You may start Kibana and also update the Kibana configuration file $KIBANA_HOME/config/kibana.yml.

kibana

Open your browser and go to https://<HOST_IP>:5601 to make sure the Kibana installation works.

Note:

  • When Kibana is run for the first time, it generates a unique link in your terminal which can be used to enroll your Kibana instance with Elasticsearch. See here for more information on starting Kibana.
  • In order to access Kibana server through web browser, you might need to change server.host field in $KIBANA_HOME/config/kibana.yml to 0.0.0.0. See here for more information.
  • For more information regarding configuring Kibana, please visit here.

References:

Clone this wiki locally