Few improvements
* Fix netdata config files owner * Increase net backlog in sysctl.conf * force wo-kernel tweak update during upgrade
This commit is contained in:
27
install
27
install
@@ -182,7 +182,7 @@ wo_install_dep() {
|
||||
}
|
||||
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
||||
# install dependencies
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install build-essential curl gzip python3 python3-apt python3-setuptools python3-requests python3-dev sqlite3 git tar software-properties-common pigz gnupg2 cron ccze rsync tree haveged ufw > /dev/null 2>&1
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install build-essential curl gzip python3 python3-apt python3-setuptools python3-requests python3-dev sqlite3 git tar software-properties-common pigz gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades > /dev/null 2>&1
|
||||
else
|
||||
# install dependencies
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install build-essential curl gzip dirmngr sudo python3 python3-apt python3-setuptools python3-requests python3-dev ca-certificates sqlite3 git tar software-properties-common pigz apt-transport-https gnupg2 cron ccze rsync tree haveged ufw > /dev/null 2>&1
|
||||
@@ -645,21 +645,20 @@ wo_remove_ee_cron() {
|
||||
|
||||
wo_tweak_kernel() {
|
||||
|
||||
if [ ! -f /etc/sysctl.d/60-wo-tweaks.conf ]; then
|
||||
if [ "$WO_ARCH" = "x86_64" ]; then
|
||||
rm -f /etc/sysctl.d/60-ubuntu-nginx-web-server.conf
|
||||
wget -qO /etc/sysctl.d/60-wo-tweaks.conf https://raw.githubusercontent.com/WordOps/WordOps/master/wo/cli/templates/sysctl.mustache
|
||||
if [ "$wo_distro_version" = "bionic" ] || [ "$wo_distro_version" = "disco" ] || [ "$wo_distro_version" = "buster" ]; then
|
||||
modprobe tcp_bbr && echo 'tcp_bbr' >> /etc/modules-load.d/bbr.conf
|
||||
echo -e '\nnet.ipv4.tcp_congestion_control = bbr\nnet.ipv4.tcp_notsent_lowat = 16384' >> /etc/sysctl.d/60-wo-tweaks.conf
|
||||
else
|
||||
modprobe tcp_htcp && echo 'tcp_htcp' >> /etc/modules-load.d/htcp.conf
|
||||
echo 'net.ipv4.tcp_congestion_control = htcp' >> /etc/sysctl.d/60-wo-tweaks.conf
|
||||
fi
|
||||
# apply sysctl tweaks
|
||||
sysctl -eq -p /etc/sysctl.d/60-wo-tweaks.conf
|
||||
if [ "$WO_ARCH" = "x86_64" ]; then
|
||||
rm -f /etc/sysctl.d/60-ubuntu-nginx-web-server.conf
|
||||
wget -qO /etc/sysctl.d/60-wo-tweaks.conf https://raw.githubusercontent.com/WordOps/WordOps/"$wo_branch"/wo/cli/templates/sysctl.mustache
|
||||
if [ "$wo_distro_version" = "bionic" ] || [ "$wo_distro_version" = "disco" ] || [ "$wo_distro_version" = "buster" ]; then
|
||||
modprobe tcp_bbr && echo 'tcp_bbr' >> /etc/modules-load.d/bbr.conf
|
||||
echo -e '\nnet.ipv4.tcp_congestion_control = bbr\nnet.ipv4.tcp_notsent_lowat = 16384' >> /etc/sysctl.d/60-wo-tweaks.conf
|
||||
else
|
||||
modprobe tcp_htcp && echo 'tcp_htcp' >> /etc/modules-load.d/htcp.conf
|
||||
echo 'net.ipv4.tcp_congestion_control = htcp' >> /etc/sysctl.d/60-wo-tweaks.conf
|
||||
fi
|
||||
# apply sysctl tweaks
|
||||
sysctl -eq -p /etc/sysctl.d/60-wo-tweaks.conf
|
||||
fi
|
||||
|
||||
if [ ! -x /opt/wo-kernel.sh ]; then
|
||||
{
|
||||
# download and setup wo-kernel systemd service to apply kernel tweaks for netdata and redis on server startup
|
||||
|
||||
@@ -126,12 +126,11 @@ def pre_pref(self, apt_packages):
|
||||
|
||||
# add nginx repository
|
||||
if set(WOVariables.wo_nginx).issubset(set(apt_packages)):
|
||||
Log.info(self, "Adding repository for NGINX, please wait...")
|
||||
if (WOVariables.wo_distro == 'ubuntu'):
|
||||
Log.info(self, "Adding repository for NGINX, please wait...")
|
||||
WORepo.add(self, ppa=WOVariables.wo_nginx_repo)
|
||||
Log.debug(self, 'Adding ppa for Nginx')
|
||||
else:
|
||||
Log.info(self, "Adding repository for NGINX, please wait...")
|
||||
WORepo.add(self, repo_url=WOVariables.wo_nginx_repo)
|
||||
Log.debug(self, 'Adding repository for Nginx')
|
||||
WORepo.add_key(self, WOVariables.wo_nginx_key)
|
||||
@@ -139,12 +138,11 @@ def pre_pref(self, apt_packages):
|
||||
# add php repository
|
||||
if (set(WOVariables.wo_php73).issubset(set(apt_packages)) or
|
||||
set(WOVariables.wo_php).issubset(set(apt_packages))):
|
||||
Log.info(self, "Adding repository for PHP, please wait...")
|
||||
if (WOVariables.wo_distro == 'ubuntu'):
|
||||
Log.info(self, "Adding repository for PHP, please wait...")
|
||||
Log.debug(self, 'Adding ppa for PHP')
|
||||
WORepo.add(self, ppa=WOVariables.wo_php_repo)
|
||||
else:
|
||||
Log.info(self, "Adding repository for PHP, please wait...")
|
||||
# Add repository for php
|
||||
if (WOVariables.wo_platform_codename == 'buster'):
|
||||
php_pref = ("Package: *\nPin: origin "
|
||||
@@ -163,14 +161,11 @@ def pre_pref(self, apt_packages):
|
||||
if WOVariables.wo_distro == 'ubuntu':
|
||||
Log.debug(self, 'Adding ppa for redis')
|
||||
WORepo.add(self, ppa=WOVariables.wo_redis_repo)
|
||||
else:
|
||||
Log.debug(self, 'Adding repo_url of redis for debian')
|
||||
|
||||
|
||||
def post_pref(self, apt_packages, packages):
|
||||
"""Post activity after installation of packages"""
|
||||
if (apt_packages):
|
||||
|
||||
# Nginx configuration
|
||||
if set(WOVariables.wo_nginx).issubset(set(apt_packages)):
|
||||
# Nginx main configuration
|
||||
@@ -1363,6 +1358,10 @@ def post_pref(self, apt_packages, packages):
|
||||
Log.debug(self, "{0}".format(e))
|
||||
Log.info(
|
||||
self, "fail to setup mysql user for netdata")
|
||||
WOFileUtils.chown(self, '/opt/netdata',
|
||||
'netdata',
|
||||
'netdata',
|
||||
recursive=True)
|
||||
WOService.restart_service(self, 'netdata')
|
||||
|
||||
# WordOps Dashboard
|
||||
|
||||
@@ -50,8 +50,6 @@ map $request_uri $uri_no_cache {
|
||||
"~*/embed" 1;
|
||||
"~*/commande/" 1;
|
||||
"~*/resetpass/" 1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
# do not cache requests with query strings
|
||||
|
||||
@@ -196,8 +196,8 @@ net.core.somaxconn = 32768
|
||||
# Increase number of incoming connections backlog
|
||||
net.core.netdev_max_backlog = 16384
|
||||
net.core.dev_weight = 64
|
||||
net.core.netdev_budget = 600
|
||||
net.core.netdev_budget_usecs = 4000
|
||||
net.core.netdev_budget = 1200
|
||||
net.core.netdev_budget_usecs = 8000
|
||||
|
||||
# Increase the maximum amount of option memory buffers
|
||||
net.core.optmem_max = 65535
|
||||
|
||||
Reference in New Issue
Block a user