Installing the Content Service as a standalone microservice

Run the appropriate microservice installation PowerShell or Unix script to install and run the standalone microservice.

Before you begin

To run Powershell scripts, you require a machine that meets the following requirements (any Tridion Sites 9.6 server machine running Windows meets these requirements):
PrerequisiteDescription
Operating systemYou can run the scripts on any machine running an operating system that supports any version of Powershell of 5.0 and higher.
Powershell softwareRunning the scripts requires a version of Powershell between 5.0 and higher.
Microsoft .NET FrameworkRunning the scripts requires Microsoft .NET Framework 4.8 or higher.
SecurityYou need to be logged in as a user with sufficient security clearance. For example, to run a script that installs software to a target folder, you must be logged in as a user with write access to that folder.

About this task

When you run the microservice installation script, you can specify the following types of parameters:
Environmental parameters
You can set and pass environmental parameters to the microservice scripts in the following ways:
  • You can create and set them as environment variables on the operating system of the machine on which the microservice runs.
  • You can hardcode them in the application.properties file located in the configuration location of the microservice.
  • You can pass them using the -D switch when you run the script from the command line. For example, to specify that the parameter foo has the value bar, you would type '-Dfoo=bar' after your script command.
Script parameters

You may want to add script parameters to your installation script. To do so, append them to the installation script command, in the form --PARAMETER (if it is a Boolean parameter) or --PARAMETER=VALUE (if it is a parameter-value pair) , where PARAMETER is the name of the parameter, and VALUE (when using) is the value you want to set it to.

You can install the microservice in one of the following ways:
Installation typeName of installation scriptWhen to use
Microsoft Windows serviceinstallService.ps1Choose for long-term use on Windows, say on a production system. The microservice continues to run when you close the PowerShell prompt. It can be stopped and restarted from the Windows Control Panel. It outputs its log as a file.
Microsoft Windows processstart.ps1Choose for short-term use on Windows, say on a test system. The microservice stops running when you close the PowerShell prompt. It outputs its log in the command prompt window.
Unix processstart.shChoose if you are installing on a Unix-based operating system.

Procedure

  1. Navigate to the folder to which you copied the Content Service or Session-enabled Content Service standalone microservice files.
  2. If your Discovery Service is running on another server, on another port, or if you have changed the password of the user who registers Capabilities in the Discovery Service, go to the config\ subfolder, open cd_storage_conf.xml for viewing, and specify environment parameters for the variables being mentioned in the ConfigRepository element: discoveryurl for your custom server and/or port, and registrationpassword for your custom password.
  3. If you are running this microservice script on a machine on which the Discovery Service is also running (that is, if you are not in a scaled-out setup), pass a DependsOn script parameter, set to the value TridionDiscoveryService.
  4. On a Unix-based system, to run the microservice as a standalone process, type /bin/sh start.sh, with an environmental parameter emscustomerid set to the customer ID provided to you by RWS, but do not yet press Enter.
  5. Alternatively, on a Windows system, open a PowerShell prompt and do one of the following:
    • To install as a Windows service, type & '.\installService.ps1', with an environmental parameter emscustomerid set to the customer ID provided to you by RWS, but do not yet press Enter.
    • To start as a standalone Windows process, type & '.\start.ps1', with an environmental parameter emscustomerid set to the customer ID provided to you by RWS, but do not yet press Enter.
  6. If you do not want the service to register itself as a Capability with the Discovery Service automatically, add an auto-register parameter set to the value false.
  7. Set environmental properties for search. For each of the properties listed below, do one of the following:
    • If the property has a default value, decide if you want to change that default value, and to what.
    • If the property does not have a default value, decide what its value should be.
    Property name on command line and in search.propertiesEnvironment variable nameValue descriptionDefault if not specified
    es.hosteshostThe name of the host on which your Elasticsearch instance runs localhost
    es.portesportThe number of the port on which your Elasticsearch instance runs 9200
    es.usernameesusernameIf the Elasticsearch instance is secured, the name of a user who can access the Elasticsearch instance none (Elasticsearch instance is not secured)
    es.passwordespasswordIf the Elasticsearch instance is secured, the password of the user above, encrypted with the RWS encryption toolnone (Elasticsearch instance is not secured)
    es.schemeesschemeIf you connect to the Elasticsearch instance through HTTPS, https none (connect through HTTP)
    es.ingest.usernameesingestusernameIf you connect to the Elasticsearch instance through Basic Authentication (typically to connect to an external Elasticsearch like Elastic Cloud), the name of a user who can access the Elasticsearch ingest node none (no Basic Authentication set up for the Elasticsearch instance)
    es.ingest.passwordesingestpasswordIf you connect to the Elasticsearch instance through Basic Authentication, the password of the user above, encrypted with the RWS encryption toolnone (no Basic Authentication set up for the Elasticsearch instance)
    index.common.name.prefixindexprefixAn index prefix (if needed) to distinguish this Elasticsearch instance from others. For example, if you have a staging and a live environment, you might set this prefix to staging for all your Elasticsearch indexes for the staging environment, and to live for all your Elasticsearch indexes for the live environment. The prefix is prepended to the normal index name, udp-index, to create PREFIXudp-index, where PREFIX is the value of this property.an empty string (the index has no prefix)
  8. If you are installing a setup that includes the Add-on service, make sure that the Add-on service is up and running, then do the following:
    • Set an environmental parameter called addonserviceurl to the URL of the Add-on service.
    • If your Add-on service is secured, set a number of additional environmental parameters to connect to the identity provider.
    • If the JSON configuration references a Content Delivery environment by name (such as staging), also set an environmental parameter cdenvironment to the name of your Content Delivery environment.
  9. To specify a different default HTTP port than the default, add a server.port parameter and set it to the port number of your choice.
  10. To specify a default context path, add a server.contextPath parameter and set it to the context path of your choice (the value must start with a /).
  11. Press Enter.