]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add bootstrap --log-to-file option
authorSage Weil <sage@newdream.net>
Wed, 7 Jul 2021 16:14:36 +0000 (12:14 -0400)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 10 Aug 2021 14:31:22 +0000 (16:31 +0200)
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 7500b821aec731ac9d6cef17ad9651d5c6143c68)

doc/cephadm/install.rst
src/cephadm/cephadm

index 2a4a8887aceb2f4dda78f92a2d8217eae49f57c8..25907296c5455863be8614d92043ad7f06bfe65a 100644 (file)
@@ -173,6 +173,11 @@ immediately to know more about ``cephadm bootstrap``, read the list below.
 Also, you can run ``cephadm bootstrap -h`` to see all of ``cephadm``'s
 available options.
 
+* By default, Ceph daemons send their log output to stdout/stderr, which is picked
+  up by the container runtime (docker or podman) and (on most systems) sent to
+  journald.  If you want Ceph to write traditional log files to ``/var/log/ceph/$fsid``,
+  use ``--log-to-file`` option during bootstrap.
+
 * Larger Ceph clusters perform better when (external to the Ceph cluster)
   public network traffic is separated from (internal to the Ceph cluster)
   cluster traffic. The internal cluster traffic handles replication, recovery,
index 52470d3292ff324a27d59f38c8f33805b75da245..1bd9773ac813f43c4ca0cdcb1812b7cdd78653b1 100755 (executable)
@@ -3935,6 +3935,13 @@ def prepare_bootstrap_config(
                 and not cp.has_option('mgr', 'mgr standby modules')
         ):
             cp.set('mgr', 'mgr_standby_modules', 'false')
+    if ctx.log_to_file:
+        cp.set('global', 'log_to_file', 'true')
+        cp.set('global', 'log_to_stderr', 'false')
+        cp.set('global', 'log_to_journald', 'false')
+        cp.set('global', 'mon_cluster_log_to_file', 'true')
+        cp.set('global', 'mon_cluster_log_to_stderr', 'false')
+        cp.set('global', 'mon_cluster_log_to_journald', 'false')
 
     cpf = StringIO()
     cp.write(cpf)
@@ -7905,7 +7912,6 @@ def _get_parser():
         '--ssh-user',
         default='root',
         help='set user for SSHing to cluster hosts, passwordless sudo will be needed for non-root users')
-
     parser_bootstrap.add_argument(
         '--skip-mon-network',
         action='store_true',
@@ -7961,7 +7967,6 @@ def _get_parser():
     parser_bootstrap.add_argument(
         '--apply-spec',
         help='Apply cluster spec after bootstrap (copy ssh key, add hosts and apply services)')
-
     parser_bootstrap.add_argument(
         '--shared_ceph_folder',
         metavar='CEPH_SOURCE_FOLDER',
@@ -7999,6 +8004,10 @@ def _get_parser():
         '--single-host-defaults',
         action='store_true',
         help='adjust configuration defaults to suit a single-host cluster')
+    parser_bootstrap.add_argument(
+        '--log-to-file',
+        action='store_true',
+        help='configure cluster to log to traditional log files in /var/log/ceph/$fsid')
 
     parser_deploy = subparsers.add_parser(
         'deploy', help='deploy a daemon')