GithubHelp home page GithubHelp logo

isabella232 / aerospike-server-federal.docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aerospike/aerospike-server-federal.docker

0.0 0.0 0.0 26 KB

Dockerfile for Aerospike Server Federal Edition

License: Other

Shell 47.54% Dockerfile 52.46%

aerospike-server-federal.docker's Introduction

Aerospike Server Enterprise Edition for United States Federal Docker Image

What is Aerospike?

Aerospike is a distributed NoSQL database purposefully designed for high performance web scale applications. Aerospike supports key-value and document data models, and has multiple data types including List, Map, HyperLogLog, GeoJSON, and Blob. Aerospike's patented hybrid memory architecture delivers predictable high performance at scale and high data density per node.

aerospike_square_logo

Getting Started

Aerospike Server Enterprise Edition for United States Federal requires a feature key file to start and to ungate certain features in the database, such as compression. Federal customers can use their production or development keys.

Anyone can sign up to get an evaluation feature key file for a full-featured, single-node Aerospike Server Enterprise Edition for United States Federal.

Aerospike Community Edition supports the same developer APIs as Aerospike Server Enterprise Edition for United States Federal, and differs in ease of operation and federal features. See the product matrix for more.

Running a node with a feature key file in a mapped directory

docker run -d -v DIR:/opt/aerospike/etc/ -e "FEATURE_KEY_FILE=/opt/aerospike/etc/features.conf" --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server-federal

Above, DIR is a directory on your machine where you drop your feature key file. Make sure Docker Desktop has file sharing permission to bind mount it into Docker containers.

Running a node with a feature key file in an environment variable

FEATKEY=$(base64 ~/Desktop/evaluation-features.conf)
docker run -d -e "FEATURES=$FEATKEY" -e "FEATURE_KEY_FILE=env-b64:FEATURES" --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server-federal

Connecting to your Aerospike contianer

You can use the latest aerospike-tools image to connect to your Aerospike container.

Using aql

docker run -ti aerospike/aerospike-tools:latest aql -h  $(docker inspect -f '{{.NetworkSettings.IPAddress }}' aerospike)

Seed:         172.17.0.2
User:         None
Config File:  /etc/aerospike/astools.conf /root/.aerospike/astools.conf 
Aerospike Query Client
Version 3.30.0
C Client Version 4.6.17
Copyright 2012-2020 Aerospike. All rights reserved.
aql> show namespaces
+------------+
| namespaces |
+------------+
| "test"     |
+------------+
[172.17.0.2:3000] 1 row in set (0.002 secs)

OK

aql> help

Using asadm

docker run -ti aerospike/aerospike-tools:latest asadm -h  $(docker inspect -f '{{.NetworkSettings.IPAddress }}' aerospike)

Seed:        [('172.17.0.2', 3000, None)]
Config_file: /root/.aerospike/astools.conf, /etc/aerospike/astools.conf
Aerospike Interactive Shell, version 0.6.0

Found 1 nodes
Online:  172.17.0.2:3000

