Coder Social home page Coder Social logo

nats.docs's People

Contributors

alberic-hardis avatar aricart avatar ariel-zilber avatar autodidaddict avatar boris-ilijic avatar bruth avatar caleblloyd avatar codegangsta avatar colinsullivan1 avatar davedotdev avatar derekcollison avatar gcolliso avatar gingermoon avatar jarema avatar jnmoyne avatar jordan-rash avatar kozlovic avatar matthiashanel avatar mdawar avatar nanjj avatar nav9 avatar navinpro avatar philpennock avatar rauno56 avatar rodrigc avatar scottf avatar tbeets avatar variadico avatar wallyqs avatar xieyuschen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nats.docs's Issues

Jetstream Documentation

Integrate documentation at https://github.com/nats-io/jetstream here. Enhance and add as necessary.

See #178 (The Jetstream readme is being translated into documentation)

This includes:

  • General Description and Applicable Use Cases
  • Concepts
  • Getting Started Guide - Simple setup based on our recommendations.
  • Server documentation
  • Basic parameters/configuration options
  • Security
  • Developing clients with Jetstream
  • Monitoring
  • Administration and usage (CLI)
  • Securing Jetstream

Section could be under: https://github.com/nats-io/nats.docs/tree/master/jetstream.

Of course, add additional documentation as necessary.

/CC @gcolliso

build failed: unknown block tag: tabs

# make
gitbook install
info: installing 5 plugins using [email protected]
...
info: install plugin "edit-link" (*) from NPM with version 2.0.2
info: >> plugin "edit-link" installed with success
sed -i.bak 's/fa-edit/fa-github/g' node_modules/gitbook-plugin-edit-link/book/plugin.js
go run _tools/examplecompiler/main.go -o _examples -r _tools/examplecompiler/example_repos.json -t _tools/examplecompiler/example_template.tmp
Working directory created: "/tmp/site_examples713379379"
Insuring output folder: _examples
Downloading repo: "https://github.com/nats-io/java-nats-examples.git"
Searching for examples in: "/tmp/site_examples713379379/repos/java-nats-examples"
...
Formatting examples
        Formatted "connect_tls" to "_examples/connect_tls.html"
...
        Formatted "subscribe_sync" to "_examples/subscribe_sync.html"
rm -rf _.docs
gitbook build . _docs
info: 12 plugins are installed
info: 9 explicitly listed
info: loading plugin "prism"... OK
info: loading plugin "include-html"... OK
info: loading plugin "toggle-chapters"... OK
info: loading plugin "anchors"... OK
info: loading plugin "edit-link"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 175 pages
info: found 36 asset files
warn: "options" property is deprecated, use config.get(key) instead
warn: "options.generator" property is deprecated, use "output.name" instead
error: error while generating page "developing-with-nats/connecting/specific_server.md":

Template render error: (/nats.docs/developing-with-nats/connecting/specific_server.md) [Line 9, Column 2]
  unknown block tag: tabs
Makefile:2: recipe for target 'build' failed
make: *** [build] Error 1
#

"Creating an Operator" documentation needs updating

https://docs.nats.io/nats-tools/nsc/nsc#creating-an-operator claims nsc add operator -n Test output should look like

Generated operator key - private key stored “~/.nkeys/Test/Test.nk”
Success! - added operator "Test"

but it looked like

$ nsc add operator -n Test
[ OK ] generated and stored operator key "OAXE7CKC44VD2ENMV5G5M7FH4OWSEVWF2NC3AYWLIGHKYZ6KHL46RGWF"
[ OK ] added operator "Test"

.

Also, ~/.nkeys/Test/Test.nk doesn't exist on my machine:

$ tree ~/.nkeys
/Users/jrantil/.nkeys
├── creds
└── keys
    └── O
        └── AX
            └── OAXE7CKC44VD2ENMV5G5M7FH4OWSEVWF2NC3AYWLIGHKYZ6KHL46RGWF.nk

4 directories, 1 file

Deployment apiVersion issue

Followed the docs

It gives an error

no matches for kind "Deployment" in version "extensions/v1beta1"

Same doesn't work with apps/v1, which gives an error saying selector missing.

Please update

Guidance on tracking down missed messages / mismatched subscriptions

