You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by jo...@apache.org on 2018/03/19 22:00:20 UTC

aurora git commit: Persist scheduler/observer logs to /var/log/aurora/[FILE].log

Repository: aurora
Updated Branches:
  refs/heads/master b34eb1693 -> e0e90e172


Persist scheduler/observer logs to /var/log/aurora/[FILE].log

`journalctl -u aurora-[executor|scheduler]` still works.

Reviewed at https://reviews.apache.org/r/65896/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/e0e90e17
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/e0e90e17
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/e0e90e17

Branch: refs/heads/master
Commit: e0e90e172a1dee138c0e2eef43366a9f92302dd4
Parents: b34eb16
Author: Jordan Ly <jo...@gmail.com>
Authored: Mon Mar 19 13:58:29 2018 -0700
Committer: Jordan Ly <jl...@twitter.com>
Committed: Mon Mar 19 13:58:29 2018 -0700

----------------------------------------------------------------------
 docs/getting-started/vagrant.md                 |  4 +--
 examples/vagrant/aurorabuild.sh                 |  2 +-
 examples/vagrant/provision-dev-cluster.sh       | 13 ++++++++
 .../vagrant/systemd/aurora-executor.service     | 31 ------------------
 .../systemd/aurora-scheduler-kerberos.service   |  4 ++-
 .../vagrant/systemd/aurora-scheduler.service    |  4 ++-
 examples/vagrant/systemd/thermos.service        | 34 ++++++++++++++++++++
 7 files changed, 56 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/e0e90e17/docs/getting-started/vagrant.md
----------------------------------------------------------------------
diff --git a/docs/getting-started/vagrant.md b/docs/getting-started/vagrant.md
index 73d0aff..318833c 100644
--- a/docs/getting-started/vagrant.md
+++ b/docs/getting-started/vagrant.md
@@ -148,7 +148,7 @@ Most of the Vagrant related problems can be fixed by the following steps:
 
 If that still doesn't solve your problem, make sure to inspect the log files:
 
-* Scheduler: `sudo journalctl -u aurora-scheduler`
-* Observer: `sudo journalctl -u aurora-executor`
+* Scheduler: `/var/log/aurora/scheduler.log` or `sudo journalctl -u aurora-scheduler`
+* Observer: `/var/log/thermos/observer.log` or `sudo journalctl -u thermos-observer`
 * Mesos Master: `/var/log/mesos/mesos-master.INFO` (also see `.WARNING` and `.ERROR`)
 * Mesos Agent: `/var/log/mesos/mesos-slave.INFO` (also see `.WARNING` and `.ERROR`)

http://git-wip-us.apache.org/repos/asf/aurora/blob/e0e90e17/examples/vagrant/aurorabuild.sh
----------------------------------------------------------------------
diff --git a/examples/vagrant/aurorabuild.sh b/examples/vagrant/aurorabuild.sh
index 5eb1822..c39388f 100755
--- a/examples/vagrant/aurorabuild.sh
+++ b/examples/vagrant/aurorabuild.sh
@@ -71,7 +71,7 @@ function build_observer {
   ./pants binary src/main/python/apache/aurora/tools:thermos_observer
   ./pants binary src/main/python/apache/aurora/tools:thermos
   sudo ln -sf $DIST_DIR/thermos.pex /usr/local/bin/thermos
-  sudo systemctl restart aurora-executor
+  sudo systemctl restart thermos
 }
 
 function build_all {

http://git-wip-us.apache.org/repos/asf/aurora/blob/e0e90e17/examples/vagrant/provision-dev-cluster.sh
----------------------------------------------------------------------
diff --git a/examples/vagrant/provision-dev-cluster.sh b/examples/vagrant/provision-dev-cluster.sh
index 4a02390..fe3281f 100755
--- a/examples/vagrant/provision-dev-cluster.sh
+++ b/examples/vagrant/provision-dev-cluster.sh
@@ -42,6 +42,18 @@ Host *
 EOF
 }
 
