• 沒有找到結果。

Download the AWS IoT Greengrass Core software

在文檔中 AWS IoT Greengrass (頁 90-94)

You can download the latest version of the AWS IoT Greengrass Core software from the following location:

• https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip

NoteYou can download a specific version of the AWS IoT Greengrass Core software from the following location. Replace version with the version to download.

https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-version.zip

To download the AWS IoT Greengrass Core software

1. On your core device, download the AWS IoT Greengrass Core software to a file named greengrass-nucleus-latest.zip.

Linux or Unix

curl -s https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip > greengrass-nucleus-https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip

Windows Command Prompt (CMD)

curl -s https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip > greengrass-nucleus-https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip

PowerShell

iwr -Uri https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip -OutFile greengrass-nucleus-https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip

Install with automatic provisioning

By downloading this software, you agree to the Greengrass Core Software License Agreement.

2. Unzip the AWS IoT Greengrass Core software to a folder on your device. Replace GreengrassInstaller with the folder that you want to use.

Linux or Unix

unzip nucleus-latest.zip -d GreengrassInstaller && rm greengrass-nucleus-latest.zip

Windows Command Prompt (CMD)

mkdir GreengrassInstaller && tar xf greengrassnucleuslatest.zip -C GreengrassInstaller && del greengrass-nucleus-latest.zip

PowerShell

Expand-Archive -Path greengrass-nucleus-latest.zip -DestinationPath .

\GreengrassInstaller

rm greengrass-nucleus-latest.zip

3. (Optional) Run the following command to see the version of the AWS IoT Greengrass Core software.

java -jar ./GreengrassInstaller/lib/Greengrass.jar --version

Important

If you install a version of the Greengrass nucleus earlier than v2.4.0, don't remove this folder after you install the AWS IoT Greengrass Core software. The AWS IoT Greengrass Core software uses the files in this folder to run.

If you downloaded the latest version of the software, you install v2.4.0 or later, and you can remove this folder after you install the AWS IoT Greengrass Core software.

Install the AWS IoT Greengrass Core software

Run the installer with arguments that specify to do the following:

• Create the AWS resources that the core device requires to operate.

• Specify to use the ggc_user system user to run software components on the core device. On Linux devices, this command also specifies to use the ggc_group system group, and the installer creates the system user and group for you.

• Set up the AWS IoT Greengrass Core software as a system service that runs as boot. On Linux devices, this requires the Systemd init system.

To set up a development device with local development tools, specify the --deploy-dev-tools true argument. The local development tools can take up to a minute to deploy after the installation completes.

For more information about the arguments that you can specify, see Installer arguments (p. 136).

NoteIf you are running AWS IoT Greengrass on a device with limited memory, you can control the amount of memory that AWS IoT Greengrass Core software uses. To control memory allocation, you can set JVM heap size options in the jvmOptions configuration parameter in your nucleus component. For more information, see Control memory allocation with JVM options (p. 168).

Install with automatic provisioning

To install the AWS IoT Greengrass Core software

1. Run the AWS IoT Greengrass Core installer. Replace argument values in your command as follows.

a. /greengrass/v2 or C:\greengrass\v2: The path to the root folder to use to install the AWS IoT Greengrass Core software.

b. GreengrassInstaller. The path to the folder where you unpacked the AWS IoT Greengrass Core software installer.

c. region. The AWS Region in which to find or create resources.

d. MyGreengrassCore. The name of the AWS IoT thing for your Greengrass core device. If the thing doesn't exist, the installer creates it. The installer downloads the certificates to authenticate as the AWS IoT thing. For more information, see Device authentication and authorization for AWS IoT Greengrass (p. 823).

NoteThe thing name can't contain colon (:) characters.

e. MyGreengrassCoreGroup. The name of AWS IoT thing group for your Greengrass core device.

If the thing group doesn't exist, the installer creates it and adds the thing to it. If the thing group exists and has an active deployment, the core device downloads and runs the software that the deployment specifies.

NoteThe thing group name can't contain colon (:) characters.

f. GreengrassV2IoTThingPolicy. The name of the AWS IoT policy that allows the Greengrass core devices to communicate with AWS IoT and AWS IoT Greengrass. If the AWS IoT policy doesn't exist, the installer creates a permissive AWS IoT policy with this name. You can restrict this policy's permissions for you use case. For more information, see Minimal AWS IoT policy for AWS IoT Greengrass V2 core devices (p. 830).

g. GreengrassV2TokenExchangeRole. The name of the IAM role that allows the Greengrass core device to get temporary AWS credentials. If the role doesn't exist, the installer creates it and creates and attaches a policy named GreengrassV2TokenExchangeRoleAccess. For more information, see Authorize core devices to interact with AWS services (p. 843).

h. GreengrassCoreTokenExchangeRoleAlias. The alias to the IAM role that allows the Greengrass core device to get temporary credentials later. If the role alias doesn't exist, the installer creates it and points it to the IAM role that you specify. For more information, see Authorize core devices to interact with AWS services (p. 843).

