-
Notifications
You must be signed in to change notification settings - Fork 56
REFACTOR: refactor config file support for server configuration #934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
e3f1fad to
8e7a0ae
Compare
8e7a0ae to
6612bae
Compare
6612bae to
e78830a
Compare
fcbee46 to
59f4850
Compare
48127cd to
98e554d
Compare
98e554d to
82a1c98
Compare
a532173 to
333add5
Compare
|
ํน์ ์ด๋ฒ PR๊ณผ ๋น๊ตํด๋ณผ ์ ์๋๋ก, try_load_config_file ํจ์๋ฅผ ๋ฐ๋ก ๋ถ๋ฆฌํ์ง ์๊ณ ๋ก์ง์ main์ ์ง์ ๊ตฌํํ ๊ฒฝ์ฐ๋ ํ ๋ฒ ๋ง๋ค์ด ๋ณผ ์ ์์๊น์? |
333add5 to
6672ac3
Compare
|
ํ์ฌ ์ปค๋ฐ์ ๋ฐ๋ก ํจ์๋ฅผ ๋ถ๋ฆฌํ์ง ์๊ณ , main๋ด์ ๋ชจ๋ ์ฝ๋๋ฅผ ๋ฃ์ ๊ตฌ์กฐ์
๋๋ค. |
6672ac3 to
9dd4cc4
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
5761bf0 to
73b5bb1
Compare
73b5bb1 to
6e8ad2d
Compare
|
@namsic |
jhpark816
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฆฌ๋ทฐ ์๋ฃ
|
@namsic ๋ฆฌ๋ทฐ ๋ฐ๋๋๋ค. |
namsic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ PR์ ๊ธฐ์กด ๋ช ๋ นํ ์ต์ ์ ๊ทธ๋๋ก ์ค์ ํ์ผ ํํ๋ก ์ ๊ณตํ๋ ๋ฐ ์ง์คํ๊ณ ์์ต๋๋ค.
์ค์ ํ์ผ์์๋ ๋ช
๋ นํ ์ต์
์ ๋นํด ์๋์ ์ผ๋ก ๊ตฌ์กฐ์ ์ธ ํํ๋ฅผ ํํํ๊ธฐ๊ฐ ์ฉ์ดํ๋ฏ๋ก
์ฅ๊ธฐ์ ์ธ ๊ด์ ์์ ์ค์ ํ์ผ ๊ตฌ์กฐ์ ๋ํ ๋ช ๊ฐ์ง ์๊ฐ๋๋ ๋ฐฉ์์ ๊ณต์ ํฉ๋๋ค.
(์๋์ ๊ฐ์ ์ค๊ณ ๋ฐฉ์์ด ๊ผญ ์ข๋ค๋ ๊ฒ์ ์๋๋๋ค.)
engine ๊ด๋ จ ์ค์
- AS-IS: ์๋์ ๊ฐ์ด -e option์ด ๊ทธ๋๋ก ๋งคํ๋๊ณ ์์
engine_config=data_path=/tmp/data,log_path=/tmp/log - TO-BE: engine config์ ๋ฐ๋ก ์ ๋ ฅํ ์ ์๋๋ก ๋ณ๊ฒฝ
# [ core ]
port=11211
username=jam2in
# [ engine ]
maxbyte=100
engine_data_path=/tmp/data
engine_log_path=/tmp/log
# [ replication ]
โฆ
# [ migration ]
โฆextension ๊ด๋ จ ์ค์
- AS-IS:
extensionN=/xxx.so์ ๋ ฅ ์ ํ์ฑํ - TO-BE:
enable์ค์ ์ฌ์ฉ + extension ์ ์ฉ ์ค์ ์ถ๊ฐ ๊ฐ๋ฅ
# [ ascii_scrub ]
ext_ascii_scrub_enable=true # default=false
# false์ด๋ฉด ์๋ ๋ชจ๋ ext_ascii_scrub_xxx ์ค์ ์ ๋ฌด์
ext_ascii_scrub_path=/tmp/ascii_scrub.so # default=(empty)
# empty์ด๋ฉด ๊ธฐ๋ณธ ํ์ ๊ฒฝ๋ก(system path)์์ ํ์
ext_ascii_scrub_xxx=... # ๊ธฐํ extension์์ ์ฌ์ฉํ๊ธฐ ์ํ ์ค์ ๋ค
๊ธฐํ
vervose=1๋์log_level=info์ ๊ฐ์ด ์ ๋ ฅ ๊ฐ๋ฅํ๋๋ก ๋ณ๊ฒฝ
|
engine ๋ฐ extension์ ๋ด๋ถ ์ค์ ๊น์ง ํ์ฌ PR์ ์ค์ ํ์ผ๋ก ์ ์ดํ์๋ ์๊ฒฌ์ผ๋ก ๋ณด์ ๋๋ค. ๋ค๋ง ์ด ๊ธฐ๋ฅ์ ์ถํ ํ์ฅ ํฌ์ธํธ๋ก ๊ณ ๋ คํ ์๋ ์์ผ๋, ํ์ฌ ๋จ๊ณ์์ ํฌํจํด์ผ ํ๋ ์์๋ ์๋๋ผ๋ ์๊ฐ์ ๋๋ค.
ํ์ฌ ์์ง ํ์ (default, gust, squall ๋ฑ)๋ง๋ค ๋ค๋ฅธ ์ค์ ์ธ์๋ฅผ ๊ฐ๊ณ ์๋ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค. ๋ชจ๋ ์์ง ํ์ ์ ์ธ์๋ฅผ ์ค์ ํ์ผ์์ ์ผ๊ด์ ์ผ๋ก ์ง์ํ๋ ๋ฐฉ์๋ณด๋ค๋ ์คํ๋ ค ์ค์ ํ์ผ์ ์์ง๋ณ๋ก ๋ถ๋ฆฌํ๊ณ ๊ฒฝ๋ก๋ง ์ง์ ํ๋ ์ง๊ธ์ ํํ๊ฐ ๋ ์์ฐ์ค๋ฌ์ด ํํ๋ผ ์๊ฐ๋ฉ๋๋ค.
extension์ ๊ฒฝ์ฐ ascii_scrub, syslog_logger ๋ฑ ๊ธฐ๋ณธ์ ์ผ๋ก ์ ๊ณต๋๋ ํญ๋ชฉ์ด ์์ง๋ง, ์ฌ์ฉ์๊ฐ ์ง์ ์ปค์คํ extension์ ๊ตฌํํ์ฌ ์ถ๊ฐํ๋ ๊ฒ๋ ๊ฐ๋ฅํฉ๋๋ค. ์ด๋ฌํ ํ์ฅ์ฑ์ ๊ณ ๋ คํ ๋, ์ค์ ํ์ผ์์ ํน์ extension๋ง ์ฌ์ฉํ๋๋ก ์ ํํ๋ ๊ฒ์ ๋ฐ๋์งํ์ง ์์ ๋ณด์ ๋๋ค. |
jhpark816
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ผ๋ถ ๋ฆฌ๋ทฐ
| { .key = "require_sasl", .datatype = DT_BOOL, .value.dt_bool = &settings.require_sasl }, | ||
| #endif | ||
| { .key = NULL } | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default ์ค์ ํ์ผ๋ ์ ์ ๋ฆฌํ์ฌ PR์ ์ฌ๋ ค์ฃผ์ธ์.
memcached.c
Outdated
| { .key = "zookeeper", .datatype = DT_STRING, .value.dt_string = (char**)&arcus_zk_cfg }, | ||
| { .key = "zk_timeout", .datatype = DT_UINT32, .value.dt_uint32 = (uint32_t*)&arcus_zk_to }, | ||
| #ifdef PROXY_SUPPORT | ||
| { .key = "proxy_config", .datatype = DT_STRING, .value.dt_string = &arcus_proxy_cfg }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ผ๋ถ ์ค์ ์ settings์ ์๊ณ , ๋ค๋ฅธ ์ค์ ์ ๋ณ๋์ ๋ณ์๋ก ๋ฐ๊ณ ์๋ ๋ฐ์.
settings์ ๋ชจ๋ ์ถ๊ฐํ๋ ๊ฒ์ด ๋์ ๋ฐฉํฅ์ธ๊ฐ์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ์ญ ์ค์ ์ผ๋ก ํตํฉํ๋๊ฒ ๋ ๊น๋ํ ๊ตฌ์กฐ์ผ ์ ์์ผ๋, ๊ธฐ์กด ๋ก์ง์ ๋ณ๊ฒฝ์ ๋ ๋ง์์ง๊ฑฐ๋ผ ์๊ฐํฉ๋๋ค.
settings์ ๋ณ์๋ฅผ ์ ๋ฆฌํ๋ ์ด์๋ฅผ ๋ณ๋๋ก ์งํํ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
2e06180 to
d70546f
Compare
d70546f to
6718ac1
Compare
6718ac1 to
e7f8dd2
Compare
ing-eoking
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฌ๊ธฐ ์ฝ๋๋ฅผ ๋ณ๋ ํจ์๋ก ๋ถ๋ฆฌํ๋ ๊ฒ์ด ์ข๊ฒ ์ต๋๋ค.
ํ์ฌ config ํ์ผ ์ค์ ์ ๋ชจ๋/ํจ์ํํ๋ฉด ๋น๊ต์ ๊น๋ํ์ง ์์ ํํ์ธ ๊ฒ ๊ฐ์ต๋๋ค.
ํ์ PR๋ก main ํจ์์ ๋ก์ปฌ ๋ณ์๋ค์ settings๋ก ์ด๋ํ๊ณ , ๋ชจ๋/ํจ์ํํ๋ ๋ฐฉํฅ์ ์ด๋ค๊ฐ์?
arcus.conf
Outdated
| # udpport=0 | ||
|
|
||
| # The IP address of the network interface to listen on. | ||
| # 0.0.0.0 means listen on all available interfaces (INADDR_ANY). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default๊ฐ INADDR_ANY์์ ํฌํจ
arcus.conf
Outdated
| # Adjusting this value also adjusts the slab page size. | ||
| item_size_max=1m | ||
|
|
||
| # Action to take when memory is exhausted. (Default: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ค๋ช ์ด ๋ฐ๋๋ก ๋ ๊ฒ ๊ฐ์ต๋๋ค. Default ๊ฐ์ true ์ด๋ฉฐ, eviction์ด false์ด๋ฉด ์์ดํ ์ด ๊ฐ๋ ์ฐจ๋ฉด ์๋ฌ๋ฅผ ๋ฐํํฉ๋๋ค.
arcus.conf
Outdated
| # Recommended value: > 10 and < 20000 (check internal implementation limits). | ||
| # zk_timeout=3000 | ||
|
|
||
| # Proxy configuration (if compiled with proxy support) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด๋ proxy support๋ ๋น๋ ๊ณผ์ ์์ ํฌํจ๋๋ ์ต์
์ ์๋๋ฏ๋ก if complied with proxy support ์ค๋ช
์ ์ ๊ฑฐํด๋ ๋ฉ๋๋ค.
arcus.conf
Outdated
| # These options control the behavior of the Arcus storage engine, | ||
| # including Collection features (List, Set, Map, B+Tree). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ์ฃผ์์ ์ ๊ฑฐํด๋ ๋ ๊ฒ ๊ฐ์ต๋๋ค.
arcus.conf
Outdated
| prefix_delimiter=: | ||
|
|
||
| # Enable detailed stats collection. (Default: false) | ||
| # Automatically enabled if 'prefix_delimiter' is set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ์ฃผ์์ ์ ๊ฑฐํด์ผ ํฉ๋๋ค.
arcus.conf
Outdated
| # pid_file=/var/run/memcached.pid | ||
|
|
||
| # Verbose logging level. (Default: 3) | ||
| # 0 = Detail, 1 = Debug, 2 = Info, 3 = Warning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฌ๊ธฐ์ verbosity ๊ฐ์ ๋ฐ๋์
๋๋ค.
0 = Warning, 1 = Info, 2 = Debug, 3 = Detail
arcus.conf
Outdated
| verbosity=3 | ||
|
|
||
| # Limit the size of the core file. (Default: 0) | ||
| # Used for debugging purposes to allow core dumps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"ํด๋น ๊ฐ์ 0(false) ๋๋ 1(true)์ ๊ฐ์ ๊ฐ์ง๋ค." ๋ผ๋ ์๋ฏธ๋ฅผ ๋ฃ์ผ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
arcus.conf
Outdated
| # zk_timeout=3000 | ||
|
|
||
| # Proxy configuration (if compiled with proxy support) | ||
| # proxy_config=... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์์๋ ip:port ํ์์ด๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
ing-eoking
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ทธ๋ฃน์ ๋ฐ๋ผ ๋ถ๋ฅ๋๋ ํํ๋ก ๋ณ๊ฒฝ์ด ๊ฐ๋ฅํ ๊น์?
์๋ฅผ ๋ค์ด Network ๊ด๋ จ ์ค์ ๋ถ๋ถ๋ผ๋ฆฌ ๋ถ๋ฅํ๊ณ ๋ชจ์๋๋ ํํ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
arcus.conf
Outdated
| # Recommended value: > 10 and < 20000 (check internal implementation limits). | ||
| # zk_timeout=3000 | ||
|
|
||
| # Proxy configuration (if compiled with proxy support) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํด๋น ๋ถ๋ถ๋ Zookeeper Support ์ ๊ฐ๋ฅํ ๊ฑธ๋ก ๋ด์ฉ์ ๋ณ๊ฒฝํ๋ ํธ์ด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
arcus.conf
Outdated
| memory_limit=64M | ||
|
|
||
| # Maximum size of a single item. (Default: 1m) | ||
| # Supports K and M suffixes. Min: 1k, Max: 128m. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ๋ถ๋ถ๋ kmgt ๋ชจ๋ ์ง์ํ๋ฏ๋ก ์ ์ธํด๋ ๋ฉ๋๋ค. ์ต๋ ์ต์ ์ค๋ช ๋ง ๋ฃ์ด๋ ์ถฉ๋ถํ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค.
arcus.conf
Outdated
| # extension1=/usr/local/lib/logger.so | ||
| # extension2=/usr/local/lib/management.so | ||
|
|
||
| # Settings required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํด๋น ์ค ์ ๊ฑฐ
arcus.conf
Outdated
|
|
||
| # Chunk size growth factor between slab classes. (Default: 1.25) | ||
| # Controls the size increase of chunks in subsequent slab classes. | ||
| factor=1.25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1๋ณด๋ค ํฐ ๊ฐ์ ๊ฐ์ ธ์ผ ํ๋ค๋ ์ค๋ช ์ด ์์ผ๋ฉด ์ข๊ฒ ์ต๋๋ค.
|
|
||
| if (settings.verbose > 0) { | ||
| perform_callbacks(ON_LOG_LEVEL, NULL, NULL); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sticky limit์ด 0๋ณด๋ค ํฌ๋ฉด 1024 * 1024๋ฅผ ๊ณฑํ๋ ๊ฒ๋ ํ์ํ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค.
arcus.conf
Outdated
|
|
||
| # Assume the identity of <username> (drops root privileges). | ||
| # Effectively switches the user after starting. | ||
| # username=nobody |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์์๋ root๋ก ํ๋๊ฒ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
|
์๋ ๊ตฌ์กฐ๋ก ๋ถ๋ฅํ๊ณ์ต๋๋ค. ๊ตฌ์กฐ๋ฅผ ๋ณ๊ฒฝํ๊ณ ์ถ์ผ์ ์ต์ ์ด ์๋ค๋ฉด ๋ง์ํด์ฃผ์ธ์.
|
e7f8dd2 to
84b3b4c
Compare
|
|
84b3b4c to
913dfbb
Compare
๐ Related Issue
โจ๏ธ What I did
๊ธฐ์กด์ engine ์ค์ ๋ง ๊ฐ๋ฅํ๋ config file ์ค์ ๊ธฐ๋ฅ์ ํ์ฅํ์ฌ, engine์ธ์ ๋ค๋ฅธ ์ค์ ๋ ํ์ผ ํํ๋ก ๊ฐ๋ฅํ๊ฒ ํ๋๋ก ํฉ๋๋ค.
(
-e config_file=/config_file1.conf)(๋๋ถ๋ถ์ ํ๋ก๊ทธ๋จ์์ ์ฐจ์ฉํ๋ ๋ฐฉ์)
main()์คํ์, ๊ตฌ๋์ต์ ์ ํ์ธํ๊ธฐ ์ ์ ์ฒซ๋ฒ์งธ ์ธ์๋ฅผ config file๊ฒฝ๋ก๋ฅผ ์ธ์ํ๋๋ก ๊ธฐ๋ฅ์ ํ์ฅํฉ๋๋ค.try_load_config_file()์ ๊ตฌํํ์ฌ,.confํ์ผ์ ๋ผ์ธ ๋จ์๋ก ์ฝ์ด์ ๋ชจ๋ ๊ฐ์ ์ค์ ํฉ๋๋ค.getopt์optind๋ฅผ ๋์ ์ผ๋ก ์กฐ์ ํ์ฌ config file๊ณผ ๊ตฌ๋์ต์ ์ ํผ์ฉํ ๋, ๊ตฌ๋ ์ต์ ๊ฐ์ด ๋ฎ์ด์์ด์ง๋๋ก ํฉ๋๋ค.https://github.com/jam2in/arcus-works/issues/808 ๋ฅผ ํตํ
old_opts์ค๋ณต ํด๊ฒฐgetopt(๊ตฌ๋์ต์ ๊ฐ ์ค์ )๋ฃจํ ๋ด์์settings์ ์ญ ๊ตฌ์กฐ์ฒด์old_opts๋ฌธ์์ด ์์ฑ์ ๋์์ ์ํํ๊ธฐ์, config file๊ณผ ๊ตฌ๋์ต์ ์ ๋์์ ์ํํ๋ฉดold_opts์ ์ค๋ณต๋ ๊ฐ์ด ๋ค์ด๊ฐ์ต๋๋ค.settings์ ์ญ ๊ตฌ์กฐ์ฒด๋ง ์ ๋ฐ์ดํธ๋ฅผ ์ํํ๊ณ , ํ์ฑ์ดํ์old_opts๋ฌธ์์ด์ ์์ฑํ๋๋ก ํ์ต๋๋ค.