Run Synchrony-standalone as a service on Linux

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

This guide applies to Confluence Data Center 6.5 and later. See Run Synchrony-standalone as a service on Linux for Confluence 6.4 and earlier if you're using an earlier version of Data Center. This guide does not apply if Synchrony is managed by Confluence.

目的

This article will guide you through how to run Synchrony as a service on a standalone node or cluster in Linux, for use with Confluence Data Center 6.5 or later. 

Prerequisites

You should already have one Confluence Data Center node set up (see Installing Confluence Data Center), and are working through the steps to Set up a Synchrony cluster

We also assume you already have the latest Java Development Kit (JDK) version installed.

How to check

You must be using one of the supported JDK versions, as seen on the Supported Platforms page.  To check your current Java version:

which java
java -version

If it's not already installed, you can successfully install it by following the steps outlined in the Installing Java for Confluence guide.

Once installed, run the java -version command again to confirm your version.

ソリューション

How to run Synchrony as a service on a standalone node

In Linux, the best practice is to install, configure and run each service (including Synchrony) as a dedicated user with only the permissions they require.

To run Synchrony automatically on Linux, follow the steps below.  These steps are for Ubuntu 16, so you may need to adjust the syntax of these commands if you're using RHEL or another Linux distribution.  

  1. Create a synchrony user to run Synchrony, using the following command running as root (not using sudo):

    addgroup --gid 1234 synchrony && useradd -m -s /bin/bash -u 1234 -g 1234 synchrony;
  2. Set a password for your synchrony user:

    sudo passwd synchrony
  3. Create your Synchrony home directory. This is where we'll run Synchrony from, and write logs to.  

    sudo mkdir -p /opt/atlassian/synchrony
    
  4. Copy the following files and directories from your Confluence node to your Synchrony home directory:

    • <local-home>/synchrony-standalone.jar
    • <install-directory>/bin/synchrony
    • your database driver from <install-directory>/confluence/WEB-INF/lib (for example postgresql-9.4.1212.jar)
    • for convienience you may also want to copy over your <local-home>/confluence.cfg.xml file, as this contains some of the details you'll need to enter later. 
       
  5. Your Synchrony home directory should now contain the following files:

    • synchrony-standalone.jar
    • start-synchrony.sh
    • stop-synchrony.sh
    • install_synchrony_service.sh
    • your database driver, for example postgresql-9.4.1212.jar
       
  6. Give your synchrony user proper permissions on the directory and files: 

    sudo chown -R synchrony:synchrony /opt/atlassian/synchrony
    
  7. Open start-synchrony.sh in your favourite text editor and enter details for your environment. See Configuring Synchrony for details of each parameter. 
     

  8. We recommend you use an environment variable for your database password. To do this, change to the synchrony user, create a file, for example synchronyenv and make it executable as follows:

    sudo su - synchrony
    touch synchronyenv
    chmod a+x synchronyenv
  9. Edit the file to add the environment variables for your database username and password as follows:

    export SYNCHRONY_DATABASE_USERNAME="your username"
    export SYNCHRONY_DATABASE_PASSWORD="your password"
  10. In your start-synchrony.sh script, uncomment the environment variables section, and provide the path to your environment file. 

    SYNCHRONY_ENV_FILE="<PATH_TO_ENV_FILE>"
  11. As your Synchrony user, run the install_synchrony_service.sh file to install the service: 

    sudo ./install_synchrony_service.sh
  12. To start, stop or restart the service, use:

    service synchrony start
    service synchrony stop
    service synchrony restart
  13. To confirm the synchrony service is running use: 

    service synchrony status
  14. You're now ready to start Confluence and check it can connect to Synchrony. Continue with the installation instructions in Installing Confluence Data Center

Synchrony logs not updated when running as a service

If you setup Synchrony standalone to run as a Linux service and the application log (atlassian-synchrony.log) is either missing or not being updated, then check the following procedure.

  1. Edit the Synchrony service definition and add the following configuration under the [Service] structure.

    WorkingDirectory=<path to Synchrony home>
  2. Reload the Synchrony service configuration.
  3. Restart the Synchrony service.

Running Synchrony using start and stop scripts

If you're using Confluence 6.5 or later, we provide scripts to help you start and stop Synchrony. See Configuring Synchrony to find out how to configure these scripts for your environment. 

If you're using an earlier Confluence version, you can create your own start and stop scripts - see Run Synchrony-standalone as a service on Linux for Confluence 6.4 and earlier


説明 This article will guide you through how to run Synchrony as a service on a standalone node or cluster in Linux, for use with Confluence Data Center 6.5 or later. 
製品Confluence
プラットフォームData Center
最終更新日 2024 年 5 月 6 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.