-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add New Getting Started on Google Cloud Page #139
Open
iganari
wants to merge
9
commits into
node-red:master
Choose a base branch
from
iganari:feature/add-getting-started-gcp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cb50e07
add GCP post in getting-started index
iganari de23eff
copy document from Azure
iganari 6ecb163
update index
iganari d9fe898
update docs
iganari 793177d
update gcp
iganari 41d05b0
update tag
iganari b69e448
Update gcp.md
iganari 88cfa55
Update gcp.md
iganari 424b246
Update gcp.md
iganari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
--- | ||
layout: docs-getting-started | ||
title: Running on Google Cloud Platform (GCP) | ||
slug: gcp | ||
toc: toc-user-guide.html | ||
redirect_from: | ||
- /docs/platforms/gcp | ||
--- | ||
|
||
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 [Google Cloud Platform Console](https://console.cloud.google.com/) | ||
|
||
1. Select your project. | ||
|
||
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 | ||
- 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. | ||
|
||
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 as `External IP`. | ||
|
||
#### 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 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 | ||
|
||
Install Node-RED | ||
|
||
sudo apt-get install 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://<your-instance-ip>: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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you not use the systemd scripts we already have documented ? - or indeed the Linux install scripts which work on Debian/Ubuntu also ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dceejay
Thank you for checking.
Check it myself!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dceejay
I'm Sorry for the late comment and late check.
I wrote a document referring to Azure document
Please tell me the documentation of systemd scripts.
thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some info here - https://nodered.org//docs/faq/customising-systemd-on-pi
The file that gets installed is from here - https://github.com/node-red/linux-installers/blob/master/resources/nodered.service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dceejay
Thank you a lots !
I will check now!