Jave-Chen commented on a change in pull request #90: redesign and rewrite 
deployment document
URL: 
https://github.com/apache/incubator-dolphinscheduler-website/pull/90#discussion_r383610515
 
 

 ##########
 File path: docs/zh-cn/1.2.0/user_doc/standalone-deployment.md
 ##########
 @@ -0,0 +1,451 @@
+# 单机部署(Standalone)
+
+DolphinScheduler单机部署分为后端部署和前端部署两部分:
+
+# 1、后端部署
+
+### 1.1 : 基础软件安装(必装项请自行安装)
+
+ * PostgreSQL (8.2.15+) or Mysql (5.6或者5.7系列)  :  两者任选其一即可
+ * [JDK](https://www.oracle.com/technetwork/java/javase/downloads/index.html) 
(1.8+) :  必装,请安装好后在/etc/profile下配置 JAVA_HOME 及 PATH 变量
+ * ZooKeeper (3.4.6+) :必装 
+ * Hadoop (2.6+) or MinIO :选装, 
如果需要用到资源上传功能,针对单机可以选择本地文件目录作为上传文件夹(此操作不需要部署Hadoop);当然也可以选择上传到Hadoop or MinIO集群上
+
+```markdown
+ 注意:DolphinScheduler本身不依赖Hadoop、Hive、Spark,仅是会调用他们的Client,用于对应任务的运行。
+```
+
+### 1.2 : 下载后端tar.gz包
+
+- 请下载最新版本的后端安装包至服务器部署目录,比如创建 /opt/dolphinscheduler 做为安装部署目录,下载地址: 
[下载](https://dolphinscheduler.apache.org/zh-cn/docs/release/download.html) 
(以1.2.0版本为例),下载后上传tar包到该目录中,并进行解压
+
+```shell
+# 创建部署目录
+mkdir -p /opt/dolphinscheduler;
+cd /opt/dolphinscheduler;
+# 解压缩
+tar -zxvf 
apache-dolphinscheduler-incubating-1.2.0-dolphinscheduler-backend-bin.tar.gz -C 
/opt/dolphinscheduler;
+ 
+mv apache-dolphinscheduler-incubating-1.2.0-dolphinscheduler-backend-bin  
dolphinscheduler-backend
+```
+
+###1.3:创建部署用户并赋予目录操作权限
+
+- 创建部署用户,并且一定要配置sudo免密。以创建dolphinscheduler用户为例
+
+```shell
+# add user dolphinscheduler
+useradd dolphinscheduler;
+
+# modify user password
+echo "dolphinscheduler" | passwd --stdin dolphinscheduler
+
+# 配置sudo免密
+sed -i '$adolphinscheduler  ALL=(ALL)  NOPASSWD: NOPASSWD: ALL' /etc/sudoers
+
+# 修改目录权限,使得部署用户对dolphinscheduler-backend目录有操作权限  
+chown -R dolphinscheduler:dolphinscheduler dolphinscheduler-backend
+```
+
+```
+ 注意:
+ - 因为任务执行服务是以 sudo -u {linux-user} 切换不同linux用户的方式来实现多租户运行作业,所以部署用户需要有 sudo 
权限,而且是免密的。初学习者不理解的话,完全可以暂时忽略这一点
+ - 如果发现/etc/sudoers文件中有"Default requiretty"这行,也请注释掉
+ - 如果用到资源上传的话,还需要给该部署用户分配操作`本地文件系统或者HDFS或者MinIO`的权限
+```
+
+### 1.4 : ssh免密配置
+
+- 切换到部署用户并配置ssh本机免密登录
+
+```shell
+su dolphinscheduler;
+
+ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
+cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+chmod 600 ~/.ssh/authorized_keys
+```
+注意:*正常设置后,dolphinscheduler用户在执行命令`ssh localhost` 是不需要再输入密码的*
+
+### 1.5 : 数据库初始化
+
+- 
进入数据库,默认数据库是PostgreSQL,如选择Mysql的话,后续需要添加mysql-connector-java驱动包到DolphinScheduler的lib目录下
+``` 
+mysql -uroot -p
+```
+
+- 进入数据库命令行窗口后,执行数据库初始化命令,设置访问账号和密码。**注: {user} 和 {password} 
需要替换为具体的数据库用户名和密码** 
+
+``` mysql
+mysql> CREATE DATABASE dolphinscheduler DEFAULT CHARACTER SET utf8 DEFAULT 
COLLATE utf8_general_ci;
+mysql> GRANT ALL PRIVILEGES ON dolphinscheduler.* TO '{user}'@'%' IDENTIFIED 
BY '{password}';
+mysql> GRANT ALL PRIVILEGES ON dolphinscheduler.* TO '{user}'@'localhost' 
IDENTIFIED BY '{password}';
+mysql> flush privileges;
+```
+
+
+- 创建表和导入基础数据
+
+    - 修改 conf 目录下 application-dao.properties 中的下列配置 
+
+      - ```shell
+        vi conf/application-dao.properties 
+        ```
+
+    - 如果选择 Mysql,请注释掉 PostgreSQL 相关配置(反之同理), 还需要手动添加 [[ mysql-connector-java 
驱动 jar ](https://downloads.mysql.com/archives/c-j/)] 包到 lib 
目录下,这里下载的是mysql-connector-java-5.1.47.jar,然后正确配置数据库连接相关信息
+    ```properties
+      # postgre
+      #spring.datasource.driver-class-name=org.postgresql.Driver
+      #spring.datasource.url=jdbc:postgresql://localhost:5432/dolphinscheduler
+      # mysql
+      spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+      
spring.datasource.url=jdbc:mysql://xxx:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8
     需要修改ip,本机localhost即可
+      spring.datasource.username=xxx                                           
需要修改为上面的{user}值
+      spring.datasource.password=xxx                                           
需要修改为上面的{password}值
+    ```
+
+    - 修改并保存完后,执行 script 目录下的创建表及导入基础数据脚本
+
+    ```shell
+    sh script/create-dolphinscheduler.sh
+    ```
+
+​       *注意: 如果执行上述脚本报 ”/bin/java: No such file or directory“ 
错误,请在/etc/profile下配置  JAVA_HOME 及 PATH 变量*
+
+### 1.6 : 修改运行参数
+
+- 修改 conf/env 目录下的 `.dolphinscheduler_env.sh` 环境变量(以相关用到的软件都安装在/opt/soft下为例)
+
+    ```shell
+    export HADOOP_HOME=/opt/soft/hadoop
+    export HADOOP_CONF_DIR=/opt/soft/hadoop/etc/hadoop
+    #export SPARK_HOME1=/opt/soft/spark1
+    export SPARK_HOME2=/opt/soft/spark2
+    export PYTHON_HOME=/opt/soft/python
+    export JAVA_HOME=/opt/soft/java
+    export HIVE_HOME=/opt/soft/hive
+    export FLINK_HOME=/opt/soft/flink
+    export 
PATH=$HADOOP_HOME/bin:$SPARK_HOME2/bin:$PYTHON_HOME:$JAVA_HOME/bin:$HIVE_HOME/bin:$PATH:$FLINK_HOME/bin:$PATH
+    
+    ```
+
 
 Review comment:
   if you can't find .dolphinscheduler_env.sh, run ls -a

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to