Project

General

Profile

Fix #11081

ceph.conf - $host always expands to localhost instead of actual hostname

Added by Thomas Johnson about 2 years ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
common
Target version:
-
Start date:
03/10/2015
Due date:
% Done:

0%

Source:
Community (user)
Tags:
Backport:
Reviewed:
Affected Versions:
ceph-qa-suite:
Release:
Needs Doc:
No

Description

Attempting to use the $host metavariable in ceph.conf always results in "localhost"
rather than the system's actual hostname. This prevents simple distribution of configs
via ceph-deploy. Manual substitution or clever automation is required, defeating the
purpose of the metavar.

Excerpt from ceph.conf:
[global]
osd crush location = host=$host root=not-default

Run:
ceph-crush-location --id 1 --type osd
ceph-conf --name=osd.1 --lookup=osd_crush_location

Output:
host=localhost root=not-default

System definitely knows its hostname:
hostname -s
Output: ceph-node-000

Expected:
host=ceph-node-000 root=not-default

Environment:
OS: Ubuntu Server 14.04 LTS
Ceph: ceph version 0.87.1 (283c2e7cfa2457799f534744d7d549f83ea1335e)

Code of Interest:
config.cc:93 - #include "common/config_opts.h"
config.cc:1054 - else if (var == "host") out += host;
config_opts.h:16 - OPTION(host, OPT_STR, "localhost")

History

#1 Updated by Loic Dachary almost 2 years ago

  • Tracker changed from Bug to Fix
  • Status changed from New to Verified

#2 Updated by Chang Liu 4 months ago

I have tested this. It's still exists.

#4 Updated by Sage Weil 3 months ago

  • Status changed from Verified to Resolved

Also available in: Atom PDF