/var/lang/bin/nscd -f /var/lang/conf/nscd.conf
scf_bootstrap
同函数代码一起部署到云上,函数代码更新后的调用即可使用 DNS 缓存功能。yum install nscd -y
/etc/nscd.conf
更新为以下内容:## /etc/nscd.conf## An example Name Service Cache config file. This file is needed by nscd.## WARNING: Running nscd with a secondary caching service like sssd may lead to# unexpected behaviour, especially with how long entries are cached.## Legal entries are:## logfile <file># debug-level <level># threads <initial #threads to use># max-threads <maximum #threads to use># server-user <user to run server as instead of root># server-user is ignored if nscd is started with -S parameters# stat-user <user who is allowed to request statistics># reload-count unlimited|<number># paranoia <yes|no># restart-interval <time in seconds>## enable-cache <service> <yes|no># positive-time-to-live <service> <time in seconds># negative-time-to-live <service> <time in seconds># suggested-size <service> <prime number># check-files <service> <yes|no># persistent <service> <yes|no># shared <service> <yes|no># NOTE: Setting 'shared' to a value of 'yes' will accelerate the lookup,# but those lookups will not be counted as cache hits# i.e. 'nscd -g' may show '0%'.# max-db-size <service> <number bytes># auto-propagate <service> <yes|no>## Currently supported cache names (services): passwd, group, hosts, services## logfile /var/log/nscd.log# threads 4# max-threads 32server-user root# stat-user somebodydebug-level 0reload-count 2paranoia no# restart-interval 3600enable-cache passwd nopositive-time-to-live passwd 600negative-time-to-live passwd 20suggested-size passwd 211check-files passwd yespersistent passwd yesshared passwd yesmax-db-size passwd 33554432auto-propagate passwd yesenable-cache group nopositive-time-to-live group 3600negative-time-to-live group 60suggested-size group 211check-files group yespersistent group yesshared group yesmax-db-size group 33554432auto-propagate group yesenable-cache hosts yespositive-time-to-live hosts 300negative-time-to-live hosts 0suggested-size hosts 211check-files hosts nopersistent hosts noshared hosts yesmax-db-size hosts 8388608enable-cache services nopositive-time-to-live services 600negative-time-to-live services 3suggested-size services 211check-files services yespersistent services yesshared services yesmax-db-size services 33554432enable-cache netgroup nopositive-time-to-live n etgroup 28800negative-time-to-live netgroup 20suggested-size netgroup 211check-files netgroup yespersistent netgroup yesshared netgroup yesmax-db-size netgroup 33554432
scf_bootstrap
中添加下述命令,以启动 nscd 进程开启 DNS 缓存。
以 centos 为例,将下述命令添加到启动文件中:${PATH}/nscd -f /etc/nscd.conf
${PATH}
为 nscd 安装的绝对路径。
本页内容是否解决了您的问题?