Resolving Log Retention and Login Issues in Clickhouse

TLDR duuZ faced issues with log retention and login in Clickhouse. nitya-signoz provided solutions for log cleanup, PVC increase, and running one replica of the query service.

Photo of duuZ
duuZ
Wed, 01 Mar 2023 04:30:49 UTC

Hi team, One quick question is there a way to implement retention of logs data via helm chart and not fromt the UI, or do we have a way to clear that vial clickhouse command?

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 04:40:16 UTC

As of now, it’s not possible via the helm chart. What do you mean by `or do we have a way to clear that vial clickhouse command` ? do you want to remove ttl?

Photo of duuZ
duuZ
Wed, 01 Mar 2023 04:59:19 UTC

actually, my pvc is full and it cannot be increased as its limit is reached. Whole signoz system is stuck because DB is not responding because of the disk issue. So if i clear the logs i think i can login from the UI

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 05:01:04 UTC

If you are able to exec into clickhouse then try deleting the data ```kubectl exec -n platform -it chi-my-release-clickhouse-cluster-0-0-0 -- sh clickhouse client use signoz_logs; truncate table signoz_logs.logs;```

Photo of duuZ
duuZ
Wed, 01 Mar 2023 05:02:12 UTC

okay thanks, logs will be created automatically in the next run

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 05:02:43 UTC

yeah, once you are done cleaning up, do set up retention period from the UI.

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 05:03:39 UTC

You can also push your data to s3 for cold storage

Photo of duuZ
duuZ
Wed, 01 Mar 2023 06:21:05 UTC

nitya-signoz Actually it didnt help, im not able to login to signoz with admin account it says user does not exists. Can you help

Photo of duuZ
duuZ
Wed, 01 Mar 2023 06:22:28 UTC

i enable the s3 cold storage and in the middle of everything i believe because my data is huge it stuck again, Now im not able to login from admin account. Do you know in which table we are storing these user details

Photo of duuZ
duuZ
Wed, 01 Mar 2023 08:25:45 UTC

and anlso is there any way to refresh all the data like logs traces and metrices

Photo of duuZ
duuZ
Wed, 01 Mar 2023 13:39:29 UTC

hen i try with admin user it say account doesn't exists, but i can see all the user in the sqlite DB. When enabling s3 cold storage is there any migration scripts that we can run manually, just to make sure everything moved correctly, As i believe because the data is huge when i enable the s3 cold storage and somehow process stopped, it stopped the migration script. Any help guys..

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 14:37:21 UTC

<@4K15aa> any idea about the admin user issue?

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 14:38:32 UTC

You can’t move things manually to s3, it’s done by clickhouse internally. You can just check the current running process in clickhouse. you can check them by `SELECT query_id, query FROM system.processes;` It will show you if the ttl is applied or not

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 14:40:13 UTC

How much storage have you allocated to clickhouse and how much data are you ingesting ?

Photo of duuZ
duuZ
Wed, 01 Mar 2023 14:40:45 UTC

initially 200 gb

Photo of duuZ
duuZ
Wed, 01 Mar 2023 14:41:02 UTC

and the ingestion is around 300 GB i gues

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 14:41:22 UTC

Is it 300 GB per day?

Photo of duuZ
duuZ
Wed, 01 Mar 2023 14:42:06 UTC

no iniatilly we are dumping some data to test, daily 10-15 GB i guess

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 14:43:54 UTC

Okay just to clear out you are facing two issue • Not able to login • ClickHouse disk full right ?

Photo of duuZ
duuZ
Wed, 01 Mar 2023 14:45:07 UTC

yes not able to login, for clickhouse ive incresed the pvc to 500 with AWS support.

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 14:53:12 UTC

can do a huddle for the login issue

Photo of duuZ
duuZ
Wed, 01 Mar 2023 14:55:18 UTC

i think its working now, im able to login and able to see few items after increasing pvc

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 14:55:33 UTC

Cool that’s great.

Photo of duuZ
duuZ
Wed, 01 Mar 2023 14:56:00 UTC

also i truncate a table in signoz_traces, will it recreated in next run

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 14:56:28 UTC

To stop ingestion for somtime, you can stop the otel collector and the otel-collector metrics.

Photo of nitya-signoz
nitya-signoz
Wed, 01 Mar 2023 14:56:38 UTC

Then run truncate, also you can change TTL at this point of time and configure S3 as it will be fast.

Photo of duuZ
duuZ
Wed, 01 Mar 2023 14:57:09 UTC

yes that is what i did yesterday. It is stopped for now.

Photo of duuZ
duuZ
Wed, 01 Mar 2023 15:27:33 UTC

As of now it look like something happened when i enabled s3 cold storage. sometimes im able to see things and sometime i'm getting authorization error while accessing the api's from frontend.

Photo of nitya-signoz
nitya-signoz
Thu, 02 Mar 2023 03:35:11 UTC

Can you check if any of the pods are restarting ?

Photo of duuZ
duuZ
Thu, 02 Mar 2023 06:05:58 UTC

no its not restarting, but i deployed the new setup and sometime im able to see thing and sometimes it logging me out

Photo of duuZ
duuZ
Thu, 02 Mar 2023 06:06:02 UTC

aby idea

Photo of duuZ
duuZ
Thu, 02 Mar 2023 06:21:21 UTC

looks like when we are running the setup with replica count 2, with some calls it gives 403

Photo of nitya-signoz
nitya-signoz
Thu, 02 Mar 2023 06:34:17 UTC

ahh as of now you will have to run one replica of query service

Photo of duuZ
duuZ
Thu, 02 Mar 2023 06:34:47 UTC

yes did the same and it works, thanks