المراقبة والتسجيل في Neo4j
تعلّم كيفية مراقبة مثيل Neo4j قيد التشغيل، وقراءة سجلاته، وتتبع مقاييس الاستعلامات والموارد لإدارته بصورة سليمة.
المراقبة والتسجيل في Neo4j درس مجاني في Neo4j Graph Database Fundamentals على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Neo4j Graph Database Fundamentals، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Neo4j Graph Database Fundamentals 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Why Monitoring Matters
A production graph database must stay healthy. Monitoring tells you about slow queries, memory pressure, and failed transactions before users notice.
Neo4j Log Files
Neo4j writes several logs in the logs/ directory:
neo4j.log— general outputdebug.log— detailed diagnosticsquery.log— executed queries
Enabling Query Logging
Turn on query logging in neo4j.conf to capture every query and its duration. This is invaluable for spotting slow patterns.
dbms.logs.query.enabled=INFO
dbms.logs.query.threshold=1s
dbms.logs.query.parameter_logging_enabled=trueListing Running Queries
Use SHOW TRANSACTIONS to see what is executing right now, including how long each has been running.
SHOW TRANSACTIONS
YIELD transactionId, currentQuery, elapsedTime
RETURN transactionId, currentQuery, elapsedTime;Killing a Stuck Query
If a query runs away, terminate it by its transaction id to free resources.
TERMINATE TRANSACTIONS 'neo4j-transaction-123';Database Metrics
Neo4j exposes metrics like transaction rate, page cache hit ratio, and heap usage. These can be exported to monitoring systems.
- Page cache hit ratio should stay high
- Watch heap and GC pauses
Exporting to Prometheus
Enable the Prometheus endpoint in config so external dashboards (like Grafana) can scrape Neo4j metrics.
metrics.prometheus.enabled=true
metrics.prometheus.endpoint=localhost:2004Inspecting Store Sizes
Track how large your stores grow. SHOW DATABASES and store files reveal node, relationship, and property counts over time.
MATCH (n) RETURN count(n) AS nodeCount;
MATCH ()-[r]->() RETURN count(r) AS relCount;Page Cache Tuning
The page cache keeps graph data in memory. If your dataset fits in cache, reads are very fast. Monitor the hit ratio to size it correctly.
dbms.memory.pagecache.size=4gAlerting on Problems
Set alerts for: low cache hit ratio, long GC pauses, sustained high transaction failures, and disk filling up. Catch issues early.
Routine Health Checks
A healthy admin routine: review query.log weekly, watch metrics dashboards daily, and verify backups regularly.
Quick Check
Test your monitoring knowledge.
Recap
You learned to monitor Neo4j:
- Read neo4j.log, debug.log, and query.log
- Enable query logging with thresholds
- Inspect and terminate transactions
- Export metrics to Prometheus/Grafana
- Tune and watch the page cache
الأسئلة الشائعة
هل درس «المراقبة والتسجيل في Neo4j» مجاني؟
نعم — نص درس «المراقبة والتسجيل في Neo4j» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Neo4j Graph Database Fundamentals، انتقل إلى CoddyKit PRO. تتضمن دورة Neo4j Graph Database Fundamentals 4 دروس في المجموع.
ماذا ستتعلم في «المراقبة والتسجيل في Neo4j»؟
تعلّم كيفية مراقبة مثيل Neo4j قيد التشغيل، وقراءة سجلاته، وتتبع مقاييس الاستعلامات والموارد لإدارته بصورة سليمة. تتمرن على Neo4j Graph Database Fundamentals مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Neo4j Graph Database Fundamentals؟
لا تُشترط خبرة سابقة. Neo4j Graph Database Fundamentals على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «المراقبة والتسجيل في Neo4j»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Neo4j Graph Database Fundamentals هذا؟
نعم. كل درس في Neo4j Graph Database Fundamentals يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- أدوات Neo4j Browser والإدارة
- استيراد البيانات وتصديرها
- استراتيجيات النسخ الاحتياطي والاستعادة
- المراقبة والتسجيل في Neo4j