Before enabling the authentication, first you need to create a password file. The file name isn't important. Use the following example for guidance.
Note
If you're using an earlier JDK version than 9, then you'll need to specify the role in a separate jmx.access file.
-
Create the file
jmx.password.jmx.passwordis the password file which defines the roles and their passwords.To be functional, a role must have an entry in the password file.
-
In the
jmx.passwordfile, add the role and the desired password.For example:
alfrescoSync password -
Change the
jmx.passwordpermission to read-only for the owner:For example:
sudo chown dsync: jmx.password && sudo chmod 600 jmx.password -
Start the Sync Service by enabling authentication, and pass on the path to the created file:
-Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=/path/to/jmx.passwordFor example:
cd <installLocation>/service-syncjava -Xmx2G -Dcom.sun.management.jmxremote=true -Djava.rmi.server.hostname=34.253.209.238 -Dcom.sun.management.jmxremote.port=50800 -Dcom.sun.management.jmxremote.rmi.port=50801 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=/path/to/jmx.password -Dcom.sun.management.jmxremote.ssl=false -Djava.io.tmpdir=/var/tmp/dsync -cp postgresql.jar:service-sync-3.0.x.jar org.alfresco.service.sync.dropwizard.SyncService server config.ymlNote
Replace
service-sync-3.0.x.jarwith your exact version. -
Start JConsole and select Remote Process.
-
Enter the Sync Service IP,
com.sun.management.jmxremote.portvalue, user name, and password, as shown in the example below. -
Click Connect.