You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@hop.apache.org by "ravamo (via GitHub)" <gi...@apache.org> on 2024/11/07 20:14:02 UTC

[D] Apache systemd (hop)

GitHub user ravamo created a discussion: Apache systemd

Hi Community ,
I have two questions and I wonder if anyone can help.

- I have Apache Hop running as a systemd service, but I want to avoid having to use ExecStop=/bin/kill -TERM $MAINPID when stopping it. I’ve seen something like this on the website: ExecStop=/usr/bin/curl -X GET http://localhost:8080/hop-server/stop?password=$HOP_SERVER_ADMIN_PASSWORD. What’s the best way to stop the server properly?
 version 1
 
 ``` shell
 [Unit]
Description=Apache Hop Server
After=network.target

[Service]
Type=simple
User=hopuser
Group=hopuser
WorkingDirectory=/ruta/a/apache-hop
ExecStart=/ruta/a/apache-hop/hop-server.sh
ExecStop=/bin/kill -TERM $MAINPID
Restart=on-failure
RestartSec=5

# Limita el tamaño máximo del log
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=hop

[Install]
WantedBy=multi-user.target
```
 
 version 2
 
 ```shell
[Unit]
Description=Apache Hop Server
After=network.target

[Service]
Type=simple
User=hopuser
Group=hopuser
WorkingDirectory=/ruta/a/apache-hop
Environment="HOP_SERVER_ADMIN_PASSWORD=tu_password"
ExecStart=/ruta/a/apache-hop/hop-server.sh
ExecStop=/usr/bin/curl -X GET http://localhost:8080/hop-server/stop?password=$HOP_SERVER_ADMIN_PASSWORD
Restart=on-failure
RestartSec=5

# Limita el tamaño máximo del log
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=hop

[Install]
WantedBy=multi-user.target
```


- Also, has anyone created an Ansible playbook for the installation? If not, I can create one, but I just want to avoid duplicating efforts.
best

GitHub link: https://github.com/apache/hop/discussions/4540

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Apache Hop Server systemd (hop)

Posted by "kranskydog (via GitHub)" <gi...@apache.org>.
GitHub user kranskydog added a comment to the discussion: Apache Hop Server  systemd

from https://hop.apache.org/manual/latest/hop-server/index.html
-k, --kill              Stop the running hopServer server.  This is only
                            allowed when using the hostname/port form of the
                            command. Use the -s and -u options to authenticate
                            
example: hop-server.bat 127.0.0.1 8080 --kill --userName cluster --password cluster

GitHub link: https://github.com/apache/hop/discussions/4540#discussioncomment-11182550

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Apache Hop Server systemd (hop)

Posted by "hansva (via GitHub)" <gi...@apache.org>.
GitHub user hansva added a comment to the discussion: Apache Hop Server  systemd

That one has been removed as it was not working as expected

GitHub link: https://github.com/apache/hop/discussions/4540#discussioncomment-11185863

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Apache Hop Server systemd (hop)

Posted by "bamaer (via GitHub)" <gi...@apache.org>.
GitHub user bamaer added a comment to the discussion: Apache Hop Server  systemd

there isn't anything out of the box that would let send server and execution logs to the same log file, but I guess you could make it work with a combination of server configuration and [pipeline log](https://hop.apache.org//manual/latest/metadata-types/pipeline-log.html) and [workflow log](https://hop.apache.org//manual/latest/metadata-types/workflow-log.html). 

GitHub link: https://github.com/apache/hop/discussions/4540#discussioncomment-11222432

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Apache Hop Server systemd (hop)

Posted by "ravamo (via GitHub)" <gi...@apache.org>.
GitHub user ravamo edited a discussion: Apache Hop Server  systemd

Hi Community ,
I have two questions and I wonder if anyone can help.

