Ambari #06 การใช้งาน Zeppelin เพื่อเรียกข้อมูลจาก MySQL

ขั้นตอนการปรับแต่งให้ Zeppelin เชื่อมต่อกับ  MySQL
ในที่นี้ จะเชื่อมต่อไปยัง MySQL Server: ที่ your.mysql.server โดยมี Username/Password เป็น root/123456 และจะใช้ Database ชื่อ employees

  1. Download https://dev.mysql.com/downloads/connector/j/
    จากนั้นให้ Unzip จะได้ไฟล์ mysql-connector-java-5.1.44-bin.jar (Version อาจจะแตกต่างกัน)
    แล้วนำไปไว้ใน /usr/hdp/current/spark2-client/jars *** ของทุก Nodes ***
  2. จาก Ambari Web UI เลือก Zeppelin Notebook > Quick Links > Zeppelin UI
  3. ที่ Zeppelin UI ให้ Login ด้วย admin/admin
    แล้วคลิก Admin > Interpreter
  4. คลิก Create
    กรอกข้อมูลต่อไปนี้
    Interpreter Name: employees
    Interpreter Group: jdbcแล้วเพิ่ม
    default.driver:  com.mysql.jdbc.Driver
    default.url:       jdbc:mysql://your.mysql.server:3306/employees
    default.user: root
    default.password: 123456ในส่วนของ Dependency ให้กำหนด
    artifact: mysql:mysql-connector-java:5.1.44

    แล้วกดปุ่ม Save

  5. สร้าง Notebook ใหม่ ชื่อ mydatabase
    แล้วเลือก Default Interpreter เป็น employees
    แล้วคลิก Create Note
  6. จากนั้น ก็จะสามารถส่ง Query ต่างได้
  7. รวมถึง แสดง Graph ที่น่าสนใจได้

About The Author

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

nineteen − 11 =