Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made Munin setup optional by configuration #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .config.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ emailcontact=nominatim@localhost
username=nominatim
password=

# Enable Munin graphs. To turn off this feature leave as blank.
# setupMuninGraphs=yes enables the feature
setupMuninGraphs=yes
# Munin plugins path wthout trailing /!
muninPluginsPath=/etc/munin/plugins

# Apache virtual host configuration file name - with .conf extension
nominatimVHfile=400-nominatim.conf

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Running the installation script `run.sh` (as *root*) will:
* download the planet extract as defined by the `.config.sh` file
* build the Nominatim index
* create a virtual host
* setup Munin plugins (Note: server needs to be Munin node)

The *root* user is required to install the packages, but most of the installation is done as the *nominatim* user (using *sudo*).

Expand Down Expand Up @@ -42,6 +43,7 @@ cp .config.sh.template .config.sh

# Edit .config.sh
# At least set a password for the nominatim user
# Disable ```setupMuninGraphs``` if you don't have a Munin node running
# Rest of file defaults to processing Andorra - which should take about half an hour

# Run the installation
Expand Down
38 changes: 25 additions & 13 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,6 @@ fi
echo "# $(date) Restarting PostgreSQL"
service postgresql restart

# Nominatim munin
# !! Look at the comments at the top of the nominatim_importlag file in the following and copy the setup section to a new file in: /etc/munin/plugin-conf.d/
ln -s '/home/nominatim/Nominatim/munin/nominatim_importlag' '/etc/munin/plugins/nominatim_importlag'
ln -s '/home/nominatim/Nominatim/munin/nominatim_query_speed' '/etc/munin/plugins/nominatim_query_speed'
ln -s '/home/nominatim/Nominatim/munin/nominatim_nominatim_requests' '/etc/munin/plugins/nominatim_nominatim_requests'


# Needed to help postgres munin charts work
apt-get -y install libdbd-pg-perl
munin-node-configure --shell | grep postgres | sh
service munin-reload restart


# We will use the Nominatim user's homedir for the installation, so switch to that
cd /home/${username}

Expand Down Expand Up @@ -233,6 +220,31 @@ sudo -u ${username} ./autogen.sh
sudo -u ${username} ./configure
sudo -u ${username} make

# Nominatim munin
if [ ! -z "$setupMuninGraphs" ]; then
if [ -z "$muninPluginsPath" ]; then
echo "# Missing muninPluginsPath configuration" 1>&2
exit 1
fi

if [ ! -d "${muninPluginsPath}" ]; then
echo "# Munin plugins directory does not exist: : ${muninPluginsPath}" 1>&2
exit 1
fi

echo "# Setup Munin as requested" 1>&2

# !! Look at the comments at the top of the nominatim_importlag file in the following and copy the setup section to a new file in: /etc/munin/plugin-conf.d/
ln -s "/home/${username}/Nominatim/munin/nominatim_importlag" "${muninPluginsPath}/nominatim_importlag"
ln -s "/home/${username}/Nominatim/munin/nominatim_query_speed" "${muninPluginsPath}/nominatim_query_speed"
ln -s "/home/${username}/Nominatim/munin/nominatim_nominatim_requests" "${muninPluginsPath}/nominatim_nominatim_requests"

# Needed to help postgres munin charts work
apt-get -y install libdbd-pg-perl
munin-node-configure --shell | grep postgres | sh
service munin-reload restart
fi

# Customization of the Installation
# http://wiki.openstreetmap.org/wiki/Nominatim/Installation#Customization_of_the_Installation

Expand Down