Admin> info
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Network Information (2022-04-17 06:03:07 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           Node               Node                Ip       Build   Cluster   Migrations        Cluster     Cluster         Principal   Client     Uptime   
              .                 Id                 .           .      Size            .            Key   Integrity                 .    Conns          .   
172.17.0.2:3000   *BB9020011AC4202   172.17.0.2:3000     6.0.0.0         1      0.000     D7E8EE69743C   True        BB9020011AC4202        1   00:08:40   
Number of rows: 1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Namespace Usage Information (2022-04-17 06:03:07 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Namespace              Node     Total   Expirations,Evictions     Stop       Disk    Disk     HWM   Avail%        Mem     Mem    HWM      Stop      PI         PI      PI     PI   
        .                 .   Records                       .   Writes       Used   Used%   Disk%        .       Used   Used%   Mem%   Writes%    Type       Used   Used%   HWM%   
test        172.17.0.2:3000   0.000     (0.000,  0.000)         false    0.000 B    0       0       99       0.000 B    0       0      90        shmem   0.000 B    N/E     N/E    
test                          0.000     (0.000,  0.000)                  0.000 B                             0.000 B                                     0.000 B                   
Number of rows: 2

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Namespace Object Information (2021-04-17 06:03:07 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Namespace              Node     Total     Repl                      Objects                   Tombstones             Pending   Rack   
        .                 .   Records   Factor   (Master,Prole,Non-Replica)   (Master,Prole,Non-Replica)            Migrates     ID   
        .                 .         .        .                            .                            .             (tx,rx)      .   
test        172.17.0.2:3000   0.000     1        (0.000,  0.000,  0.000)      (0.000,  0.000,  0.000)      (0.000,  0.000)     0      
test                          0.000              (0.000,  0.000,  0.000)      (0.000,  0.000,  0.000)      (0.000,  0.000)            
Number of rows: 2

Advanced Configuration

The Aerospike FE Docker image has a default configuration file template that can be populated with individual configuration parameters, as we did before with FEATURE_KEY_FILE. Alternatively, it can be replaced with a custom configuration file.

The following sections describe both advanced options.

Injecting configuration parameters

You can inject parameters into the configuration template using container-side environment variables with the -e flag.

For example, to set the default namespace name to demo:

docker run -d --name aerospike -e "NAMESPACE=demo" -p 3000-3002:3000-3002 -v /my/dir:/opt/aerospike/etc/ -e "FEATURE_KEY_FILE=/opt/aerospike/etc/features.conf" aerospike/aerospike-server-federal

Injecting configuration parameters into the configuration template isn't compatible with using a custom configuration file. You can use one or the other.

List of template variables

  • FEATURE_KEY_FILE - the feature_key_file. Default: /etc/aerospike/features.conf
  • LOGFILE - the file param of the logging context. Default: /dev/null, do not log to file, log to stdout
  • SERVICE_ADDRESS - the bind address of the networking.service subcontext. Default: any
  • SERVICE_PORT - the port of the networking.service subcontext. Default: 3000
  • HB_ADDRESS - the networking.heartbeat address for cross cluster mesh. Default: any
  • HB_PORT - the port for networking.heartbeat communications. Default: 3002
  • FABRIC_ADDRESS - the address of the networking.fabric subcontext. Default: any
  • FABRIC_PORT - the port of the networking.fabric subcontext. Default: 3001

The single preconfigured namespace is in-memory with filesystem persistence

  • NAMESPACE - the name of the namespace. Default: test
  • REPL_FACTOR - the namespace replication-factor. Default: 2
  • MEM_GB - the namespace memory-size. Default: 1, the unit is always G (GB)
  • DEFAULT_TTL - the namespace default-ttl. Default: 30d
  • STORAGE_GB - the namespace persistence file size. Default: 4, the unit is always G (GB)
  • NSUP_PERIOD - the namespace nsup-period. Default: 120 , nsup-period in seconds

Using a custom configuration file

You can override the use of the configuration file template by providing your own aerospike.conf, as described in Configuring Aerospike Database.

You should first -v map a local directory, which Docker will bind mount. Next, drop your aerospike.conf file into this directory. Finally, use the --config-file option to tell Aerospike where in the container the configuration file is (the default path is /etc/aerospike/aerospike.conf). Remember that the feature key file is required, so use feature-key-file in your config file to point to a mounted path (such as /opt/aerospike/etc/feature.conf).

For example:

docker run -d -v /opt/aerospike/etc/:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server-federal --config-file /opt/aerospike/etc/aerospike.conf

Persistent data directory

With Docker, the files within the container are not persisted past the life of the container. To persist data, you will want to mount a directory from the host to the container's /opt/aerospike/data using the -v option:

For example:

docker run -d  -v /opt/aerospike/data:/opt/aerospike/data  -v /opt/aerospike/etc:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 -e "FEATURE_KEY_FILE=/opt/aerospike/etc/features.conf" aerospike/aerospike-server-federal

The example above uses the configuration template, where the single defined namespace is in-memory with file-based persistence. Just mounting the predefined /opt/aerospike/data directory enables the data to be persisted on the host.

Alternatively, a custom configuration file is used with the parameter file set to be a file in the mounted /opt/aerospike/data, such as in the following config snippet:

namespace test {
	# :
	storage-engine device {
		file /opt/aerospike/data/test.dat
		filesize 4G
		data-in-memory true
	}
}

In this example we also mount the data directory in a similar way, using a custom configuration file

docker run -d -v /opt/aerospike/data:/opt/aerospike/data -v /opt/aerospike/etc/:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server-federal --config-file /opt/aerospike/etc/aerospike.conf

Block Storage

Docker provides an ability to expose a host's block devices to a running container. The --device option can be used to map a host block device within a container.

Update the storage-engine device section of the namespace in the custom aerospike configuration file.

namespace test {
	# :
	storage-engine device {
		device /dev/xvdc
			write-block-size 128k
	}
}

Now to map a host drive /dev/sdc to /dev/xvdc on a container

docker run -d --device '/dev/sdc:/dev/xvdc' -v /opt/aerospike/etc/:/opt/aerospike/etc/ --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server-federal --config-file /opt/aerospike/etc/aerospike.conf

Persistent Lua cache

Upon restart, your Lua cache will become emptied. To persist the cache, you will want to mount a directory from the host to the container's /opt/aerospike/usr/udf/lua using the -v option:

docker run -d -v /opt/aerospike/lua:/opt/aerospike/usr/udf/lua -v /opt/aerospike/data:/opt/aerospike/data --name aerospike -p 3000-3002:3000-3002 -e "FEATURE_KEY_FILE=/opt/etc/aerospike/features.conf" aerospike/aerospike-server-federal

A note about security

For convenience, this image does not have security turned on by default, but it is a core Aerospike FE feature. The knowledge base article How To secure Aerospike database servers covers the topic well.

And Now for a Security Reminder that bad things can happen to good people.

Clustering

Developers using the Aerospike FE single-node evaluation, and most others using Docker Desktop on their machine for development, will not need to configure the node for clustering. If you're interested in using clustering and have a feature key file without a single node limit, read the following sections.

Configuring the node's access address

In order for the Aerospike node to properly broadcast its address to the cluster and applications, the access-address configuration parameter needs to be set in the configuration file. If it is not set, then the IP address within the container will be used, which is not accessible to other nodes.

	network {
		service {
			address any                  # Listening IP Address
			port 3000                    # Listening Port
			access-address 192.168.1.100 # IP Address used by cluster nodes and applications
		}

Mesh Clustering

Mesh networking requires setting up links between each node in the cluster. This can be achieved in two ways:

  1. Add a configuration for each node in the cluster, as defined in Network Heartbeat Configuration.
  2. Use asinfo to send the tip command, to make the node aware of another node, See an example of sending the tip command with asinfo.

For more, see How do I get a 2 nodes Aerospike cluster running quickly in Docker without editing a single file?

Image Versions

These images are based on debian:buster-slim.

Reporting Issues

Aerospike FE evaluation users, if you have any problems with or questions about this image, please post on the Aerospike discussion forum or open an issue in aerospike/aerospike-server-federal.docker.

Federal customers are welcome to participate in the community forum, but can also report issues through the federal support system.

License

If you are using the Aerospike Database FE evaluation feature key file, you are operating under the Aerospike Evaluation License Agreement.

If you are using a feature key file you received as part of your federal license, you are operating under the Aerospike Master License Agreement.

aerospike-server-federal.docker's People

Contributors

mcoberly2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.