Force reload the clickhouse config? - config

How can I forcefully reload the clickhouse configuration? I need to make changes to /etc/clickhouse-server/config.xml (remote_servers). Can I force clickhouse to re-read the file without restarting the service?

The server tracks changes to config files and files that were used for substitutions and overrides and reloads users and clusters configurations in runtime. That is, you can add or change users, clusters and their settings without relaunching the server. For remote_servers server read config immediately after the request

Restart the ClickHouse Database to apply the configuration changes: in Ubuntu:
sudo service clickhouse-server restart

Related

dynamic configuration of freeradius server

Currently we have to restart radiusd every time after making configuration changes. According to this man page (https://freeradius.org/radiusd/man/radmin.html) some configurations can be huped using radmin so that dynamic configuration change can be done without server restart. However, this page does not give much details on what configuration can be huped, eg. I tried to hup an eap configuration but it is not supported. Is there a check list of modules/parameters configuration that are supported by hup method?

How do you disable "/controlpanel" directory redirect to :2083 in WHM?

I've used WHM and cpanel for years but recently noticed that after an update the "/controlpanel" directory has been automatically added allowing domain.com/controlpanel to redirect to domain.com:2083
How do you disable this redirect that is public facing?
The /controlpanel and /securecontrolpanel are controlled by ScriptAliasMatch in httpd.conf which cannot by modified directly as WHM/cPanel will rebuild it again as it where before the manual modifications. So it will be better if modifications done through one of the following options:
SSH access is needed to apply any one of these
Modify the yaml file which used in the rebuild apache configuration process, the file can be found under /var/cpanel/conf/apache/local or /var/cpanel/conf/apache/main then rebuild apache configuration by running /scripts/rebuildhttpdconf then restart apache by running /usr/local/cpanel/scripts/restartsrv_httpd
Modify the template file which used to parse the previous yaml file in order to generate the configuration file. First copy this file /var/cpanel/templates/apache2_4/ea4_main.default to /var/cpanel/templates/apache2_4/ea4_main.local then start modifying it then rebuild and restart apache.
And my vote goes to the first option to keep it clean and simple as possible but it worth knowing both ways so you can extend the functionality as much as you can.
For more details:
Apache Global Configuration docs
Apache Custom Templates docs

Where does dump.rdb belong?

I remember playing around with some settings and I believe it changed the location of dump.rdb. Now, dump.rdb auto-magically appears at the root of my projects.
Where does it belong, and how would I return it there? Also, how does this location change when in a production environment?
Where does it belong?
Wherever you want.
The default directory is ./, meaning the directory where the Redis server got started from.
Edit:
* I am modifying your second question (asked in comment) a little bit.
Is it possible to change to location of dump.rdb? How?
Yes, it is possible. There two possible ways I can think of.
1.
Modify redis configuration file (e.g. redis.conf) and restart redis server. This way, every restart after this one will use the new directory. But redis will not reload any previous data at first restart (because there will not be anything to reload from).
To reload previous data, previous dump.rdb would have to be moved to new location manually before restarting the server.
2.
Set new directory by CONFIG SET command. E.g.
CONFIG SET dir path/to/new/directory
* Note that the path has to be a directory.
That's it! But this way is not permanent because server restart will use the old directory.
To make new directory permanent, execute CONFIG REWRITE to rewrite the configuration file. Remember, redis server has to have write permission to that file.
dir path/to/dorectory has to be set in the redis config file.

How to read updated redis configuration file with running redis server

I made a change to redis.conf, but I don't see the changes applied to the running instance. Do I need to restart redis is order to pick up changes?
Yes you have to restart the server to get changes from redis.conf file. Alternatively you can do it in run time using config set command.
Read more about them on the following links
http://redis.io/topics/config
http://redis.io/commands/config-set

Can I execute a shell script when restarting (starting) apache webserver

I have an application with some cacheing backend and I want to clear the cacheing whenever the webserver is been restarted.
Is there a apache configuration directive or any other way to execute a shell script upon webserver (re)start?
Thanks,
Phil
Adding some more information, as asked by some answers already:
Base system is ofc linux based, in this exact situation: CentOs
Modifying the startup script is unfortunately no option as pointed out by one of the comments already, due to it beeing not configuration file within the respective RPM packages and therefor beeing replaced by updates. Also I think modifying the startup script would be a bad thing in general
I see, that actually linking both "restarting the webserver" and "clearing my app cache" is not exactly what should be tied together. I will consider other alternatives
My situation is as follows: I can define how the virtual host config looks like, but I can not define how the rest of the servers configuration looks like.
The application is actually PHP based (and runs on the symfony framework). Symfony pre-compiles alot of stuff into dynamic php files from what it finds in the static configuration files. We deploy our apps via RPM and after deployment, an webserver restart is actually initiated already, so I thought it might make sense to tie the cache-cleanup to it. But I think after getting all your feedback, it looks like it is better to put the cache cleanup process into the installation process itself.
You haven't provided a lot of detail here, so it's hard to give a concrete answer, but I would suggest that your best option is to write a script which handles restarting apache, and clearing your cache. It would look something like this:
#!/bin/sh
# restart apache
/etc/init.d/httpd graceful
# whatever needs to be done to clear cache
rm -rf /my/cache/dir
Ramy suggests modifying the system startup script for Apache -- this is a bad idea! If and when you update Apache on your server, there is a good chance that your change will be lost.
Dirk suggests that what you are trying to do is probably misguided, and I think he's right. You haven't told us what platform you are running, but I can think of few situations where restarting your webserver and clearing a cache actually need to happen together.
You can modify Startup script for the Apache Web Server in /etc/init.d/httpd and write your own syntax inside it.
chattr +i /etc/init.d/httpd
If you have (root) access to the server you could do this by shell scripts but I would consider if it is the best way of cache management to rely on apache restarts.