1 安装 OpenSSL
#执行安装命令
yum install openssl -y
2 准备 SSL 证书
#执行创建 SSL 证书
mkdir -p /opt/mongo-bi-connector/crt/
cd /opt/mongo-bi-connector/crt/
openssl req -nodes -newkey rsa:2048 -keyout kayakwiseDE.key -out kayakwiseDE.crt -x509 -days 365 -subj "/C=US/ST=kayakwiseDE/L=kayakwiseDE/O=kayakwiseDE Security/OU=IT Department/CN=kayakwise.com"
cat kayakwiseDE.crt kayakwiseDE.key > kayakwiseDE.pem
3 安装 MongoDB BI Connector
#获取安装包地址
cd /opt/mongo-bi-connector/
wget https://info-mongodb-com.s3.amazonaws.com/mongodb-bi/v2/mongodb-bi-linux-x86_64-rhel70-v2.14.4.tgz
tar -zxvf mongodb-bi-linux-x86_64-rhel70-v2.14.4.tgz
cd mongodb-bi-linux-x86_64-rhel70-v2.14.4/
install -m755 bin/mongo* /usr/bin/
4 配置 MongoDB BI 配置文件
#注意修改 mongoDB 的 IP,port,username,password,database 等
mkdir -p /opt/mongo-bi-connector/conf/
mkdir -p /opt/mongo-bi-connector/logs/
mkdir -p /opt/mongo-bi-connector/schemas
cat > /opt/mongo-bi-connector/conf/mongosqld-config.yml << EOF
net:
bindIp: "0.0.0.0"
port: 3307
ssl:
mode: allowSSL
PEMKeyFile: '/opt/mongo-bi-connector/crt/kayakwiseDE.pem'
allowInvalidCertificates: true
minimumTLSVersion: TLS1_0
mongodb:
net:
uri: "mongodb://<host>:<port>"
ssl:
enabled: false
auth:
username: <username>
password: <password>
source: <database>
mechanism: SCRAM-SHA-1
security:
enabled: true
defaultMechanism: "SCRAM-SHA-1"
defaultSource: "<database>"
systemLog:
path: /opt/mongo-bi-connector/logs/mongosqld.log
verbosity: 2
logAppend: true
schema:
path: /opt/mongo-bi-connector/schemas
maxVarcharLength: 65535
processManagement:
service:
name: "mongosql"
displayName: "MongoSQL Service"
description: "MongoSQL accesses MongoDB data with SQL"
EOF
5 安装 MongoDB BI Connector 服务
mongosqld install --config /opt/mongo-bi-connector/conf/mongosqld-config.yml
#重新加载
systemctl daemon-reload
#设置开机自启
systemctl enable mongosql.service
6 启动服务
#执行生成 schema
mongodrdl --host <host>:<port> --username <username> --password <password> --db <database> --authenticationDatabase <database> --authenticationMechanism SCRAM-SHA-1 --out /opt/mongo-bi-connector/schemas/schemas.drdl
#启动
systemctl start mongosql.service
7 DataEase 数据源配置
选择 Mongodb-BI 链接即可