I'm not sure where to put this right now so am opening an issue. We should provide guidance on how to track down missing messages / mismatched subscriptions.

Check for Errors

First search the server logs for authorization errors.

Test the subscription

http://demo.nats.io:8222/subsz?subs=1&test=yoursubject

If there's a listener on your subject, you'll get a list returned like:

{
  "server_id": "NCPRDHZCF4V54OQWYICZIFNCXECVZGS7WITJ7UVIFDT6IJZRSSMOMCPV",
  "now": "2021-01-25T11:29:03.914444926-05:00",
  "num_subscriptions": 39,
  "num_cache": 7,
  "num_inserts": 3643482,
  "num_removes": 3643443,
  "num_matches": 77212,
  "cache_hit_rate": 0.45173240075124665,
  "max_fanout": 1,
  "avg_fanout": 0.5714285714285714,
  "total": 1,
  "offset": 0,
  "limit": 1024,
  "subscriptions_list": [
    {
      "account": "$G",
      "subject": "yoursubject",
      "sid": "0",
      "msgs": 0,
      "cid": 68352
    }
  ]
}

If there are no active subscriptions on the supplied subject then no subscriptions_list field will be returned.

Inspect subscriptions

via connections endpoint: http://demo.nats.io:8222/connz?subs=1
via subscriptions endpoint: http://demo.nats.io:8222/subsz?subs=1

Check recently closed connections

You may also want to check closed connections to see if there was a disconnect at the time you are missing messages.
http://demo.nats.io:8222/connz?state=closed

If you named the connection in the application, you should be able to easily track down that application's connection closed events and the reason.

Watch published messages

nats-sub your.subject

Watch all published messages and look for a subject mismatch

nats-sub ">"

Debug/Verbose Mode

Run the server with -DV flags and watch protocol messages (or reload with debug:true verbose:true). This is intrusive and impacts performance so should be used sparingly in production.

2.2 MQTT Documentation

Section could be under: https://github.com/nats-io/nats.docs/tree/master/nats-server as "Native MQTT Support". If this documentation should be in a different place please comment here.

In a PR, please provide enough documentation to get started:

  • General Description and Applicable Use Cases (@ColinSullivan1 )
  • Getting Started Guide - Simple setup based on our recommendations.
  • Basic parameters/configuration options
  • Basic security

Of course, add additional documentation as necessary.

/CC @gcolliso

Maybe the command in sql_store.md should be update

I am new to nats-streaming and docker, I don't know if there is any misunderstanding.

Maybe the command in sql_store.md should be update or declare the environment.($VAR looks like a UNIX environment, but the docker run command like under Windows, or just a mistake? cuz the things after --name should be a name, and nats-streaming-local does not exist)

... docker run -d --name nats-streaming -p 4222:4222 -p 8222:32768 nats-streaming-local -SDV --store sql ...

It would be better if there is a line break between getting bridge ip and docker run.

And using this command did not see the management port exposed, I need to use the -m parameter to explicitly declare the port. Is this related to nats streaming itself?
Here is my command (WSL2 based docker,HOST_PG_PORT is another variable used to modify the mapped port of postgres):
docker run -d --name nats-streaming-local -p 4222:4222 -p 8222:8222 nats-streaming -m 8222 -SDV --store sql --sql_driver postgres --sql_source="user=postgres password=postgres host=$DOCKER_BRIDGE_IP port=$HOST_PG_PORT sslmode=disable"

log like this before add -m:

