How does one properly edit the clickhouse-server config.xml file? - clickhouse

The ClickHouse quick start guide says that when modifying config.xml: "It's not really handy to directly edit config.xml file considering package updates. Recommended way is to override the config elements in files of config.d directory."
I am new to ClickHouse (as well as daemon configuration). What does that statement mean? Where is the config.d directory? What files should go into that directory and what should the contents be?

It means that it's recommended to create a separate configuration file in the config.d directiory (that is located in the same path as the current configuration file; so /etc/clickhouse-server/config.d/ by default).
"considering package updates" means that if you update your clickhouse-server package, it may rewrite the /etc/clickhouse-server/config.xml, so you shouldn't put any changes in there - it'll be rewritten and lost.
It says so in the documentation:
The main server config file is 'config.xml'. It resides in the /etc/clickhouse-server/ directory.
Certain settings can be overridden in the *.xml and *.conf files from the 'conf.d' and 'config.d' directories next to the config.
So, you should create a /etc/clickhouse-server/config.d/ directory; then, create a configuration file there (like config.xml, my_config.conf or whatever else). There you should do all your custom settings, the ones that differ from the original /etc/clickhouse-server/config.xml file.
For instance, you could change the HTTP port from 8123 to 8663:
# cat /etc/clickhouse-server/config.d/test.xml
<?xml version="1.0"?>
<yandex>
<http_port>8663</http_port>
</yandex>
Please make sure to restart the daemon (if you're using Ubuntu, it's sudo service clickhouse-server restart) for the configuration changes to apply.

Related

Is there a way to change the /etc/default/elasticsearch file for elasticsearch 7?

In the documentation for elasticsearch 7 it says explicitly
For the package distributions, the config directory location defaults
to /etc/elasticsearch . The location of the config directory can also
be changed via the ES_PATH_CONF environment variable, but note that
setting this in your shell is not sufficient. Instead, this variable
is sourced from /etc/default/elasticsearch (for the Debian package)
and /etc/sysconfig/elasticsearch (for the RPM package). You will need
to edit the ES_PATH_CONF=/etc/elasticsearch entry in one of these
files accordingly to change the config directory location.
Is there a way to specify my own path for a different /etc/default/elasticsearch file for a package distribution installation? I already tried by adding the following in my systemd service file which uses the EnvironmentFile I want, but it still uses /etc/default/elasticsearch when the service is comming up.
[Service]
...
EnvironmentFile=-/etc/default/elasticsearch-development
The answer to this (at least for version 7.7.0) is that you can't do it seamlessly with any option or environment variable because it is not provided. However it is possible to edit the file /usr/share/elasticsearch/elasticsearch-env that comes with the package installation and replace line 81 with the following:
if [ ! -z "$ES_DEFAULT" ]; then
source $ES_DEFAULT
else
source /etc/default/elasticsearch
fi
Then it is possible to set ES_DEFAULT in the system service file to point to a different /etc/default file.
[Service]
...
Environment=ES_DEFAULT=/etc/default/elasticsearch-development

Why do I not have a .hgrc file?

I'm trying to insert the mercurial_keyring file with my username and password in the .hgrc file but it doesn't exist in my user directory on windows. I have tortoise hg installed and even checked if it was installed properly on the command prompt yet I still don't have the .hgrc folder.
Can anyone tell me what might be the reason to it?
Thanks
Because it's %USERPROFILE%\mercurial.ini
Mercurial reads configuration data from several files, if they exist.
These files do not exist by default and you will have to create the
appropriate configuration files yourself:
Local configuration is put into the per-repository /.hg/hgrc
file.
Global configuration like the username setting is typically put into:
%USERPROFILE%\mercurial.ini (on Windows)
The .hgrc files are not created automatically when you install Mercurial or TortoiseHg.
You will need to manually create it at the location you need whether that is within the repository's .hg folder or your own C:\Users\username\ folder.
You will probably need to use the command line to create the file as it's not usually possible to create filenames that start with . in Windows Explorer.
https://www.selenic.com/mercurial/hgrc.5.html

Where is ejabberd server configuration file on Mac OS?

I have installed the Jabbered 15.07 on my MAC OS. After installation, I want to config it by editing the /Applications/ejabberd-15.07/conf/ejabberd.yml. I am not sure whether it is the file I should change, I searched the Internet and found that sb said the configuration is in the folder /etc but I did not found it there. In order to prove that it is the file I want to find, I open the admin interface and add a record in the "ACL" screen. And after that I checked the ejabberd.yml, but it remained unchanged. So is it the configuration file of ejabberd, if it is not which file it should be and how to configure it?
The location of the config file depend on how you installed ejabberd.
Apparently, you used binary installer, not make install, so config file is as your expected:
/Applications/ejabberd-15.07/conf/ejabberd.yml
Admin interface does not change the config file but write in mnesia database. You could configure ejabberd so that database override config file, but this is not a good practice. To make change permanent, you need to edit ejabberd.yml file.
Note: You should use latest ejabberd published version if you are starting today (15.11).

Location of hue.ini to set share_jobs in CDH 4.7

I'm attempting to set the share_jobs setting described HERE to false.
The documentation HERE says to visit http://myserver:port/dump_config to find the location of the HUE config. For me it gives /var/run/cloudera-scm-agent/process/73-hue-HUE_SERVER/.
As you may guess from it being in /var/run/ the directory is recreated every time on boot so changes to the hue.ini are not saved and do not seem to affect the config listed at http://myserver:port/dump_config.
I ran find / -name hue.ini to see if there was another hue.ini to change. It returned:
/var/run/cloudera-scm-agent/process/73-hue-HUE_SERVER/hue.ini
/var/run/cloudera-scm-agent/process/69-hue-BEESWAX_SERVER/hue.ini
/opt/cloudera/parcels/CDH-4.7.0-1.cdh4.7.0.p0.40/share/hue/desktop/conf/hue.ini
/opt/cloudera/parcels/CDH-4.7.0-1.cdh4.7.0.p0.40/etc/hue/hue.ini
I've changed the config in each of these files to no avail. Where exactly is the hue.ini that I need to change?
I've also been looking around the Cloudera Manager for the jobbrowser section in the configuration but I have not been able to find it.
hue.ini file inside the server configuration directory (/var/run/cloudera-scm-agent/process/73-hue-HUE_SERVER/) should be modified that too not directly, should use CM instead. Location of the configuration directory will be changed during restart or applying new configurations.
Usually important service configurations will be listed in the cloudera manager configuration section. Configuration properties which are unimportant or new may not be listed, in that case these properties are supplied in the safety_val sections.
Go to CM Hue service configuration section search for hue_safety_valve_server.ini, then add the following
[jobbrowser]
share_jobs=false
Save and restart. Now if you go and check the /var/run/cloudera-scm-agent/process/XXX-hue-HUE_SERVER/hue.ini file you can see the change. What ever contents you are giving in safety_val will get appended to hue.ini file.

how do I change the location of the httpd.conf for Apache on windows?

I am working on setting up a load balancing cluster on windows server 2012 and have a shared drive where I want the configuration files for Apache to exist at. This way each member of the LB can load the exact same config files. How do I change where the config file is located independently of where the ServerRoot is?
Start the Apache process with the -d parameter and give your alternative ServerRoot as an argument, though I'd imagine it would be a much better idea for you to use some mechanism to sync the files locally to each server.
Also read http://httpd.apache.org/docs/2.4/mod/core.html#mutex, as it's advised if you're running from a networked file system.
If you just want to specify the main config file, start the process with the -f parameter and the path to the config file as an argument.

Resources