Installing Aerospike

This section provides a step-by-step guide to installing Aerospike.

To install the aerospike, follow the steps below:

  1. Download the latest tarball of the server, and unpack it.
    wget -O aerospike.tgz https://enterprise.aerospike.com/enterprise/download/server/6.3.0/artifact/el8_amd64
    tar -xzf aerospike.tgz
  2. Install the Aerospike package.
    cd aerospike-server-enterprise_6.3.0.17_tools-8.5.1_el8_x86_64/
    ./asinstall
  3. Update the service in the user.conf file.
    vi /etc/systemd/system/aerospike.service.d/user.conf
    [Service]
    User=aerospike
    Group=aerospike
  4. Update the instance store drive rules and cleanup the drive.
    lsblk # check the instance store disck
    file -s /dev/nvme3n1
    vi /etc/udev/rules.d/99-aerospike.rules
    KERNEL=="nvme3n1", OWNER="aerospike"
    udevadm control --reload-rules
    udevadm trigger
    blkdiscard /dev/nvme3n1
    blkdiscard -z --length 8MiB /dev/nvme3n1
  5. Update cluster host and port details, storage in the conf file.
    cd /etc/aerospike/
    vi aerospike.conf # Update the Cluster host/port details and storage (Device path of your actual disk path ex: /dev/nvme3n1) as per below example.
    
    Note: If nvme3n1 disk is available, add the path of actual mounted disk, as /data.
    # Aerospike database configuration file for use with systemd.
    
    service {
            cluster-name aerospike
            proto-fd-max 15000
            user aerospike
            group aerospike
            pidfile /var/run/aerospike/asd.pid
            feature-key-file /etc/aerospike/features.conf
            run-as-daemon
    }
    
    logging {
            file /var/log/aerospike/aerospike.log {
                    context any info
            }
            file /var/log/aerospike/udf.log {
                    context udf info
            }
    }
    
    network {
            service {
                    address puapso1aaxcdaerdbs1001.axcd.aws.hclsw.internal
                    port 13000
            }
    
            heartbeat {
                    mode mesh
                    port 13001
                    address puapso1aaxcdaerdbs1001.axcd.aws.hclsw.internal
                    mesh-seed-address-port puapso1baxcdaerdbs1002.axcd.aws.hclsw.internal 13001
                    mesh-seed-address-port puapso1aaxcdaerdbs1001.axcd.aws.hclsw.internal 13001
                    interval 150
                    timeout 100
            }
    
            fabric {
                    address puapso1aaxcdaerdbs1001.axcd.aws.hclsw.internal
                    port 13002
            }
    
            info {
                    address puapso1aaxcdaerdbs1001.axcd.aws.hclsw.internal
                    port 13003
            }
    }
    
    namespace cdpstore {
            replication-factor 2
            memory-size 12G
            high-water-disk-pct 50
            high-water-memory-pct 75
            stop-writes-pct 90
            default-ttl 31536000
            nsup-period 300
            rack-id 1
            storage-engine device {
                    device /dev/nvme3n1
                    write-block-size 256K
            }
    }
  6. Update the license details in the features.conf file.
    vim features.conf 
    Sample features.conf file is shown below.
    # generated 2023-12-08 18:52:53
    feature-key-version 2
    serial-number <serial no>
    account-name Aerospike
    account-ID <account id>
    valid-until-date 2024-04-26
    asdb-change-notification true
    asdb-cluster-nodes-limit 8
    asdb-compression true
    asdb-encryption-at-rest true
    asdb-flash-index true
    asdb-ldap true
    asdb-pmem true
    asdb-rack-aware true
    asdb-secrets true
    asdb-strong-consistency true
    asdb-vault true
    asdb-xdr true
    database-recovery true
    elasticsearch-connector true
    graph-service true
    mesg-jms-connector true
    mesg-kafka-connector true
    presto-connector true
    pulsar-connector true
    spark-connector true
    ----- SIGNATURE ------------------------------------------------
     MEYCIQDKnSmT9dIagWuUPrrsUH4m20NlQw3G7RoADPFPuhHjZwIhAJBlXCYHYNti
    sUrMCvIQodb1H7jRui+tQ8IqVQ1cZGsZJA==
    ----- END OF SIGNATURE -----------------------------------------
  7. Perform the following commands to update the configuration.
    mkdir -p /var/run/aerospike/
    mkdir -p /var/log/aerospike/
    chown -R aerospike: /var/run/aerospike/
    chown -R aerospike: /var/log/aerospike/
    chown -R aerospike: /opt/aerospike/
    semanage port -l | grep 13000
    semanage port -a -t http_port_t -p tcp 13000-13003
    systemctl status aerospike
    systemctl start aerospike
    systemctl restart aerospike
    tail -F /var/log/aerospike/aerospike.log
    asadm -p 13000
    asadm -p 13000 -e 'info'
    asadm -p 13000 -e 'asinfo -v services'
    info
    show config
    asinfo -v services enable
    asinfo -v features
    nc -zv puapso1baxcdaerdbs1002.axcd.aws.hclsw.internal 13001
    

