Run Apache Spark Jobs via Ilum UI
Running an Apache Spark job on Kubernetes with Ilum operates just like one submitted via شرارة تقديم ، ولكن مع تحسينات إضافية لسهولة الاستخدام والتكوين والتكامل مع الأدوات الخارجية.
يمكنك استخدام ملف jar مع أمثلة شرارة من هذا رابط .
Interactive Spark Job Submission Guide
فيما يلي دليل تفصيلي لإعداد وظيفة Spark بسيطة باستخدام Ilum. سيرشدك هذا الدليل خلال تكوين وتنفيذ ومراقبة وظيفة أساسية تسمى MiniReadWriteTest داخل منصة Ilum.
Step-by-Step Tutorial: Running Your First Spark Job
-
انتقل إلى قسم الوظائف: تتيح لك هذه المنطقة إدارة جميع مهام معالجة البيانات الخاصة بك.
-
إنشاء وظيفة جديدة:
- Click on the ‘New Job +’ button to start the setup process.
-
املأ تفاصيل الوظيفة:
-
علامة التبويب عام:
- اسم: دخل
MiniReadWriteTest - Job Type: Select
Spark Job - فصل: دخل
org.apache.spark.examples.MiniReadWriteTest - Language: Select
سكالا
- اسم: دخل
-
Configuration Tab:
- Arguments:دخل
/opt/spark/examples/src/main/resources/kv1.txt
This path specifies a local file to be distributed to executors, a test file available in every Spark environment.
- Arguments:دخل
-
علامة تبويب الموارد:
- Jars: Upload the JAR file from this رابط
-
Memory Tab:
- Leave all settings at their default values for this example.
-
-
إرسال ومراقبة الوظيفة:
- أرسل الوظيفة.
- انتقل إلى قسم السجلات لمراجعة السجلات من كل منفذ.
- You should see log output showing the job execution, including:
- Spark initialization messages (
SparkContext: Running Spark version 3.5.7) - File reading and word count operations (
Performing local word count from /opt/spark/examples/src/main/resources/kv1.txt) - Task execution across executors (
Starting task 0.0 in stage 0.0) - Final success message (
Success! Local Word Count 500 and D Word Count 500 agree.)
- Spark initialization messages (
-
مراجعة تنفيذ الوظيفة:
- بمجرد بدء المهمة، تحقق من الحالة في قسم نظرة عامة على الوظيفة.
- راقب استخدام الذاكرة ومقاييس الأداء الأخرى في قسم المنفذين.
- راقب تقدم عملك خلال كل مرحلة على الجدول الزمني.
-
الانتهاء والمراجعة:
- عند الانتهاء ، يتم تسجيل تفاصيل المهمة ونتائجها في خادم محفوظات Spark.
- قم بزيارة قسم خادم المحفوظات لرؤية مهمتك المكتملة ومراجعة مراحل التنفيذ التفصيلية.
-
الخطوة الأخيرة:
- مبروك! لقد قمت بإعداد وتشغيل وظيفة MiniReadWriteTest الخاصة بك بنجاح في Ilum. لمزيد من المعلومات أو الدعم ، اتصل ب [البريد الإلكتروني محمي] .
To submit jobs programmatically instead of using the UI, see the Run Spark Job via REST API guide.
Congratulations! You have successfully set up and run your MiniReadWriteTest job in Ilum. For further information or support, contact [البريد الإلكتروني محمي] .
باتباع هذه الخطوات ، ستتمكن من إعداد وظيفة Spark الأساسية وتشغيلها ومراقبتها بكفاءة داخل منصة Ilum ، واكتساب الإلمام بوظائفها وإعدادك لمهام معالجة البيانات الأكثر تعقيدا.
فيما يلي شرح موحد لكيفية تسهيل Ilum لعمليات تقديم وظائف Spark ، ومزج الميزات التقليدية ل شرارة تقديم مع قدرات الإدارة المتقدمة في Ilum:
تحميل مثال على الوظيفة
يوفر Ilum مثالا على وظيفة لمساعدة المستخدمين الجدد على البدء بسرعة.
مثال على تحميل المهام ممكن بشكل افتراضي. ومع ذلك ، يمكنك تعطيله باستخدام --set ilum-core.examples.job=false .
Why Ilum is a Better Alternative to spark-submit
-
التوافق العالمي: يتيح Ilum تقديم أي وظيفة Spark ، على غرار استخدام
شرارة تقديم. وهو يدعم لغات البرمجة المختلفة المستخدمة مع Spark ، بما في ذلك Scala و Python و R ، مما يلبي جميع عمليات Spark النموذجية مثل معالجة الدفعات أو مهام البث أو الاستعلامات التفاعلية. -
تنفيذ الأوامر المبسط: بينما
شرارة تقديمغالبا ما يتضمن مدخلات سطر أوامر معقدة لتبعيات المكتبة ومعلمات الوظيفة وتكوينات نظام المجموعة ، ويقوم Ilum بتلخصها في واجهة مستخدم سهلة الاستخدام. يقلل هذا النهج من مخاطر الخطأ ويبسط العمليات ، وهو مفيد بشكل خاص لأولئك الأقل دراية بتعقيدات سطر الأوامر. -
نشر التعليمات البرمجية المباشرة: يمكن للمستخدمين تحميل ملفات JAR أو البرامج النصية Python أو دفاتر الملاحظات مباشرة إلى Ilum ، على غرار تحديد الموارد في
شرارة تقديمأمر. يعزز Ilum ذلك من خلال السماح بتكوين هذه الموارد لعمليات التنفيذ المجدولة أو التي يتم تشغيلها بواسطة الأحداث، مما يوفر مرونة تشغيلية أكبر. -
المعالجة الآلية للبيئة: على عكس الإعداد اليدوي المطلوب مع
شرارة تقديم، تضمن Ilum إدارة جميع التبعيات والتكوينات تلقائيا. يضمن ذلك أن بيئة التنفيذ جاهزة باستمرار لتنفيذ المهام، سواء على المجموعات المحلية أو السحابة أو الإعدادات المختلطة. -
المراقبة والأدوات المتكاملة: يأتي Ilum مزودا بتكامل مدمج لأدوات المراقبة والتسجيل ، والتي في
شرارة تقديمسيتطلب سير العمل إعدادا إضافيا. يوفر هذا التكامل للمستخدمين حلولا جاهزة للاستخدام لتتبع أداء الوظيفة وإدارة السجلات والاتصال بخدمات البيانات الأخرى بسلاسة.
تجربة تقديم وظيفة محسنة
لا يطابق Ilum قدرات شرارة تقديم ولكنها تمتد لها عن طريق تقليل النفقات العامة المرتبطة بتكوين الوظيفة والإعداد البيئي. إنه يوفر نظاما أساسيا شاملا يبسط نشر وظائف Spark وإدارتها وتوسيع نطاقها ، مما يجعلها حلا مثاليا للمؤسسات التي تهدف إلى تحسين سير عمل معالجة البيانات دون المساس بقوة ومرونة Apache Spark.
Job Configuration Reference
- عام
- تكوين
- موارد
- ذاكرة
| Parameter | وصف |
|---|---|
اسم | A unique identifier for the job. This name is used in the dashboard and logs to track the job's execution and history. |
Job Type | The category of the job to be created. Select Spark Job for standard batch processing or Spark Connect Job for client-server Spark applications. |
عنقود | The target cluster where the job will be executed. Choose a cluster that has the necessary resources and data access for your job. |
فصل | The fully qualified class name of the application (e.g., org.apache.spark.examples.SparkPi) or the filename for Python scripts. This tells Spark which code to execute as the entry point. |
اللغة | The programming language used for the job. Select سكالا أو بايثون to match your application code. |
Max Retries | The maximum number of times Ilum will attempt to restart the job if it fails. Setting this helps ensure job completion in case of transient errors. |
| Parameter | وصف |
|---|---|
البارامترات | Key-value pairs for configuring Spark properties (e.g., spark.executor.instances). These settings allow you to fine-tune the Spark environment for this specific job. |
Arguments | Command-line arguments passed directly to the job's main method. Use these to provide dynamic inputs or configuration flags to your application logic. |
العلامات | Custom labels used to categorize and filter jobs in the UI. Tags are helpful for organizing jobs by project, team, or purpose (e.g., production, etl). |
| Parameter | وصف |
|---|---|
الجرار | Additional JAR files to be included in the classpath of the driver and executors. These are necessary if your job relies on external libraries not present in the base image. |
Files | Auxiliary files to be placed in the working directory of each executor. These are often used for configuration files or small datasets required by the job. |
PyFiles | Python dependencies such as .zip, .eggأو .py files. These are added to the PYTHONPATH to ensure Python jobs have access to required modules. |
المتطلبات | A list of additional Python packages to install on the nodes before execution. This ensures the runtime environment matches your development environment. |
Spark Packages | Maven coordinates for Spark JAR packages to be downloaded and included. This is a convenient way to include libraries from Maven Central without manually uploading JARs. |
| Parameter | وصف |
|---|---|
Executors | The number of executor instances to launch for this job. Increasing this number allows for greater parallelism and faster processing of large datasets. |
نوى السائق | The number of CPU cores allocated to the driver process. More cores can help the driver manage task scheduling and result collection more efficiently. |
النوى المنفذة | The number of CPU cores allocated to each executor. This determines the number of concurrent tasks each executor can handle. |
ذاكرة السائق | The amount of RAM allocated to the driver (e.g., 2g). Sufficient memory is required for the driver to maintain application state and handle large results. |
ذاكرة المنفذ | The amount of RAM allocated to each executor (e.g., 4g). This directly affects how much data can be cached and processed in memory on each node. |
التخصيص الديناميكي | Enables automatic scaling of the number of executors based on the current workload. This helps optimize resource usage by requesting more executors when needed and releasing them when idle. |
المنفذون الأوليون | The initial number of executors to start with when dynamic allocation is enabled. This provides a baseline capacity when the job starts. |
Minimal number of executors | The lower bound for the number of executors when dynamic allocation is enabled. The job will never scale below this number. |
Maximal number of executors | The upper bound for the number of executors when dynamic allocation is enabled. This prevents the job from consuming too many cluster resources. |