[1] 2020/11/19 08:49:55.238433 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.19.0
[1] 2020/11/19 08:49:55.238512 [INF] STREAM: ServerID: cwjWoieQmrQGs9Ze5XCLDA
[1] 2020/11/19 08:49:55.238517 [INF] STREAM: Go version: go1.14.10
[1] 2020/11/19 08:49:55.238520 [INF] STREAM: Git commit: [c658000]
[1] 2020/11/19 08:49:55.286688 [INF] Starting nats-server version 2.1.9
[1] 2020/11/19 08:49:55.286724 [INF] Git commit [7c76626]
[1] 2020/11/19 08:49:55.287131 [INF] Listening for client connections on 0.0.0.0:4222
[1] 2020/11/19 08:49:55.287164 [INF] Server id is NDONJSDF6PGAVG2BS6GP3MQBTIUSIJOVEZ5PISWU6TDJSR7C7A6G2VOY
[1] 2020/11/19 08:49:55.287167 [INF] Server is ready
[1] 2020/11/19 08:49:55.313929 [INF] STREAM: Recovering the state...
[1] 2020/11/19 08:49:55.316508 [INF] STREAM: Recovered 0 channel(s)
[1] 2020/11/19 08:49:55.566947 [DBG] STREAM: Did not detect another server instance
[1] 2020/11/19 08:49:55.567145 [DBG] STREAM: Discover subject: _STAN.discover.test-cluster
[1] 2020/11/19 08:49:55.567209 [DBG] STREAM: Publish subject: _STAN.pub.gJzQuNy1b5QJX66sUUoBEB.>
[1] 2020/11/19 08:49:55.567212 [DBG] STREAM: Subscribe subject: _STAN.sub.gJzQuNy1b5QJX66sUUoBEB
[1] 2020/11/19 08:49:55.567215 [DBG] STREAM: Subscription Close subject: _STAN.subclose.gJzQuNy1b5QJX66sUUoBEB
[1] 2020/11/19 08:49:55.567217 [DBG] STREAM: Unsubscribe subject: _STAN.unsub.gJzQuNy1b5QJX66sUUoBEB
[1] 2020/11/19 08:49:55.567220 [DBG] STREAM: Close subject: _STAN.close.gJzQuNy1b5QJX66sUUoBEB
[1] 2020/11/19 08:49:55.567553 [INF] STREAM: Message store is SQL
[1] 2020/11/19 08:49:55.567607 [INF] STREAM: ---------- Store Limits ----------
[1] 2020/11/19 08:49:55.567610 [INF] STREAM: Channels: 100 *
[1] 2020/11/19 08:49:55.567612 [INF] STREAM: --------- Channels Limits --------
[1] 2020/11/19 08:49:55.567614 [INF] STREAM: Subscriptions: 1000 *
[1] 2020/11/19 08:49:55.567615 [INF] STREAM: Messages : 1000000 *
[1] 2020/11/19 08:49:55.567617 [INF] STREAM: Bytes : 976.56 MB *
[1] 2020/11/19 08:49:55.567619 [INF] STREAM: Age : unlimited *
[1] 2020/11/19 08:49:55.567621 [INF] STREAM: Inactivity : unlimited *
[1] 2020/11/19 08:49:55.567623 [INF] STREAM: ----------------------------------
[1] 2020/11/19 08:49:55.567625 [INF] STREAM: Streaming Server is ready

after add -m :

[1] 2020/11/19 09:08:19.937464 [INF] Starting http monitor on 0.0.0.0:8222
[1] 2020/11/19 09:08:19.937596 [INF] Listening for client connections on 0.0.0.0:4222

Concurrent clients?

Exists in FAQ:

  • Is there a message size limitation in NATS?
  • Does NATS impose any limits on the # of subjects?

Missing from FAQ:

  • How many clients can connect simultaneously?

I tried to find a response to this question and couldn't find anywhere. Is there a maximum number of concurrent clients? What does it depend on? Is the clients list partitioned, e.g. does it grow when a NATS server is added?

You may want to add this to your FAQs.

2.2 Update Securing NATS

Security Documentation

This could be under: https://github.com/nats-io/nats.docs/tree/master/nats-server/configuration/securing_nats.

If this documentation should be in a different place please comment here.

In a PR, please provide documentation to address:

  • CIDR Block Checking
  • Time Restrictions
  • More JWT Usage Examples
  • Additional Metadata (e.g descriptions)
  • JetStream Account Options

For these sections, please make a note that these features apply to 2.2.

Under NATS Tools:

  • JWT V2 (nsc)
  • Default User Permissions (nsc)
  • Auto Generate System Account (nsc)

Miscellaneous Server Configuration

  • Subject Mapping and Bridging

Of course, add additional documentation as necessary.

/CC @gcolliso

Provide Guidance on Using NATS in a CI/CD flow

I keep sending this email and answering similar questions. We need to add something like this to doc:

NATS and CI/CD