Installing Node Exporter

To install the Node exporter, follow the steps below:

  1. Download the latest tarball of node exporter and unpack it.
    wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz
    tar xfz node_exporter-*.*-amd64.tar.gz
    sudo mv node_exporter-*.*-amd64/node_exporter /usr/local/bin/
    sudo useradd -rs /bin/false node_exporter
  2. Update the node_exporter.services file as shown below.
    vi /etc/systemd/system/node_exporter.service
    [Unit]
    Description=Node Exporter
    After=network.target
    [Service]
    User=node_exporter
    Group=node_exporter
    Type=simple
    ExecStart=/usr/local/bin/node_exporter
    [Install]
    WantedBy=multi-user.target
  3. Update the mode and service of the node exporter as shown below.
    chown -R root: /usr/local/bin/node_exporter
    chmod -R 755 /usr/local/bin/node_exporter
    restorecon -Rv /usr/local/bin
    semanage port -l | grep 9100
    systemctl daemon-reload
    systemctl start node_exporter
    systemctl status node_exporter
    systemctl restart aerospike
    systemctl enable node_exporter
    ----------For Debugging only Start---------
    /usr/local/bin/node_exporter --help
    sudo -H -u node_exporter bash -c "/usr/local/bin/node_exporter"
    su -s /bin/bash node_exporter
    ps aux | grep node
    ----------For Debugging only End---------
    curl -kv  http://localhost:9100/metrics 

Installing Aerospike exporter