Linux or Unix

sudo -E java -Droot="/greengrass/v2" -Dlog.store=FILE \ -jar ./GreengrassInstaller/lib/Greengrass.jar \ --aws-region region \

--thing-name MyGreengrassCore \

--thing-group-name MyGreengrassCoreGroup \ --thing-policy-name GreengrassV2IoTThingPolicy \ --tes-role-name GreengrassV2TokenExchangeRole \

--tes-role-alias-name GreengrassCoreTokenExchangeRoleAlias \ --component-default-user ggc_user:ggc_group \

--provision true \

--setup-system-service true

Windows Command Prompt (CMD)

java -Droot="C:\greengrass\v2" "-Dlog.store=FILE" ^ -jar ./GreengrassInstaller/lib/Greengrass.jar ^ --aws-region region ^

Install with automatic provisioning

--thing-group-name MyGreengrassCoreGroup ^ --thing-policy-name GreengrassV2IoTThingPolicy ^ --tes-role-name GreengrassV2TokenExchangeRole ^

--tes-role-alias-name GreengrassCoreTokenExchangeRoleAlias ^ --component-default-user ggc_user ^

--provision true ^

--setup-system-service true

PowerShell

java -Droot="C:\greengrass\v2" "-Dlog.store=FILE" ` -jar ./GreengrassInstaller/lib/Greengrass.jar ` --aws-region region `

--thing-name MyGreengrassCore `

--thing-group-name MyGreengrassCoreGroup ` --thing-policy-name GreengrassV2IoTThingPolicy ` --tes-role-name GreengrassV2TokenExchangeRole `

--tes-role-alias-name GreengrassCoreTokenExchangeRoleAlias ` --component-default-user ggc_user `

--provision true `

--setup-system-service true

The installer prints the following messages if it succeeds:

• If you specify --provision, the installer prints Successfully configured Nucleus with provisioned resource details if it configured the resources successfully.

• If you specify --deploy-dev-tools, the installer prints Configured Nucleus to deploy aws.greengrass.Cli component if it created the deployment successfully.

• If you specify --setup-system-service true, the installer prints Successfully set up Nucleus as a system service if it set up and ran the software as a service.

• If you don't specify --setup-system-service true, the installer prints Launched Nucleus successfully if it succeeded and ran the software.

2. Skip this step if you installed Greengrass nucleus (p. 189) v2.0.4 or later. If you downloaded the latest version of the software, you installed v2.0.4 or later.

Run the following command to set the required file permissions for your AWS IoT Greengrass Core software root folder. Replace /greengrass/v2 with the root folder that you specified in your installation command, and replace /greengrass with the parent folder for your root folder.

sudo chmod 755 /greengrass/v2 && sudo chmod 755 /greengrass

If you installed the AWS IoT Greengrass Core software as a system service, the installer runs the software for you. Otherwise, you must run the software manually. For more information, see Run the AWS IoT Greengrass Core software (p. 138).

Note

By default, the IAM role that the installer creates doesn't allow access to component artifacts in S3 buckets. To deploy custom components that define artifacts in Amazon S3, you must add permissions to the role to allow your core device to retrieve component artifacts. For more information, see Allow access to S3 buckets for component artifacts (p. 845).

If you don't yet have an S3 bucket for component artifacts, you can add these permissions later after you create a bucket.

For more information about how to configure and use the software and AWS IoT Greengrass, see the following:

Install with manual provisioning

• Configure the AWS IoT Greengrass Core software (p. 165)

• Develop AWS IoT Greengrass components (p. 467)

• Deploy AWS IoT Greengrass components to devices (p. 519)

• Greengrass Command Line Interface (p. 455)

Install AWS IoT Greengrass Core software with manual resource provisioning

The AWS IoT Greengrass Core software includes an installer that sets up your device as a Greengrass core device. To set up a device manually, you can create the required AWS IoT and IAM resources for the device to use. If you create these resources manually, you don't need to provide AWS credentials to the installer.

When you manually install the AWS IoT Greengrass Core software, you can also configure the device to use a network proxy or connect to AWS on port 443. You might need to specify these configuration options if your device runs behind a firewall or a network proxy, for example. For more information, see Connect on port 443 or through a network proxy (p. 173).

You can also configure the AWS IoT Greengrass Core software to use a hardware security module (HSM) through the PKCS#11 interface. This feature enables you to securely store private key and certificate files so that they aren't exposed or duplicated in software. You can store private keys and certificates on a hardware module such as an HSM, a Trusted Platform Module (TPM), or another cryptographic element. This feature is available on Linux devices only. For more information about hardware security and requirements to use it, see Hardware security integration (p. 815).

Important

Before you download the AWS IoT Greengrass Core software, check that your core device meets the requirements (p. 65) to install and run the AWS IoT Greengrass Core software v2.0.

Topics

在文檔中 AWS IoT Greengrass (頁 90-94)