+function install_rsyslog_config {
+  cat >> /etc/rsyslog.d/10-aurora.conf <<EOF
+# Send scheduler logs to /var/log/aurora/scheduler.log
+:syslogtag, contains, "aurora-scheduler" /var/log/aurora/scheduler.log
+
+# Send observer logs to /var/log/thermos/observer.log
+:syslogtag, contains, "thermos-observer" /var/log/thermos/observer.log
+
+EOF
+  systemctl restart rsyslog
+}
+
 function configure_netrc {
   cat > /home/vagrant/.netrc <<EOF
 machine $(hostname -f)
@@ -94,6 +106,7 @@ prepare_sources
 prepare_extras
 install_cluster_config
 install_ssh_config
+install_rsyslog_config
 start_services
 configure_netrc
 docker_setup

http://git-wip-us.apache.org/repos/asf/aurora/blob/e0e90e17/examples/vagrant/systemd/aurora-executor.service
----------------------------------------------------------------------
diff --git a/examples/vagrant/systemd/aurora-executor.service b/examples/vagrant/systemd/aurora-executor.service
deleted file mode 100644
index 5a1a908..0000000
--- a/examples/vagrant/systemd/aurora-executor.service
+++ /dev/null
@@ -1,31 +0,0 @@
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-[Unit]
-Description=Aurora Thermos Observer
-After=network.target
-Wants=network.target
-
-[Service]
-ExecStart=/home/vagrant/aurora/dist/thermos_observer.pex \
-  --ip=192.168.33.7 \
-  --port=1338 \
-  --log_to_disk=NONE \
-  --log_to_stderr=google:INFO
-User=root
-Group=root
-Restart=always
-RestartSec=20
-LimitNOFILE=16384
-
-[Install]
-WantedBy=multi-user.target

http://git-wip-us.apache.org/repos/asf/aurora/blob/e0e90e17/examples/vagrant/systemd/aurora-scheduler-kerberos.service
----------------------------------------------------------------------
diff --git a/examples/vagrant/systemd/aurora-scheduler-kerberos.service b/examples/vagrant/systemd/aurora-scheduler-kerberos.service
index 1c2cfc4..10e4f2c 100644
--- a/examples/vagrant/systemd/aurora-scheduler-kerberos.service
+++ b/examples/vagrant/systemd/aurora-scheduler-kerberos.service
@@ -21,9 +21,11 @@ Environment="GLOG_v=0"
 Environment="LIBPROCESS_PORT=8083"
 Environment="LIBPROCESS_IP=192.168.33.7"
 Environment="MESOS_NATIVE_JAVA_LIBRARY=/usr/lib/libmesos.so"
-
 Environment="DIST_DIR=/home/vagrant/aurora/dist"
 
+# Identifier for rsyslog redirect (see `install_rsyslog_config` in `provision-dev-cluster.sh`).
+SyslogIdentifier=aurora-scheduler
+
 # Flags that control the behavior of the JVM.
 Environment="JAVA_OPTS='-Djava.library.path=/usr/lib \
   -Xdebug \

http://git-wip-us.apache.org/repos/asf/aurora/blob/e0e90e17/examples/vagrant/systemd/aurora-scheduler.service
----------------------------------------------------------------------
diff --git a/examples/vagrant/systemd/aurora-scheduler.service b/examples/vagrant/systemd/aurora-scheduler.service
index 524cbb3..57e4bba 100644
--- a/examples/vagrant/systemd/aurora-scheduler.service
+++ b/examples/vagrant/systemd/aurora-scheduler.service
@@ -21,9 +21,11 @@ Environment="GLOG_v=1"
 Environment="LIBPROCESS_PORT=8083"
 Environment="LIBPROCESS_IP=192.168.33.7"
 Environment="MESOS_NATIVE_JAVA_LIBRARY=/usr/lib/libmesos.so"
-
 Environment="DIST_DIR=/home/vagrant/aurora/dist"
 
+# Identifier for rsyslog redirect (see `install_rsyslog_config` in `provision-dev-cluster.sh`).
+SyslogIdentifier=aurora-scheduler
+
 # Flags that control the behavior of the JVM.
 Environment="JAVA_OPTS='-Djava.library.path=/usr/lib \
   -Xdebug \

http://git-wip-us.apache.org/repos/asf/aurora/blob/e0e90e17/examples/vagrant/systemd/thermos.service
----------------------------------------------------------------------
diff --git a/examples/vagrant/systemd/thermos.service b/examples/vagrant/systemd/thermos.service
new file mode 100644
index 0000000..01925bc
--- /dev/null
+++ b/examples/vagrant/systemd/thermos.service
@@ -0,0 +1,34 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+[Unit]
+Description=Aurora Thermos Observer
+After=network.target
+Wants=network.target
+
+[Service]
+# Identifier for rsyslog redirect (see `install_rsyslog_config` in `provision-dev-cluster.sh`).
+SyslogIdentifier=thermos-observer
+
+ExecStart=/home/vagrant/aurora/dist/thermos_observer.pex \
+  --ip=192.168.33.7 \
+  --port=1338 \
+  --log_to_disk=NONE \
+  --log_to_stderr=google:INFO
+User=root
+Group=root
+Restart=always
+RestartSec=20
+LimitNOFILE=16384
+
+[Install]
+WantedBy=multi-user.target