To install the aerospike exporter, follow the steps below:

  1. Download the latest Aerospike exporter, and unpack it.
    wget https://github.com/aerospike/aerospike-prometheus-exporter/releases/download/v1.16.0/aerospike-prometheus-exporter-1.16.0-1.el8.x86_64.rpm
    rpm -Uvh aerospike-prometheus-exporter-1.16.0-1.el8.x86_64.rpm
  2. Update the aerospike-prometheus-exporter.service files. Use the following command to open the file in editor.
    vim /usr/lib/systemd/system/aerospike-prometheus-exporter.service.
    [Unit]
    Description=Aerospike Prometheus Exporter Service
    Documentation=https://github.com/aerospike/aerospike-prometheus-exporter
    Wants=network.target
    After=network-online.target
    
    [Service]
    ExecStart=/usr/bin/aerospike-prometheus-exporter --config /etc/aerospike-prometheus-exporter/ape.toml
    
    [Install]
    WantedBy=multi-user.target
    vi /etc/systemd/system/multi-user.target.wants/aerospike-prometheus-exporter.service
    [Unit]
    Description=Aerospike Prometheus Exporter Service
    Documentation=https://github.com/aerospike/aerospike-prometheus-exporter
    Wants=network.target
    After=network-online.target
    [Service]
    ExecStart=/usr/bin/aerospike-prometheus-exporter --config /etc/aerospike-prometheus-exporter/ape.toml
    [Install]
    WantedBy=multi-user.target
    vim /etc/aerospike-prometheus-exporter/ape.toml

    The default ape.toml is shown below.

    [Agent]
          # Metrics Serving modes
          PROMETHEUS = true
          OPEN_TELEMETRY = false
    
          # labels to add to the prometheus metrics for e.g. labels={zone="asia-south1-a", platform="google compute engine"}
          labels = {latitude="0",longitude="0"}
    
          # mention cloud provider (supported: aws, gcp, azure ) so exporter collects few details like region, zone etc.,
          cloud_provider = ""
    
          # metrics server timeout in seconds
          timeout = 10
    
          # support system statistics also
          refresh_system_stats = false
    
          # Exporter logging configuration
          # Log file path (optional, logs to console by default)
          # Level can be info|warning,warn|error,err|debug|trace ('info' by default)
          log_file = ""
          log_level = ""
    
          # Exporter HTTPS (TLS) configuration
          # HTTPS between Prometheus and Exporter
    
          # TLS certificates.
          # Supports below formats,
          # 1. Certificate file path                                      - "file:<file-path>"
          # 2. Environment variable containing base64 encoded certificate - "env-b64:<environment-variable-that-contains-base64-encoded-certificate>"
          # 3. Base64 encoded certificate                                 - "b64:<base64-encoded-certificate>"
          # Applicable to 'root_ca', 'cert_file' and 'key_file' configurations.
    
          # Server certificate
          cert_file = ""
    
          # Private key associated with server certificate
          key_file = ""
    
          # Root CA to validate client certificates (for mutual TLS)
          root_ca = ""
    
          # Passphrase for encrypted key_file. Supports below formats,
          # 1. Passphrase directly                                                      - "<passphrase>"
          # 2. Passphrase via file                                                      - "file:<file-that-contains-passphrase>"
          # 3. Passphrase via environment variable                                      - "env:<environment-variable-that-holds-passphrase>"
          # 4. Passphrase via environment variable containing base64 encoded passphrase - "env-b64:<environment-variable-that-contains-base64-encoded-passphrase>"
          # 5. Passphrase in base64 encoded form                                        - "b64:<base64-encoded-passphrase>"
          key_file_passphrase = ""
    
          # prometheus binding port
          bind = ":9145"
    
          # Basic HTTP authentication for '/metrics'.
          # Supports below formats,
          # 1. Credential directly                                                      - "<credential>"
          # 2. Credential via file                                                      - "file:<file-that-contains-credential>"
          # 3. Credential via environment variable                                      - "env:<environment-variable-that-contains-credential>"
          # 4. Credential via environment variable containing base64 encoded credential - "env-b64:<environment-variable-that-contains-base64-encoded-credential>"
          # 5. Credential in base64 encoded form                                        - "b64:<base64-encoded-credential>"
          basic_auth_username = ""
          basic_auth_password = ""
    
    [Agent.OpenTelemetry]
          # NOTE: currently supports only gRPC endpoints
    
          # OTel service-name
          service_name = "aerospike-server-metrics-service"
    
          # OTel Endpoint
          endpoint = ""
    
          # OTel SSL/TLS, for HTTPS endpoints
          endpoint_tls_enabled = true
    
          # OTel headers
          headers = {}
    
          # OTel server-stat fetch interval (default 15, not recommended to to reduce this)
          server_stat_fetch_interval = 15
    
          # OTel metric push interval (default 60, not recommended to to reduce this)
          push_interval = 60
    
    [Aerospike]
          db_host = "localhost"
          db_port = 13000
    
          # TLS certificates.
          # Supports below formats,
          # 1. Certificate file path                                      - "file:<file-path>"
          # 2. Environment variable containing base64 encoded certificate - "env-b64:<environment-variable-that-contains-base64-encoded-certificate>"
          # 3. Base64 encoded certificate                                 - "b64:<base64-encoded-certificate>"
          # Applicable to 'root_ca', 'cert_file' and 'key_file' configurations.
    
          # root certificate file
          root_ca = ""
    
          # certificate file
          cert_file = ""
    
          # key file
          key_file = ""
    
          # Passphrase for encrypted key_file. Supports below formats,
          # 1. Passphrase directly                                                      - "<passphrase>"
          # 2. Passphrase via file                                                      - "file:<file-that-contains-passphrase>"
          # 3. Passphrase via environment variable                                      - "env:<environment-variable-that-holds-passphrase>"
          # 4. Passphrase via environment variable containing base64 encoded passphrase - "env-b64:<environment-variable-that-contains-base64-encoded-passphrase>"
          # 5. Passphrase in base64 encoded form                                        - "b64:<base64-encoded-passphrase>"
          key_file_passphrase = ""
    
          # node TLS name for authentication
          node_tls_name = ""
    
          # Aerospike cluster security credentials.
          # Supports below formats,
          # 1. Credential directly                                                      - "<credential>"
          # 2. Credential via file                                                      - "file:<file-that-contains-credential>"
          # 3. Credential via environment variable                                      - "env:<environment-variable-that-contains-credential>"
          # 4. Credential via environment variable containing base64 encoded credential - "env-b64:<environment-variable-that-contains-base64-encoded-credential>"
          # 5. Credential in base64 encoded form                                        - "b64:<base64-encoded-credential>"
          # Applicable to 'user' and 'password' configurations.
    
          # database user
          user = ""
    
          # database password
          password = ""
    
          # authentication mode: internal (server authentication) [default], external (e.g., LDAP), pki. 
          auth_mode = ""
    
          # timeout for sending commands to the server node in seconds
          timeout = 5
    
          # Number of histogram buckets to export for latency metrics. Bucket thresholds range from 2^0 to 2^16 (17 buckets).
          # e.g. latency_buckets_count=5 will export first five buckets i.e. <=1ms, <=2ms, <=4ms, <=8ms and <=16ms.
          # Default: 0 (export all threshold buckets).
          latency_buckets_count = 0
    
          # Order of context - namespace, set, latencies, node-stats, xdr, user, jobs, sindex
    
          # Metrics Allowlist - If specified, only these metrics will be scraped. An empty list will exclude all metrics.
          # Commenting out the below allowlist configs will disable metrics filtering (i.e. all metrics will be scraped).
    
          # Metrics Blocklist - If specified, these metrics will be NOT be scraped. An empty list will include all metrics.
          # Commenting out the below blocklist configs will disable metrics filtering (i.e. no metrics will be blocked/filtered).
    
          # globbing pattern (wildcard) are allowd for allowlist and blocklist
          # for example "batch_index_*_buffers"
    
          # Namespace metrics allowlist, to control which Namespace metrics should be collected.
          # namespace_metrics_allowlist = []
          # namespace_metrics_blocklist = []
    
          # set_metrics_allowlist = []
          # set_metrics_blocklist = []
    
          # Latencies histogram allowlist, to control which Histogram-name metrics should be collected. 
          # Note: globbing patterns (wildcard) are not supported for this latency metric configuration. 
          # latencies_metrics_allowlist = []
          # latencies_metrics_blocklist = []
    
          # node_metrics_allowlist = []
          # node_metrics_blocklist = []
    
          # Support only from Aerospike versions 5.0 and above
          # xdr_metrics_allowlist = []
          # xdr_metrics_blocklist = []
    
          # User statistics are available in Aerospike 5.6+
          # Note globbing patterns (wildcard) are not supported for this User configuration.
          # user_metrics_users_allowlist = []
          # user_metrics_users_blocklist = []
    
          # sindex_metrics_allowlist = []
          # sindex_metrics_blocklist = []
    
    namespace_metrics_allowlist=[
    "client_read_[a-z]*",
    "stop_writes",
    "storage-engine.file.defrag_q",
    "client_write_success",
    "memory_*_bytes",
    "objects",
    "*_available_pct"
    ]
    
    # Set metrics allowlist
    set_metrics_allowlist=[
    "objects",
    "tombstones"
    ]
    
    # Node metrics allowlist
    node_metrics_allowlist=[
    "uptime",
    "cluster_size",
    "batch_index_*",
    "xdr_ship_*"
    ]
    
    # XDR metrics allowlist (only for Aerospike versions 5.0 and above)
    xdr_metrics_allowlist=[
    "success",
    "latency_ms",
    "throughput",
    "lap_us"
    ]
    
    # Job (scans/queries) metrics allowlist
    job_metrics_allowlist = [
    "rps",
    "active-threads",
    "job-progress",
    "run-time",
    "recs-throttled",
    "recs-succeeded",
    "recs-failed",
    "net-io-bytes"
    ]
    
    # Secondary index metrics allowlist
    sindex_metrics_allowlist = [
    "entries",
    "ibtr_memory_used",
    "nbtr_memory_used",
    "query_basic_complete",
    "query_basic_error",
    "query_basic_abort",
    "query_basic_avg_rec_count"
    ]
    
    # Metrics Blocklist - If specified, these metrics will be NOT be scraped.
    
    # Namespace metrics blocklist
    namespace_metrics_blocklist=[
    "memory_used_sindex_bytes",
    "client_read_success"
    ]
    
    # Set metrics blocklist
    # set_metrics_blocklist=[]
    
    # Node metrics blocklist
    node_metrics_blocklist=[
    "batch_index_*_buffers"
    ]
  3. Start the aerospike-prometheus-exporter services.
    systemctl daemon-reaload
    systemctl start aerospike-prometheus-exporter
    systemctl status aerospike-prometheus-exporter
    ps aux | grep expo
    journalctl -u aerospike-prometheus-exporter
    /usr/bin/aerospike-prometheus-exporter --help
    semanage port -l | grep 9145
    systemctl enable aerospike-prometheus-exporter
    systemctl status aerospike-prometheus-exporter
    curl -kv  http://localhost:9145/metrics