- I have Apache Hop running as a systemd service, but I want to avoid having to use ExecStop=/bin/kill -TERM $MAINPID when stopping it. I’ve seen something like this on the website: ExecStop=/usr/bin/curl -X GET http://localhost:8080/hop-server/stop?password=$HOP_SERVER_ADMIN_PASSWORD. What’s the best way to stop the server properly?
 version 1
 
 ``` shell
 [Unit]
Description=Apache Hop Server
After=network.target

[Service]
Type=simple
User=hopuser
Group=hopuser
WorkingDirectory=/ruta/a/apache-hop
ExecStart=/ruta/a/apache-hop/hop-server.sh
ExecStop=/bin/kill -TERM $MAINPID
Restart=on-failure
RestartSec=5

# Limita el tamaño máximo del log
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=hop

[Install]
WantedBy=multi-user.target
```
 
 version 2
 
 ```shell
[Unit]
Description=Apache Hop Server
After=network.target

[Service]
Type=simple
User=hopuser
Group=hopuser
WorkingDirectory=/ruta/a/apache-hop
Environment="HOP_SERVER_ADMIN_PASSWORD=tu_password"
ExecStart=/ruta/a/apache-hop/hop-server.sh
ExecStop=/usr/bin/curl -X GET http://localhost:8080/hop-server/stop?password=$HOP_SERVER_ADMIN_PASSWORD
Restart=on-failure
RestartSec=5

# Limita el tamaño máximo del log
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=hop

[Install]
WantedBy=multi-user.target
```


- Also, has anyone created an Ansible playbook for the installation? If not, I can create one, but I just want to avoid duplicating efforts.
best

GitHub link: https://github.com/apache/hop/discussions/4540

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Apache Hop Server systemd (hop)

Posted by "bamaer (via GitHub)" <gi...@apache.org>.
GitHub user bamaer added a comment to the discussion: Apache Hop Server  systemd

by "website" you mean the Hop Server web UI? that information is not persisted anywhere at the moment, it won't survive a server restart. 

GitHub link: https://github.com/apache/hop/discussions/4540#discussioncomment-11222693

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Apache Hop Server systemd (hop)

Posted by "ravamo (via GitHub)" <gi...@apache.org>.
GitHub user ravamo added a comment to the discussion: Apache Hop Server  systemd

@hansva , In that case, what’s the best option? Running the KILL command is pretty abrupt—isn't there a way to shut it down more gracefully?

GitHub link: https://github.com/apache/hop/discussions/4540#discussioncomment-11186021

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Apache Hop Server systemd (hop)

Posted by "ravamo (via GitHub)" <gi...@apache.org>.
GitHub user ravamo added a comment to the discussion: Apache Hop Server  systemd

roger roger ,
in that case the the right systemd is :
```shell
[Unit]
Description=Apache Hop Server
After=network.target

[Service]
Type=simple
User=hopuser
Group=hopuser
WorkingDirectory=/ruta/a/apache-hop
ExecStart=/ruta/a/apache-hop/hop-server.sh 0.0.0.0 8080
ExecStop=/ruta/a/apache-hop/hop-server.sh 0.0.0.0 8080 8182 --kill --userName cluster --password cluster
Restart=on-failure
RestartSec=5

#Max log
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=hop

[Install]
WantedBy=multi-user.target
```
In that case, is it a good idea to add the ShutdownPort (8182), or is it not needed as a best practice?




GitHub link: https://github.com/apache/hop/discussions/4540#discussioncomment-11185802

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Apache Hop Server systemd (hop)

Posted by "ravamo (via GitHub)" <gi...@apache.org>.
GitHub user ravamo added a comment to the discussion: Apache Hop Server  systemd

Regarding this, is there any way to send both server logs and execution logs to a specific file, like /var/logs/apache_hop.log? I saw this [link](https://hop.apache.org/manual/latest/hop-server/index.html#_enable_detailed_server_logging), but it’s not 100% clear to me 

GitHub link: https://github.com/apache/hop/discussions/4540#discussioncomment-11192703

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Apache Hop Server systemd (hop)

Posted by "hansva (via GitHub)" <gi...@apache.org>.
GitHub user hansva added a comment to the discussion: Apache Hop Server  systemd

Currently there is no clean way to shut down a Hop Server, @nadment is taking a look if we can add something to make it possible

GitHub link: https://github.com/apache/hop/discussions/4540#discussioncomment-11185869

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org


Re: [D] Apache Hop Server systemd (hop)

Posted by "ravamo (via GitHub)" <gi...@apache.org>.
GitHub user ravamo added a comment to the discussion: Apache Hop Server  systemd

OK, but on the website I do have the execution logs. Isn't there somewhere to send that information to a log? I'll still check what you've mentioned

GitHub link: https://github.com/apache/hop/discussions/4540#discussioncomment-11222675

----
This is an automatically sent email for users@hop.apache.org.
To unsubscribe, please send an email to: users-unsubscribe@hop.apache.org