Run Synchrony-standalone as a service on Linux

お困りですか?

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

コミュニティに質問

本ナレッジベースはアトラシアンの サーバー プラットフォーム向けに記載されたものです。Atlassian Cloud との機能の違いにより、本記事の内容を Atlassian Cloud アプリケーションに適用することはできません。

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. 

要件

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 Oracle Java version installed. 

How to check

You must be using Oracle Java (not OpenJDK).  To check your current java version:

which java
java -version

If it's not already installed, either download it from Oracle and copy to the machine, or use the package manager like so: 

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

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

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
最終更新日: 2018 年 9 月 25 日

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

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