株式会社ミライタスの社内発表会でG(インフラグループ:サーバー)チームが発表した「Linux Server 冗長化~リアルタイム同期でラクラク運用~」ののスライドです(個人名を含む部分等、一部変更を加えています)。専門的な内容ですが、実際にメンバーの1人が作業を行い検証したため、手順書としても使用できるものとなっています。
株式会社ミライタスの社内発表会でG(インフラグループ:サーバー)チームが発表した「Linux Server 冗長化~リアルタイム同期でラクラク運用~」ののスライドです(個人名を含む部分等、一部変更を加えています)。専門的な内容ですが、実際にメンバーの1人が作業を行い検証したため、手順書としても使用できるものとなっています。
SQL Server 2017でLinuxに対応し、その延長線でDocker対応やKubernetesによる可用性構成が組めるようになりました。そしてリリースを間近に控えたSQL Server 2019ではKubernetesを活用したBig Data Cluster機能の提供が予定されており、コンテナの活用範囲はさらに広がっています。
本セッションではこれからSQL Serverコンテナに触れていくための基礎知識と実際に触れてみるための手順やサンプルをお届けします。
In Web hosting services, hosting systems use access controls like suEXEC on apache Web servers to separate privilege by each virtual host. However, existing access control architectures on Web servers have a problem in their low performance and are not appropriate for dynamic contents like Web API since these architectures require termination of the process after each HTTP session. The system developers are not easy to install existing access controls since these are provided by each interpreter and program execution methods conventionally. In this paper, we propose the access control architecture “mod_process_security”. In this architecture a server process creates a new thread on the server process when accepting a request. Then, the web server separates privilege by the thread and processes the contents on the thread. The server process installed “mod_process_security” executes programs faster. System developers can easily install it on web servers since we replace it with the complicated existing access controls. “mod_process_security” can be installed for Apache HTTP Server on Linux as Apache Module which is widely used.
ホスティングサービスにおいて,仮想ホスト単位で権限を分離するためには,Web サーバ上のアクセス制御である suEXEC 等を利用する.しかし,既存の Web サーバにおけるアクセス制御方式は,プロセスの生成,破棄が必要となり,パフォーマンスが低く,Web API のような動的コンテンツに適していない.また,インタプリタやプログラム実行方式別に複数用意されており,システム開発者が扱いにくい.そこで,本稿では,コンテンツ処理時にサーバプロセス上で新規スレッドを生成し,スレッドで権限分離を行った上で,スレッド経由でコンテンツの処理を行うアクセス制御手法 “mod_process_security” を提案する.この手法は,高速に動作し,かつ,煩雑になっている Web サーバ上のアクセス制御手法を統一することで,システム開発者が扱いやすくなる.実装は,広く使われている Linux と Apache HTTP Server に対して Apache モジュールとして組み込む形式をとった.
15. require "apache2"
rewriteのような処理
function uri2file(r)
if string.match(r.uri, ".*¥.php") then
r.filename = "/usr/local/apache2.4/htdocs/".. r.hostname .."/".. r.uri
end
return apache2.DECLINED
end
夜の19時から24時は
function golden_balancer(r) サーバ分散する処理
ctime = os.date("%H")
if ctime > 19 then
if math.random() < 0.5 then
r.headers_out["Location"] = "http://server2.example.com/".. r.uri
return apache2.HTTP_MOVED_TEMPORARILY
end
else
return apache2.DECLINED
end
end
16. require "apache2"
load_limit = 2
LoadAvgを取得
function get_load()
file = io.open('/proc/loadavg', 'r')
state = file:read('*a')
file:close()
cload = string.match(state, '(%d+¥.%d+)%s+.*')
return cload
end
function load_checker(r)
if string.match(r.filename, "^.*¥.php$") then
LoadAvgを比較
cload = tonumber(get_load())
if cload > load_limit then
r:warn(r.filename .. “is CGI. current load(”.. cload ..“) is highter than load_limit(".. load_limi
r:puts("Sorry. loadavg high!")
return 503
else
r:debug(r.filename .. "is CGI. current load(".. cload ..") is lower than load_limit(".. load_lim
end
end
return apache2.OK
end 900行が30行くらいに