Running NATS in your CI/CD environment is fairly straightforward. The NATS server is so lightweight it's really easy to spin up and test with, for example in .NET we can run about 500 tests in under 7 minutes in azure pipelines with almost every test launching a server instance.

Installing the NATS Server

To setup CI with the latest NATS server you have a few options - you can build or run our nightly docker image.

To build: https://github.com/nats-io/nats.java/blob/master/install_deps.sh
Docker: $ docker run -p 4222:4222 synadia/nats-server:nightly

For past releases you can unzip a tar file from github and use an official release, but you won't have edge features.

Or just use github actions if you are in a github environment:
https://github.com/nats-io/jetstream-gh-action

NATS Server test helpers and Usage

Test helpers vary client to client. Here are some examples.

Java

Here is the class you can copy to run the NATS server from java:
https://github.com/nats-io/nats.java/blob/master/src/test/java/io/nats/client/NatsTestServer.java

Example tests:
https://github.com/nats-io/nats.java/blob/master/src/test/java/io/nats/client/JetstreamTests.java

Node.js

https://github.com/nats-io/nats.js/blob/master/test/support/nats_server_control.js
and usage:
https://github.com/nats-io/nats.js/blob/master/test/basics.js#L32

Others

(add .NET, deno, C, python, etc).

Check out each NATS client repository's CI/CD workflow for hints as to run the NATS server CI/CD in your environment.

2.2 Miscellaneous Features

In PRs, please provide documentation to address:

For these sections, please make a note that these features apply to 2.2.

Locations are suggestions, if you feel this belongs elsewhere no worries.

docker-compose example

Hey guys,
I'm missing an example for docker-compose.
Especially on how to set a custom configuration file. I haven't found out yet, how to do that.

Provide guidance and examples for TLS/SSL Tunneling

We've had a few requests in this area. The doc should include a how-to setup for using stunnel, SSL/TLS tunnels, ssh tunnels, etc to bridge NATS over an established TLS connection.

See:

Sending Messages in C/C++

I am a beginner and wants to see the examples of sending messages in C/C++. But the docs only provides them in Go, Java, JavaScript,Python, Ruby,TypeScript.
Where can I find sample codes for sending messages to NATS server in C/C++ languages??
Thank you very much in advance!

2.2 Websocket Documentation

Section could be under: https://github.com/nats-io/nats.docs/tree/master/nats-server as "Websocket Support". If this documentation should be in a different place please comment here.

In a PR, please provide enough documentation to get started:

  • General Description and Applicable Use Cases
  • Getting Started Guide - Simple setup based on our recommendations.
  • Basic parameters/configuration options
  • Basic security
  • Leaf Nodes and WS

Of course, add additional documentation as necessary.

/CC @gcolliso

Unable to install mkpasswd like in documentation

Hi guys,

I'm trying to install mkpasswd from this documentation.

Issue No.1 - Wrong symbol in command
Copy button copies content > go get github.com/nats-io/nats-server/util/mkpasswd with starting >. It makes command invalid and getting error: -bash: go: Is a directory

Issue No.2 - Unable to install mkpasswd

Steps to reproduce:

  1. Install go: sudo snap install go --classic
  2. Install mkpasswd: go get github.com/nats-io/nats-server/util/mkpasswd

Actual: getting error

~$ go get github.com/nats-io/nats-server/util/mkpasswd
package github.com/nats-io/nats-server/util/mkpasswd: build constraints exclude all Go files in /home/ubuntu/go/src/github.com/nats-io/nats-server/util/mkpasswd

Expected: mkpasswd is installed.

OS:

Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal

Go:
go version go1.15.6 linux/amd64

Go env:

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ubuntu/.cache/go-build"
GOENV="/home/ubuntu/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ubuntu/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/ubuntu/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/snap/go/6745"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/snap/go/6745/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build471404296=/tmp/go-build -gno-record-gcc-switches"

2.2 Account Management

Section could be under: https://github.com/nats-io/nats.docs/tree/master/nats-server as "NATS Account Management", to cover the new NATS based account resolution. If this documentation should be in a different place please comment here.

In a PR, please provide enough documentation to get started:

  • General Description and Applicable Use Cases
  • Getting Started Guide - Simple setup based on our recommendations.
  • Basic parameters/configuration options

Of course, add additional documentation as necessary.

/CC @gcolliso

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.