From cb50e07dc8055479e1aff4a4bcfe614f4eb15d81 Mon Sep 17 00:00:00 2001 From: iganari Date: Wed, 30 Oct 2019 11:39:47 +0900 Subject: [PATCH 1/9] add GCP post in getting-started index --- docs/getting-started/index.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/getting-started/index.md b/docs/getting-started/index.md index 488b787e..ae7cd209 100644 --- a/docs/getting-started/index.md +++ b/docs/getting-started/index.md @@ -117,3 +117,15 @@ such as a Raspberry Pi or in the cloud and follow the guides below. + +
+ +
+ +

Google Cloud Platform

+
+
+ Running on an virtual machines on Google infrastructure +
+
+
From de23eff1c6ec4b8895f0fe31eb5dd5ec35316c28 Mon Sep 17 00:00:00 2001 From: iganari Date: Wed, 30 Oct 2019 11:40:14 +0900 Subject: [PATCH 2/9] copy document from Azure --- docs/getting-started/gcp.md | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 docs/getting-started/gcp.md diff --git a/docs/getting-started/gcp.md b/docs/getting-started/gcp.md new file mode 100644 index 00000000..1dde219b --- /dev/null +++ b/docs/getting-started/gcp.md @@ -0,0 +1,69 @@ +--- +layout: docs-getting-started +title: Running on Microsoft Azure +slug: azure +toc: toc-user-guide.html +redirect_from: + - /docs/platforms/azure +--- + +This guide takes you through the steps to get Node-RED running on an Azure +Virtual Machine instance. + +#### Create the base image + +1. Log in to the [Azure console](https://portal.azure.com/) + +2. Click to add a New ... Virtual Machine + +3. In the list of Virtual Machines, select **Ubuntu Server**, then click 'Create' + +4. Give your machine a name, the username you want to use and the authentication + details you want to use to access the instance + +5. Choose the Size of your instance. Remember that node.js is single-threaded so + there's no benefit to picking a size with multiple cores for a simple node-red + instance. `A1 Basic` is a good starting point + +6. On the 'Settings' step, click on the 'Network security group' option. Add a + new 'Inbound rule' with the options set as: + - Name: node-red-editor + - Priority: 1010 + - Protocol: TCP + - Destination port range: 1880 + +7. Click 'Ok' on the Settings page, check the Summary then click 'Ok' to deploy + the new instance + +After a couple of minutes your instance will be running. In the console +you can find your instance's IP address + +#### Setup Node-RED + +The next task is to log into the instance then install node.js and Node-RED. + +Log into your instance using the authentication details you specified in the +previous stage. + +Once logged in you need to install node.js and Node-RED + + curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - + sudo apt-get install -y nodejs build-essential + sudo npm install -g node-red + + +At this point you can test your instance by running `node-red`. *Note*: you may +get some errors regarding the Serial node - that's to be expected and can be +ignored. + +Once started, you can access the editor at `http://:1880/`. + +To get Node-RED to start automatically whenever your instance is restarted, you +can use pm2: + + sudo npm install -g pm2 + pm2 start `which node-red` -- -v + pm2 save + pm2 startup + +*Note:* this final command will prompt you to run a further command - make sure you do as it says. From 6ecb163fe5c80c8c7caa9a28c105efbb227c2ff4 Mon Sep 17 00:00:00 2001 From: iganari Date: Wed, 30 Oct 2019 19:13:49 +0900 Subject: [PATCH 3/9] update index --- docs/getting-started/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/index.md b/docs/getting-started/index.md index ae7cd209..9785075d 100644 --- a/docs/getting-started/index.md +++ b/docs/getting-started/index.md @@ -125,7 +125,7 @@ such as a Raspberry Pi or in the cloud and follow the guides below.

Google Cloud Platform

