How to manage kestrel service that is stopped - asp.net-core

I publish my AspNetCore project in CentOs7 x64 on kestrel without any reverse proxy server like enginx webServer.
My service stopped sometimes, how can I reset crashed service named kestrel?
I create kestrel service in /etc/systemd/system with this bash script:
[Unit]
Description=TestProject running on CentOS 7
[Service]
WorkingDirectory=/home/aspnetcore/TestProject
ExecStart=/usr/bin/dotnet /home/aspnetcore/TestProject/WebUi.dll
Restart=always
# Restart service after 10 seconds if dotnet service crashes
RestartSec=10
SyslogIdentifier=dotnet-example
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.target

you can use Monitoring systems for manage service lifetime.
Zabbix, PRTG and ManageEngine is best monitoring system. usually i use ManageEngine monitoring, that has Events as a sensor of service status. and for each event you can set Action(s), like execute bash script (for reset kestrel service).

Related

Ambari host registration is failing.

I have installed and configured ambari-server as root user and ambari agents as a non root user.
Also
SSH Passwordless authentication is setup and working fine.
ntp is installed and running
Hostname is updated in /etc/hostname /etc/hosts and
/etc/syscongig/network
Anaconda python 2.7.13 is installed as the python environment and
package manager
Restarted the service systemctl restart systemd.hostnamed as well
Add all the sudoer entries as per documentation
At the host configuration page. It is not able to register the hosts
Getting the information message as below and it eventually times out.
BSHostStatusCollector:55 - Request directory /var/run/ambari-server/bootstrap/6
Since I did a non root installation for ambari client. I had to chose the option manual registration instead of automated registration and after that it worked.

Running multiple services in a Fargate cluster

In fargate, I am deploying different applications in same cluster. Each application is running in different service and they have their own task.
Say, Service1 --> 2 task running in port 8080
Service2 --> 2 task running in port 8080.
I get an error "Container is excited" and task is not started.

Installing apache as a "manual" service (service that must not start automatically during the boot process)

I am trying to install Apache as a manual service as I don't want it to start automatically during the boot process.
When Apache is installed as a service by httpd -k install -n "apache_2.x", it starts automatically during the boot process which is not required. Like MariaDB/MySQL can be installed as a manual service by mysqld --install-manual "mariadb_10.x", can someone tell me how you install Apache as a manual service?
I also found out that Apache takes an argument called config as httpd -k config which is said to "change startup Options of an Apache service" (as quoted in httpd -h). I speculate that this option can help change the startup behavior. Can someone also please enlighten me on this argument?
Thanks in advance.

No response from running Tomcat: does not start, does nothing

I'm using Ansible to spin up a new Amazon EC2 install, and then I install Java and Tomcat (via the yum module). After placing the war for sample project from the Apache website in the webapps directory, I go and run the the command (below), nothing happens. It returns with response, no error. I've checked both the IP and port 8080 and Tomcat is not running.
[centos#sonar-test webapps]$ sudo systemctl start tomcat
[centos#sonar-test webapps]$ sudo systemctl start tomcat
[centos#sonar-test webapps]$
For reference, I was following this tutorial as well:
https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-7-on-centos-7-via-yum
From your comment on my question running curl in your ec2 instance
When I curl I get a large html document with various apache-esque things on it
It means Tomcat is installed and running.
If you don't access it, its because of your security group rules
In your ec2 console, select the Security Groups option. Edit the rules that is associated with your ec2 instance (the one running Tomcat) and permits inbound connections to port 8080 (so you can make request to your Tomcat server) and port 80 if you're running Apache (or nginx/another web server). If you're not sure about security, you can restrict the inbound traffic to come only from your IP so you can test but no-one else can make request.

Apache Mesos failing to get slave usage. Error Slave usage

Apache mesos fails to find slave usage when you select slaves on the mesos gui. Also the web console is showing "failing when trying to load resource."
This is a common issue when running on EC2 or other cloud providers where machines have both an external and an internal IP. Mesos reports the internal IP in the UI, so if you're using the web UI from outside of EC2, the URLs won't work.
Current Mesos master and the latest 0.15 release candidate fix this issues by adding a --hostname command line option to set the hostname that gets reported in the UI.
If you're running <0.15, you can fix the issue by adding all the hosts in your Mesos cluster to /etc/hosts like so:
<private ip> <public fqdn> <machine hostname>
for example:
10.98.58.170 ec2-54-224-191-136.compute-1.amazonaws.com ec2-54-224-191-136