From 09a74f7986c1447f8287736a971cd046fffd19e1 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 21 Jun 2024 15:28:13 +0100 Subject: [PATCH 1/5] removed digitalocean doc (only has basic install instructions already covered) --- docs/kb/digitalocean.md | 138 ---------------------------------------- 1 file changed, 138 deletions(-) delete mode 100644 docs/kb/digitalocean.md diff --git a/docs/kb/digitalocean.md b/docs/kb/digitalocean.md deleted file mode 100644 index 3ae34ad12..000000000 --- a/docs/kb/digitalocean.md +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: Installing kdb+ on Ubuntu at DigitalOcean | Learn | kdb+ and q documentation -description: How to install kdb+ under Ubuntu at DigitalOcean -author: Stephen Taylor ---- -# :fontawesome-brands-digital-ocean: Installing kdb+ on Ubuntu at DigitalOcean - - - -!!! warning "Only commercial licenses allow installing kdb+ on a cloud server." - -In this scenario you [install](../learn/install.md) kdb+ on a [DigitalOcean](https://www.digitalocean.com/) ‘droplet’ (cloud server) running Ubuntu. -kdb+ tasks on the droplet will be able to offer services over the Net. - -You access and control the droplet via SSH and Bash. - -Your droplet is identified by an IP address. -For this tutorial we suppose you have listed the droplet’s IP address in your local hosts file as `droplet.dev`. -(If not, in the following replace `droplet.dev` with the IP address.) - -This tutorial supposes you - -- run Bash on your local machine -- install 32-bit kdb+ on a 32-bit Ubuntu droplet, e.g. `16.04.5 x32` -- intend on the server to run one or more scripts, rather than interactive sessions - -To run 32-bit kdb+ on a 64-bit server, see the [install notes](../learn/install.md#step-2-put-kdb-in-qhome). - - -## :fontawesome-solid-download: Download - -[Download 32-bit kdb+](https://kx.com/connect-with-us/download/) to your local machine and unzip it. -You will want the `l32.zip` download. - -Change directory to the parent of the folder `q`. -Your unzipped files look like this: - -```txt -$ tree . -├── q -│   ├── l32 -│   │   └── q -│   ├── q.k -$ -``` - - -## :fontawesome-solid-upload: Upload - -Upload the kdb+ files to your droplet. - -Here we suppose you followed [recommended practice](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04) and created a non-root user with superuser privileges. - -We suppose you named this user `boss`, -and that the kdb+ files will be stored at `/home/boss/q` and run by user `boss`. - -```bash -$ scp -r . boss@droplet.dev:/home/boss/q -Enter passphrase for key '/Users/me/.ssh/id_rsa': -q.k 100% 22KB 116.1KB/s 00:00 -q 100% 642KB 638.2KB/s 00:01 -q.k 100% 22KB 78.9KB/s 00:00 -q -``` - - -## :fontawesome-solid-code: Define q alias - -SSH from your local machine to your droplet. -Edit the Bash profile for non-login (i.e. non-interactive) sessions. - -```bash -$ ssh boss@droplet.dev -Enter passphrase for key '/Users/me/.ssh/id_rsa': -Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-131-generic i686) -… -boss@droplet:~$ nano ~/.bashrc -``` - -Append the following line to the file. - -```txt -alias q='QHOME=~/q ~/q/l32/q' -``` - -The Bash profile `.bashrc` sets the environment used for non-login sessions, for example, any script that you set up as a daemon under Systemctl. - - -## :fontawesome-solid-check: Confirm successful installation - -Run `.bashrc` now for your current (login) session. - -```bash -boss@droplet:~$ source .bashrc -``` - -Confirm kdb+ runs. - -```bash -boss@droplet:~$ q -KDB+ 3.6 2018.07.30 Copyright (C) 1993-2018 Kx Systems -l32/ 2()core 4041MB boss install-test 127.0.1.1 NONEXPIRE - -q)til 6 -0 1 2 3 4 5 -q)\\ -boss@droplet:~$ -``` - - -## :fontawesome-solid-code: Rlwrap - -Interactive kdb+ sessions under Linux use Rlwrap to recall lines from the keyboard buffer. -This is less useful for the non-interactive sessions you run on your droplet. - -Just as well, because it does not appear possible to install Rlwrap on these droplets. - -```bash -boss@droplet:~$ rlwrap -r q -The program 'rlwrap' is currently not installed. You can install it by typing: -sudo apt install rlwrap -boss@droplet:~$ sudo apt install rlwrap -[sudo] password for boss: -Reading package lists... Done -Building dependency tree -Reading state information... Done -E: Unable to locate package rlwrap -boss@droplet:~$ -``` - - -## :fontawesome-regular-hand-point-right: What’s next? - -Set up a script to run as a service on your droplet: - -:fontawesome-brands-digital-ocean: -[How To Use Systemctl to Manage Systemd Services and Units](https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units) - From 05f2df79eb2f1d0435944f539ad050db6f18d8be Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 21 Jun 2024 15:41:18 +0100 Subject: [PATCH 2/5] removed client-server page - was duplicating info --- docs/basics/listening-port.md | 4 +- docs/kb/client-server.md | 143 ---------------------------------- docs/ref/hopen.md | 1 - mkdocs.yml | 2 - 4 files changed, 1 insertion(+), 149 deletions(-) delete mode 100644 docs/kb/client-server.md diff --git a/docs/basics/listening-port.md b/docs/basics/listening-port.md index 346e6a64b..3d9059277 100644 --- a/docs/basics/listening-port.md +++ b/docs/basics/listening-port.md @@ -7,7 +7,7 @@ keywords: ephemeral, kdb+, listen, multi-threaded, port, q, socket, unix -Use the `-p` [command-line option](cmdline.md) or the `\p` [system command](syscmds.md) to tell kdb+ to listen to a port. The command-line option and the system command take the same parameters. +Use the [`-p` command-line option](cmdline.md#-p-listening-port) or the [`\p` system command](syscmds.md#p-listening-port) to tell kdb+ to listen to a port. The command-line option and the system command take the same parameters. ```txt \p [rp,][hostname:][portnumber|servicename] @@ -38,8 +38,6 @@ q)\p 0i ``` -Use for [client/server](../kb/client-server.md), e.g. kdbc(JDBC ODBC), HTTP (HTML XML TXT CSV). - Given a servicename, q will look up its port number in `/etc/services`. ```q diff --git a/docs/kb/client-server.md b/docs/kb/client-server.md deleted file mode 100644 index 8e3bebe49..000000000 --- a/docs/kb/client-server.md +++ /dev/null @@ -1,143 +0,0 @@ ---- -title: Basic client-server computing | Knowledge Base | kdb+ and q documentation -description: A kdb+ server can listen for connections on a port. Clients can then send requests to the server via that port. A kdb+ process starts listening to a port either at start-up, via a command-line argument. ---- -# Basic client-server computing - - - - -A kdb+ server can listen for connections on a port. Clients can then send requests to the server via that port. - -A kdb+ process starts listening to a port either at start-up, via a command-line argument. - -```bash -q -p 5001 -``` -or at a later time, using the command `\p` - -```q -q)\p 5001 -``` - -!!! tip "Secure it" - - You can restrict the interface by starting - - ```bash - q -p 127.0.0.1:5000 - ``` - - or within q - - ```q - q)\p 127.0.0.1:5000 - ``` - -To stop listening, you can ask the server to listen on port zero, like this - -```q -q)\p 0 -``` -Clients can be other q processes, or they can be written in C, Java, C\#, etc. This is an example of a Java client: - -```bash -sudo cp -r /var/www/q . -sudo chown -R fred:fred q -``` - -```java -public class KDBClient { - - public static void main(String[] args) { - try{ - // create q server object - c kdbServer = new c("localhost",5001); - // create a row (array of objects) - Object[] row= {new Time(System.currentTimeMillis()%86400000), "IBM", new Double(93.5), new Integer(300)}; - // insert the row into the trade table - kdbServer.ks("insert","trade", row); - // send a sync message (see below for an explanation) - kdbServer.k(""); - // execute a query in the server that returns a table - Flip table = td(kdbServer.k("select sum size by sym from trade")); - // read the data from the Flip object ... - // close connection to q server - kdbServer.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } -} -``` - -!!! note "Parameters and result" - - The parameters to methods `k` and `ks`, and its result are arbitrarily-nested arrays (Integer, Double, int[], !DateTime, etc). - -This client does not need a reply after the insert, so it sends an asynchronous message using method `ks`. For the select, it expects a table as a result, and sends a synchronous message using method `k`. - -:fontawesome-bands-github: -[Java client for q](https://github.com/KxSystems/javakdb) - -A q client process connects to a server using `hopen`: - -```q -q)h: hopen `:localhost:5001 -``` - -The syntax of the argument to `hopen` is - -```q -`:host:port -``` - -where `host` is the hostname of the server. In this example, the client is in the same machine as the server, so we use `localhost`. - -We have assigned the handle of the connection to the variable `h`. To close the connection, write - -```q -q)hclose h -``` - -From a q client, a synchronous message is sent simply like this: - -```q -q)h "select sum size by sym from trade" -sym | amount ------| --------- -amd | 324928400 -amzn | 326589900 -goog | 324356900 -ibm | 324553500 -intel| 324721900 -msft | 324377400 -``` - -To send an asynchronous message, use the handle value, negated - -```q -q)(neg h) "insert[`trade](10:30:01.000; `intel; 88.5; 1625)" -``` - -Execution of this message returns immediately with no result. - -Messages can also be created as lists instead of strings. For instance: - -```q -q)(neg h) (insert; `trade; (10:30:01.000; `intel; 88.5; 1625)) -``` - -In most realistic situations the data to be inserted is not constant, but is either generated algorithmically or received from an external source. Consequently, the list message format is the more generally useful one because it does not require formatting the data into strings. - -If you want to send a bunch of async messages, and then wait for them to complete processing, you can chase them with - -```q -q)h "" -``` - -which will cause the client to block until the server sends a null reply to that message. - -:fontawesome-regular-hand-point-right: -[Interprocess communication](../basics/ipc.md) - diff --git a/docs/ref/hopen.md b/docs/ref/hopen.md index 39066f0cd..900b458a4 100644 --- a/docs/ref/hopen.md +++ b/docs/ref/hopen.md @@ -195,7 +195,6 @@ One-shot sync queries can now execute via `` `::[(":host:port";timeout);query]`` [Interprocess communication](../basics/ipc.md)
:fontawesome-solid-graduation-cap: -[Client-server](../kb/client-server.md), [Named pipes](../kb/named-pipes.md), [SSL/TLS](../kb/ssl.md)
diff --git a/mkdocs.yml b/mkdocs.yml index 3a8aa2247..f6d1f4a34 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -525,7 +525,6 @@ nav: - Examples: architecture/examples.md - Alternative in-memory layouts: kb/alternative-in-memory-layouts.md - Chained tickerplant: kb/chained-tickerplant.md - - Client-server: kb/client-server.md - Corporate actions: kb/corporate-actions.md - Data recovery for kdb+tick (WP): wp/data-recovery.md - Disaster recovery (WP): wp/disaster-recovery/index.md @@ -602,7 +601,6 @@ nav: - ObjectiveFS: cloud/otherfs/objectivefs.md - WekaIO Matrix: cloud/otherfs/wekaio-matrix.md - Quobyte: cloud/otherfs/quobyte.md - - DigitalOcean: kb/digitalocean.md - Academy: https://learninghub.kx.com - Discussion Forum: https://learninghub.kx.com/forums/forum/kdb - White papers: wp/index.md From 2104f2b96121e20be78253faed95c8d2062edd08 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 21 Jun 2024 16:11:28 +0100 Subject: [PATCH 3/5] fixed gcpm link (old page with no nav) & azure link --- docs/cloud/gcpm/index.md | 33 --------------------------------- docs/cloud/index.md | 4 ++-- 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 docs/cloud/gcpm/index.md diff --git a/docs/cloud/gcpm/index.md b/docs/cloud/gcpm/index.md deleted file mode 100644 index a88e1f167..000000000 --- a/docs/cloud/gcpm/index.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: kdb+ on Google Cloud Platform Marketplace – Cloud – kdb+ and q documentation -description: How-to deploy kdb+ on Google Cloud Platform Marketplace -author: Glenn Wright -keywords: cloud, gcpm, google, google cloud platform marketplace, kdb+ ---- -# kdb+ on Google Cloud Platform Marketplace - - - - -Select `kdb+` from the [GCP Marketplace console](https://console.cloud.google.com/marketplace/details/kx-kdb-vm-public/kdb?q=kdb%2B&id=2ea31279-c1cd-4177-872c-e569c81651d6) and click _Launch on Compute Engine_ - -![kdb+ on GCL](img/gcpm-landing.png) - - -## Deploy kdb+ - -1. Choose a name for your kdb+ instance -2. Choose a machine type with at least 6 GB of RAM; kdb+ charges you only based on the number of cores -3. Click _Deploy_ - - ![GCL Deploy](img/gcpm-deploy.png) - -4. See it run! - - ![GCL Deploy done](img/gcpm-deploy-done.png) - - -## First steps - -Once your instance is up and running you can connect via SSH and take your [first steps](../../learn/brief-introduction.md). - diff --git a/docs/cloud/index.md b/docs/cloud/index.md index 785bad203..70c1baa75 100644 --- a/docs/cloud/index.md +++ b/docs/cloud/index.md @@ -53,7 +53,7 @@ Some motivations for cloud deployments: KX customers have deployed kdb+ and other KX solutions successfully in the cloud, including the three main cloud vendors: - [kdb+ on Amazon Web Services](aws/index.md) :fontawesome-brands-aws: -- [kdb+ on Google Cloud Platform](gcpm/index.md) -- Microsoft Azure +- [kdb+ on Google Cloud Platform](gcpm/architecture.md) +- [kdb+ on Microsoft Azure](azure/architecture.md) From 872bdf17df73e8fe00b84772e42e1d77222cf47c Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 21 Jun 2024 16:33:22 +0100 Subject: [PATCH 4/5] moved pages in nav to their correct sections --- mkdocs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index f6d1f4a34..c91945202 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -460,6 +460,7 @@ nav: - SSL/TLS: kb/ssl.md - HTTP: kb/http.md - WebSockets: kb/websockets.md + - WebSockets (WP): wp/websockets/index.md - Interprocess communication (WP): wp/ipc/index.md - Tools: - Code profiler: kb/profiler.md @@ -539,10 +540,8 @@ nav: - Performance tests: architecture/optane-tests.md - Order Book (WP): wp/order-book.md - Publish and subscribe: kb/publish-subscribe.md - - Pub/sub with Solace (WP): wp/solace/index.md - Query Routing (WP): wp/query-routing/index.md - Real-time tick subscribers (WP): wp/rt-tick/index.md - - WebSockets (WP): wp/websockets/index.md - Write-only RDB: kb/w-q.md - Advanced: - Distributed systems (WP): wp/query-interface.md @@ -565,7 +564,8 @@ nav: # - ODBC/Simba: interfaces/odbc-simba.md - R: interfaces/r.md - Scala: interfaces/scala-client-for-q.md - - Open source: github.md + - Pub/sub with Solace (WP): wp/solace/index.md + - Open source: github.md - Using kdb+ in the cloud: - About: cloud/index.md - Amazon Web Services: From 2c7e78a254182115501504548629e1e310aa3b26 Mon Sep 17 00:00:00 2001 From: Simon Shanks Date: Fri, 21 Jun 2024 16:42:27 +0100 Subject: [PATCH 5/5] moved install/license to its own section --- mkdocs.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index c91945202..320055718 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -109,10 +109,11 @@ nav: - Home: 'https://code.kx.com/home' - kdb+ and q: - About: index.md - - Learn: - - Get started: learn/index.md + - Getting Started: - Install: learn/install.md - Licenses: learn/licensing.md + - Learn: + - Overview: learn/index.md - Mountain tour: - Overview: learn/tour/overview.md - Begin here: learn/tour/index.md