- Running on an virtual machines on Google infrastructure + Running on an Virtual Machine on Google infrastructure
From d9fe898959f0ba6e0c519b73d278913bc8c65a56 Mon Sep 17 00:00:00 2001 From: iganari Date: Wed, 30 Oct 2019 20:27:39 +0900 Subject: [PATCH 4/9] update docs --- docs/getting-started/gcp.md | 42 ++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/docs/getting-started/gcp.md b/docs/getting-started/gcp.md index 1dde219b..77bfbda4 100644 --- a/docs/getting-started/gcp.md +++ b/docs/getting-started/gcp.md @@ -1,39 +1,47 @@ --- layout: docs-getting-started -title: Running on Microsoft Azure +title: Running on Google Cloud Platform (GCP) slug: azure toc: toc-user-guide.html redirect_from: - - /docs/platforms/azure + - /docs/platforms/gcp --- -This guide takes you through the steps to get Node-RED running on an Azure +This guide takes you through the steps to get Node-RED running on an GCP Virtual Machine instance. #### Create the base image -1. Log in to the [Azure console](https://portal.azure.com/) +1. Log in to the [Google Cloud Platform Console](https://console.cloud.google.com/) -2. Click to add a New ... Virtual Machine +1. Select your project. -3. In the list of Virtual Machines, select **Ubuntu Server**, then click 'Create' +1. Click `Compute Engine` >> `VM instances` >> `Create` -4. Give your machine a name, the username you want to use and the authentication - details you want to use to access the instance +1. Give your machine a name, Region, Zone. [more info](https://cloud.google.com/compute/docs/regions-zones) -5. Choose the Size of your instance. Remember that node.js is single-threaded so +1. Choose the Size of your instance. Remember that node.js is single-threaded so there's no benefit to picking a size with multiple cores for a simple node-red - instance. `A1 Basic` is a good starting point + instance. `f1-micro(1 vCPU, 614 MB memory)` is a good starting point. -6. On the 'Settings' step, click on the 'Network security group' option. Add a - new 'Inbound rule' with the options set as: +1. In the list of Boot disk, select **Ubuntu**, then click 'Select'. + +1. Click 'Create' on the Settings page, check the Summary then click 'Ok' to deploy + the new instance. + +1. Click `VPC network` >> `VPC networks` >> `Firewall rules` >> `CREATE FIREWALL RULE` + new 'Create a firewall rule' with the options set as: - Name: node-red-editor + - Network: default - Priority: 1010 - - Protocol: TCP - - Destination port range: 1880 - -7. Click 'Ok' on the Settings page, check the Summary then click 'Ok' to deploy - the new instance + - Direction of traffic: Ingress + - Action on match: Allow + - Targets: ALL Instances in the network + - Source filter: IP ranges + - Source IP ranges: 0.0.0.0/0 + - Protocols and ports: Specified protocols and ports + - tcp: 1880 + Click `Create` on the Settings page. After a couple of minutes your instance will be running. In the console you can find your instance's IP address From 793177d6bf1566ba3a1ffbdd06286d750b40a794 Mon Sep 17 00:00:00 2001 From: iganari Date: Thu, 31 Oct 2019 10:00:52 +0900 Subject: [PATCH 5/9] update gcp --- docs/getting-started/gcp.md | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/docs/getting-started/gcp.md b/docs/getting-started/gcp.md index 77bfbda4..43b03dce 100644 --- a/docs/getting-started/gcp.md +++ b/docs/getting-started/gcp.md @@ -16,21 +16,9 @@ Virtual Machine instance. 1. Select your project. -1. Click `Compute Engine` >> `VM instances` >> `Create` - -1. Give your machine a name, Region, Zone. [more info](https://cloud.google.com/compute/docs/regions-zones) - -1. Choose the Size of your instance. Remember that node.js is single-threaded so - there's no benefit to picking a size with multiple cores for a simple node-red - instance. `f1-micro(1 vCPU, 614 MB memory)` is a good starting point. - -1. In the list of Boot disk, select **Ubuntu**, then click 'Select'. - -1. Click 'Create' on the Settings page, check the Summary then click 'Ok' to deploy - the new instance. - 1. Click `VPC network` >> `VPC networks` >> `Firewall rules` >> `CREATE FIREWALL RULE` - new 'Create a firewall rule' with the options set as: + + new `Create a firewall rule` with the options set as: - Name: node-red-editor - Network: default - Priority: 1010 @@ -41,10 +29,29 @@ Virtual Machine instance. - Source IP ranges: 0.0.0.0/0 - Protocols and ports: Specified protocols and ports - tcp: 1880 + Click `Create` on the Settings page. +1. Click `Compute Engine` >> `VM instances` >> `Create` + + Give your machine info + - Name: node-red-instance + - Region: us-central1 + - Zone: us-central1-a + - Machine configuration + - Machine family + - General-purpose + - Series + - N1 + - Machine type + - f1-micro + - Boot disk + - Ubuntu 18.04 LTS + + Click `Create` on the Settings page, then the instance will start to be created. + After a couple of minutes your instance will be running. In the console -you can find your instance's IP address +you can find your instance's IP address as `External IP`. #### Setup Node-RED From 41d05b0fbbc41f67947a181d52e653e9c24fead5 Mon Sep 17 00:00:00 2001 From: iganari Date: Thu, 31 Oct 2019 10:10:15 +0900 Subject: [PATCH 6/9] update tag --- docs/getting-started/gcp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/gcp.md b/docs/getting-started/gcp.md index 43b03dce..21037159 100644 --- a/docs/getting-started/gcp.md +++ b/docs/getting-started/gcp.md @@ -1,7 +1,7 @@ --- layout: docs-getting-started title: Running on Google Cloud Platform (GCP) -slug: azure +slug: gcp toc: toc-user-guide.html redirect_from: - /docs/platforms/gcp From b69e44859737ff4cbc6622aa7ec228b7b1efe520 Mon Sep 17 00:00:00 2001 From: iganari / Toru Igarashi Date: Sat, 23 Nov 2019 21:54:51 +0900 Subject: [PATCH 7/9] Update gcp.md --- docs/getting-started/gcp.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/getting-started/gcp.md b/docs/getting-started/gcp.md index 21037159..eecc7555 100644 --- a/docs/getting-started/gcp.md +++ b/docs/getting-started/gcp.md @@ -62,6 +62,20 @@ previous stage. Once logged in you need to install node.js and Node-RED + sudo add-apt-repository -y -r ppa:chris-lea/node.js + sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list + sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list.save + + + curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add - + + DISTRO="$(lsb_release -s -c)" + echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list + echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list + + sudo apt-get update + sudo apt-get install nodejs + curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejs build-essential sudo npm install -g node-red From 88cfa5532629255a87c69ce95a52e238f5ca251a Mon Sep 17 00:00:00 2001 From: iganari / Toru Igarashi Date: Sat, 23 Nov 2019 21:57:22 +0900 Subject: [PATCH 8/9] Update gcp.md --- docs/getting-started/gcp.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/getting-started/gcp.md b/docs/getting-started/gcp.md index eecc7555..29e6f8b2 100644 --- a/docs/getting-started/gcp.md +++ b/docs/getting-started/gcp.md @@ -66,7 +66,6 @@ Once logged in you need to install node.js and Node-RED sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list.save - curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add - DISTRO="$(lsb_release -s -c)" From 424b246df35523b1b96fe79563d7b40526ef76a2 Mon Sep 17 00:00:00 2001 From: iganari / Toru Igarashi Date: Sun, 24 Nov 2019 07:45:28 +0900 Subject: [PATCH 9/9] Update gcp.md --- docs/getting-started/gcp.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/getting-started/gcp.md b/docs/getting-started/gcp.md index 29e6f8b2..8ab1b2e2 100644 --- a/docs/getting-started/gcp.md +++ b/docs/getting-started/gcp.md @@ -60,23 +60,35 @@ The next task is to log into the instance then install node.js and Node-RED. Log into your instance using the authentication details you specified in the previous stage. -Once logged in you need to install node.js and Node-RED +Once logged in you need to install node.js and Node-RED using manual install. + +[NodeSource Node.js Binary Distributions](https://github.com/nodesource/distributions#manual-installation) + +Remove the old PPA if it exists sudo add-apt-repository -y -r ppa:chris-lea/node.js sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list.save +Add the NodeSource package signing key + curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add - +Add the desired NodeSource repository + + VERSION=node_10.x DISTRO="$(lsb_release -s -c)" echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list +Update package lists and install Node.js + sudo apt-get update sudo apt-get install nodejs - curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - - sudo apt-get install -y nodejs build-essential +Install Node-RED + + sudo apt-get install build-essential sudo npm install -g node-red