Skip to content
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

feat: support log volume binding #349

Merged
merged 5 commits into from
Jan 28, 2021
Merged

feat: support log volume binding #349

merged 5 commits into from
Jan 28, 2021

Conversation

mahjonp
Copy link
Contributor

@mahjonp mahjonp commented Jan 27, 2021

Signed-off-by: mahjonp [email protected]

What is changed and how does it work?

Since the TiDB-Operator has supported mounting PV into containers, this PR updates recommend TiDB ops configuration with a log PV binding with TiDB container and save all main component log into PVs.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Code changes

  • Has Go code change

Side effects

  • Breaking backward compatibility

Related changes

  • Need to update the documentation

Does this PR introduce a user-facing change?:

NONE

@mahjonp mahjonp marked this pull request as ready for review January 27, 2021 09:22
@mahjonp mahjonp requested a review from cosven January 27, 2021 09:22
@@ -74,7 +74,8 @@ then
fi
echo "start tidb-server ..."
echo "/tidb-server ${ARGS}"
exec /tidb-server ${ARGS}
/tidb-server ${ARGS} 2>&1 | tee -a /var/log/tidblog/tidb.log
# ^^: append mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about set log-file to /var/log/tidblog/tidb.log in config file?

Pros:

  • It will auto rotate log
  • configurable
  • daily run case are controlled by admin, we can ensure that these cases use correct config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's troubling to me, I need such a tool to help me:

  1. run the tikv-server in the background
  2. log tail tikv.log to stdout
  3. exit with the exit-code when tikv-server exits

Copy link
Contributor Author

@mahjonp mahjonp Jan 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve in 448bc24.

The solution here is that I let tail -F running in the background but let it output to stdout, and run tikv-server...

@mahjonp
Copy link
Contributor Author

mahjonp commented Jan 28, 2021

Resolve the log store and avoid loss issue that has recorded in #321

@cosven
Copy link
Contributor

cosven commented Jan 28, 2021

LGTM
cc @ofey404

@mahjonp mahjonp merged commit 4fb5352 into master Jan 28, 2021
@mahjonp mahjonp deleted the log_bind_volume branch January 28, 2021 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants