分类 Linux 下的文章

ssh 无密码访问的问题

ssh 无密码登录失败

虚拟机 resize 需要配置计算节点之间 nova 用户无密码访问,但是在配置过程中有一台始终不能用密钥登录,对比了正常可以无密码登录的日志如下。

# 正常登录
debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /var/lib/nova/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
# 异常报错
debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /var/lib/nova/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /var/lib/nova/.ssh/id_dsa
debug3: no such identity: /var/lib/nova/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /var/lib/nova/.ssh/id_ecdsa
debug3: no such identity: /var/lib/nova/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /var/lib/nova/.ssh/id_ed25519
debug3: no such identity: /var/lib/nova/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

分析问题

  1. 找个一个类似报错的 CentOS SSH公钥登录问题 ,文中是由于seliunx导致的,我查看了本地的selinux发现已经关闭,不适用我的情况

  2. 使用 journalctl _COMM=sshd 命令查看日志,发现如下权限问题
May 10 17:11:11 compute01 sshd[26498]: pam_systemd(sshd:session): Failed to release session: Interrupted system call
May 10 17:11:11 compute01 sshd[26498]: pam_unix(sshd:session): session closed for user root
May 10 17:12:28 compute01 sshd[2297]: Authentication refused: bad ownership or modes for directory /var/lib/nova
May 10 17:13:09 compute01 sshd[2297]: Connection closed by 192.168.101.105 [preauth]
May 10 17:13:33 compute01 sshd[4103]: Authentication refused: bad ownership or modes for directory /var/lib/nova
May 10 17:25:21 compute01 sshd[23157]: Authentication refused: bad ownership or modes for directory /var/lib/nova
May 10 17:25:25 compute01 sshd[23157]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=compute02  user=nova
  1. 对比无问题主机的 /var/lib/nova 权限
正常主机
drwxr-xr-x   8 nova    nova     118 May 10 16:59 nova
异常主机
drwxrwxrwx. 11 nova           nova            4096 May 10 17:07 nova
  1. 解决办法
    修改 /var/lib/nova 目录权限为 755 后,可以正常无密码登录
# chmod -R 755 /var/lib/nova/

centos制作本地源

  1. 列出所有源

    # yum repolist
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirrors.aliyun.com
    * extras: mirrors.aliyun.com
    * updates: mirrors.aliyun.com
    repo id repo name status
    base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 9,363
    epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 11,135
    extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 263
    openstack-mitaka/7/x86_64 OpenStack Newton Repository 1,675
    openstack-newton/7/x86_64 OpenStack Newton Repository 1,486
    updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 807
    repolist: 24,729
  2. 同步源(以openstack-newton为例)

    # yum install yum-utils -y #安装同步工具
    # mkdir -p /opt/yum #同步目录
    # reposync -d -r openstack-newton -p /opt/yum/ #开始同步,其他参数可以查看help
  3. 创建本地源(生成元数据文件)

    # yum install createrepo -y #安装工具
    # createrepo -v /opt/yum/openstack-newton/
  4. 安装http服务,配置本地源
  • 安装apache服务并设置开机自启

    # yum install httpd -y
    # systemctl enable httpd.service
  • 修改http默认目录

    # vim /etc/httpd/conf/httpd.conf
    
    DocumentRoot "/opt/yum"  #修改此处
    #
    # Relax access to content within /var/www.
    #
    <Directory "/opt"> #修改此处
    AllowOverride None
    # Allow open access:
    Require all granted
    
    # Further relax access to the default document root:
    <Directory "/opt/yum/"> #修改此处
  • 重启httpd

    # systemctl restart httpd.service

解决lenove e450c安装centos7无线网卡(RTL8723BE)无法使用

1. 查询无线网卡型号

# /sbin/lspci | grep Network
04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter

2. 查找驱动

github上有个项目提供Realtek的无线网卡驱动 https://github.com/lwfinger/rtlwifi_new 但是编译报错,查询得知需要3.12以上内核,而centos7 自带的内核是3.10

3. 安装 elrepo.org 中的驱动

升级内核时,发现 elrepo.org 中提供 RTL8723BE 的驱动,下载安装,重启成功识别无线网卡

# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
# yum install kmod-rtl8723be.x86_64
# reboot

在centos7上安装和配置Kubernetes集群管理pods和services

一、安装前准备

1.操作系统详情

需要三台主机,都最小化安装 centos7.1,并update到最新,详情见如下表格

角色 主机名 IP
Master master 192.168.0.79
Minion1 minion-1 192.168.0.80
Minion2 minion-2 192.168.0.81

2.在每台主机上关闭firewalld改用iptables

输入以下命令,关闭firewalld

# systemctl stop firewalld.service    #停止firewall
# systemctl disable firewalld.service #禁止firewall开机启动

然后安装iptables并启用

# yum install -y iptables-services     #安装
# systemctl start iptables.service  #最后重启防火墙使配置生效
# systemctl enable iptables.service #设置防火墙开机启动

3.安装ntp服务

# yum install -y ntp
# systemctl start ntpd
# systemctl enable ntpd

二、安装配置

注:kubernetes,etcd等已经进去centos epel源,可以直接yum安装(需要安装epel-release)

1.安装Kubernetes Master

•  使用以下命令安装kubernetes 和 etcd

# yum install -y kubernetes etcd

•  编辑/etc/etcd/etcd.conf 使etcd监听所有的ip地址,确保下列行没有注释,并修改为下面的值

# vim /etc/etcd/etcd.conf
# [member]
ETCD_NAME=default
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
#[cluster]
ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379"

•  编辑Kubernetes API server的配置文件 /etc/kubernetes/apiserver,确保下列行没有被注释,并为下列的值

#  vim /etc/kubernetes/apiserver
###
# kubernetes system config
#
# The following values are used to configure the kube-apiserver
#

# The address on the local server to listen to.
KUBE_API_ADDRESS="--address=0.0.0.0"

# The port on the local server to listen on.
KUBE_API_PORT="--port=8080"

# Port minions listen on
KUBELET_PORT="--kubelet_port=10250"

# Comma separated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS="--etcd_servers=http://127.0.0.1:2379"

# Address range to use for services
KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"

# default admission control policies
KUBE_ADMISSION_CONTROL="--admission_control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"

# Add your own!
KUBE_API_ARGS=""

•  启动etcd, kube-apiserver, kube-controller-manager and kube-scheduler服务,并设置开机自启

# for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do 
    systemctl restart $SERVICES
    systemctl enable $SERVICES
    systemctl status $SERVICES 
done

•  在etcd中定义flannel network的配置,这些配置会被flannel service下发到minions:

# etcdctl mk /coreos.com/network/config '{"Network":"172.17.0.0/16"}'

• 添加iptables规则,允许相应的端口

iptables -I INPUT -p tcp --dport 2379 -j ACCEPT
iptables -I INPUT -p tcp --dport 10250 -j ACCEPT
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
iptables-save

•  查看节点信息(我们还没有配置节点信息,所以这里应该为空)

# kubectl get nodes
NAME             LABELS              STATUS

2. 安装Kubernetes Minions (Nodes)

注:下面这些步骤应该在minion1和minions2上执行(也可以添加更多的minions)

•  使用yum安装kubernetes 和 flannel

# yum install -y flannel kubernetes

•  为flannel service配置etcd服务器,编辑/etc/sysconfig/flanneld文件中的下列行以连接到master

# vim /etc/sysconfig/flanneld
FLANNEL_ETCD="http://192.168.0.79:2379"        #改为etcd服务器的ip

•  编辑/etc/kubernetes/config 中kubernetes的默认配置,确保KUBE_MASTER的值是连接到Kubernetes master API server:

# vim /etc/kubernetes/config
KUBE_MASTER="--master=http://192.168.0.79:8080"

•  编辑/etc/kubernetes/kubelet 如下行:

minion1:
# vim /etc/kubernetes/kubelet

KUBELET_ADDRESS="--address=0.0.0.0"
KUBELET_PORT="--port=10250"
KUBELET_HOSTNAME="--hostname_override=192.168.0.80"
KUBELET_API_SERVER="--api_servers=http://192.168.0.79:8080"
KUBELET_ARGS=""
minion2:
# vim /etc/kubernetes/kubelet

KUBELET_ADDRESS="--address=0.0.0.0"
KUBELET_PORT="--port=10250"
KUBELET_HOSTNAME="--hostname_override=192.168.0.81"
KUBELET_API_SERVER="--api_servers=http://192.168.0.79:8080"
KUBELET_ARGS=""

•  启动kube-proxy, kubelet, docker 和 flanneld services服务,并设置开机自启

# for SERVICES in kube-proxy kubelet docker flanneld; do 
    systemctl restart $SERVICES
    systemctl enable $SERVICES
    systemctl status $SERVICES 
done

•  在每个minion节点,你应当注意到你有两块新的网卡docker0 和 flannel0。你应该得到不同的ip地址范围在flannel0上,就像下面这样:

minion1:
# ip a | grep flannel | grep inet
    inet 172.17.29.0/16 scope global flannel0
minion2:
# ip a | grep flannel | grep inet
    inet 172.17.37.0/16 scope global flannel0

•   添加iptables规则:

iptables -I INPUT -p tcp --dport 2379 -j ACCEPT
iptables -I INPUT -p tcp --dport 10250 -j ACCEPT
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

•  现在登陆kubernetes master节点验证minions的节点状态:

# kubectl get nodes
NAME           LABELS                                STATUS
192.168.0.80   kubernetes.io/hostname=192.168.0.80   Ready
192.168.0.81   kubernetes.io/hostname=192.168.0.81   Ready

至此,kubernetes集群已经配置并运行了,我们可以继续下面的步骤。

三、创建Pods (Containers)

为了创建一个pod,我们需要在kubernetes master上面定义一个yaml 或者 json配置文件。然后使用kubectl命令创建pod

# mkdir -p k8s/pods
# cd k8s/pods/
# vim nginx.yaml

在nginx.yaml里面增加如下内容:

apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  containers:
  - name: nginx
    image: nginx
    ports:
    - containerPort: 80

创建pod:

# kubectl create -f nginx.yaml

此时有如下报错:

Error from server: error when creating "nginx.yaml": Pod "nginx" is forbidden: no API token found for service account default/default, retry after the token is automatically created and added to the service account

解决办法是编辑/etc/kubernetes/apiserver 去除 KUBE_ADMISSION_CONTROL中的SecurityContextDeny,ServiceAccount,并重启kube-apiserver.service服务:

#vim /etc/kubernetes/apiserver
KUBE_ADMISSION_CONTROL="--admission_control=NamespaceLifecycle,NamespaceExists,LimitRanger,ResourceQuota"

#systemctl restart kube-apiserver.service

之后重新创建pod:

# kubectl create -f nginx.yaml
pods/nginx

查看pod:

# kubectl get pod nginx
NAME      READY     STATUS                                            RESTARTS   AGE
nginx     0/1       Image: nginx is not ready on the node   0          34s

这里STATUS一直是这个,创建不成功,下面排错。通过查看pod的描述发现如下错误:

# kubectl describe pod nginx 
Wed, 28 Oct 2015 10:25:30 +0800       Wed, 28 Oct 2015 10:25:30 +0800 1       {kubelet 192.168.0.81}  implicitly required container POD       pulled          Successfully pulled Pod container image "gcr.io/google_containers/pause:0.8.0"
  Wed, 28 Oct 2015 10:25:30 +0800       Wed, 28 Oct 2015 10:25:30 +0800 1       {kubelet 192.168.0.81}  implicitly required container POD       failed          Failed to create docker container with error: no such image
  Wed, 28 Oct 2015 10:25:30 +0800       Wed, 28 Oct 2015 10:25:30 +0800 1       {kubelet 192.168.0.81}                                          failedSync      Error syncing pod, skipping: no such image
  Wed, 28 Oct 2015 10:27:30 +0800       Wed, 28 Oct 2015 10:29:30 +0800 2       {kubelet 192.168.0.81}  implicitly required container POD       failed          Failed to pull image "gcr.io/google_containers/pause:0.8.0": image pull failed for gcr.io/google_containers/pause:0.8.0, this may be because there are no credentials on this request.  details: (API error (500): invalid registry endpoint "http://gcr.io/v0/". HTTPS attempt: unable to ping registry endpoint https://gcr.io/v0/
v2 ping attempt failed with error: Get https://gcr.io/v2/: dial tcp 173.194.72.82:443: i/o timeout

手动ping了一下gcr.io发现无法ping通(可能是被墙了)

从网上找到 pause:0.8.0 的镜像,然后再每个minion上导入镜像:

# docker load --input pause-0.8.0.tar

附下载:pause-0.8.0.tar

在执行以下命令即可成功创建pod

#kubectl create -f nginx.yaml
pods/nginx

查看pod

# kubectl get pod nginx
NAME      READY     STATUS                                            RESTARTS   AGE
nginx      1/1             Running                                            0               2min

 

ofbiz 使用mysql作为存储数据库

        OFBiz是一个非常著名的电子商务平台,是一个非常著名的开源项目,提供了创建基于最新J2EE/XML规范和技术标准,构建大中型企业级、跨平台、跨数据库、跨应用服务器的多层、分布式电子商务类WEB应用系统的框架。 OFBiz最主要的特点是OFBiz提供了一整套的开发基于Java的web应用程序的组件和工具。包括实体引擎, 服务引擎, 消息引擎, 工作流引擎, 规则引擎等。OFBiz 已经正式成为 Apache 的顶级项目: Apache OFBiz。
        ofbiz自带的数据库是Derby,这是一种小型的适合于测试系统的数据库,但不适合在产品级系统中使用,所以通常我们需要将ofbiz数据库迁移到其它数据库上。下面介绍迁移到mysql的步骤,迁移到其他数据库操作类似。
  1. 安装mysql,创建ofbiz的数据库
    使用以下命令分别创建ofbiz用户(密码ofbiz),和ofbiz、ofbizolap、ofbiztenant三个数据库
    mysql -u root 
    >create user 'ofbiz'@'localhost' identified by 'ofbiz';   
    >create database ofbiz DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci;  
    >create database ofbizolap DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci;  
    >create database ofbiztenant DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci;  
    >grant all on *.* to 'ofbiz'@'localhost';
    >flush privileges;
    >quit;
    
  2. 修改ofbiz配置文件
    编辑 entityengine.xml 修改默认的数据库引擎,以及连接数据库的用户名密码等信息
    vim ofbiz_HOME/framework/entity/config/entityengine.xml

    修改其中的delegator name标签为如下内容(即注释derby启用mysql)
    <delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false">
            <!-- <group-map group-name="org.ofbiz" datasource-name="localderby"/>
            <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
            <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> -->
    <group-map group-name="org.ofbiz" datasource-name="localmysql"/>
    <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/>
    <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/>
    <!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> --> </delegator> <delegator name="default-no-eca" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" entity-eca-enabled="false" distributed-cache-clear-enabled="false"> <!-- <group-map group-name="org.ofbiz" datasource-name="localderby"/> <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> --> <group-map group-name="org.ofbiz" datasource-name="localmysql"/>
    <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/>
    <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/>
    <!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> --> </delegator> <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant load-demo" before running "ant run-tests" --> <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main"> <!-- <group-map group-name="org.ofbiz" datasource-name="localderby"/> <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> --> <group-map group-name="org.ofbiz" datasource-name="localmysql"/>
    <group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/>
    <group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/>
    <!-- <group-map group-name="org.ofbiz" datasource-name="localpostnew"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> --> </delegator>

    修改datasource name部分注意修改数据库登陆信息及字符集和编码
    <datasource name="localmysql"
                helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
                field-type-name="mysql"
                check-on-start="true"
                add-missing-on-start="true"
                check-pks-on-start="false"
                use-foreign-keys="true"
                join-style="ansi-no-parenthesis"
                alias-view-columns="false"
                drop-fk-use-foreign-key-keyword="true"
                table-type="InnoDB"
    character-set="utf8"
    collate="utf8_general_ci">
    <read-data reader-name="tenant"/> <read-data reader-name="seed"/> <read-data reader-name="seed-initial"/> <read-data reader-name="demo"/> <read-data reader-name="ext"/> <read-data reader-name="ext-test"/> <read-data reader-name="ext-demo"/> <inline-jdbc jdbc-driver="com.mysql.jdbc.Driver" jdbc-uri="jdbc:mysql://127.0.0.1:3306/ofbiz?autoReconnect=true" jdbc-username="ofbiz"
    jdbc-password="ofbiz"
    isolation-level="ReadCommitted" pool-minsize="2" pool-maxsize="250" time-between-eviction-runs-millis="600000"/><!-- Please note that at least one person has experienced a problem with this value with MySQL and had to set it to -1 in order to avoid this issue. For more look at http://markmail.org/thread/5sivpykv7xkl66px and http://commons.apache.org/dbcp/configuration.html--> <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> --> </datasource> <datasource name="localmysqlolap" helper-class="org.ofbiz.entity.datasource.GenericHelperDAO" field-type-name="mysql" check-on-start="true" add-missing-on-start="true" check-pks-on-start="false" use-foreign-keys="true" join-style="ansi-no-parenthesis" alias-view-columns="false" drop-fk-use-foreign-key-keyword="true" table-type="InnoDB" character-set="utf8"
    collate="utf8_general_ci">
    <read-data reader-name="tenant"/> <read-data reader-name="seed"/> <read-data reader-name="seed-initial"/> <read-data reader-name="demo"/> <read-data reader-name="ext"/> <read-data reader-name="ext-test"/> <read-data reader-name="ext-demo"/> <inline-jdbc jdbc-driver="com.mysql.jdbc.Driver" jdbc-uri="jdbc:mysql://127.0.0.1:3306/ofbizolap?autoReconnect=true" jdbc-username="ofbiz"
    jdbc-password="ofbiz"
    isolation-level="ReadCommitted" pool-minsize="2" pool-maxsize="250" time-between-eviction-runs-millis="600000"/><!-- Please note that at least one person has experienced a problem with this value with MySQL and had to set it to -1 in order to avoid this issue. For more look at http://markmail.org/thread/5sivpykv7xkl66px and http://commons.apache.org/dbcp/configuration.html--> <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> --> </datasource> <datasource name="localmysqltenant" helper-class="org.ofbiz.entity.datasource.GenericHelperDAO" field-type-name="mysql" check-on-start="true" add-missing-on-start="true" check-pks-on-start="false" use-foreign-keys="true" join-style="ansi-no-parenthesis" alias-view-columns="false" drop-fk-use-foreign-key-keyword="true" table-type="InnoDB" character-aracter-set="utf8"
    collate="utf8_general_ci">
    <read-data reader-name="tenant"/> <read-data reader-name="seed"/> <read-data reader-name="seed-initial"/> <read-data reader-name="demo"/> <read-data reader-name="ext"/> <read-data reader-name="ext-test"/> <read-data reader-name="ext-demo"/> <inline-jdbc jdbc-driver="com.mysql.jdbc.Driver" jdbc-uri="jdbc:mysql://127.0.0.1:3306/ofbiztenant?autoReconnect=true" jdbc-username="ofbiz"
    jdbc-password="ofbiz"
    isolation-level="ReadCommitted" pool-minsize="2" pool-maxsize="250" time-between-eviction-runs-millis="600000"/><!-- Please note that at least one person has experienced a problem with this value with MySQL and had to set it to -1 in order to avoid this issue. For more look at http://markmail.org/thread/5sivpykv7xkl66px and http://commons.apache.org/dbcp/configuration.html--> <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> --> </datasource>


  3. 复制mysql.jar文件到指定目录 mysql.jar下载地址:http://dev.mysql.com/downloads/connector/j/ 这里上传自己使用的mysql-connector-java-5.1.36-bin 复制mysql.jar到lib目录

    cp mysql-connector-java-5.1.36-bin.jar ofbiz_HOME/framework/base/lib/
  4. 导入数据,启动ofbiz
    cd ofbiz_HOME
    ./ant load-demo           #导入demo数据
    ./ant start               #启动ofbiz

    至此已经完成ofbiz使用mysql数据库的配置,其他操作请参考ofbiz目录下的README文件