1 安装 OpenSSL {#1-%E5%AE%89%E8%A3%85-openssl}
#执行安装命令
yum install openssl -y
2 准备 SSL 证书 {#2-%E5%87%86%E5%A4%87-ssl-%E8%AF%81%E4%B9%A6}
#执行创建 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 {#3-%E5%AE%89%E8%A3%85-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 配置文件 {#4-%E9%85%8D%E7%BD%AE-mongodb-bi-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6}
#注意修改 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 服务 {#5-%E5%AE%89%E8%A3%85-mongodb-bi-connector-%E6%9C%8D%E5%8A%A1}
mongosqld install --config /opt/mongo-bi-connector/conf/mongosqld-config.yml
#重新加载
systemctl daemon-reload
#设置开机自启
systemctl enable mongosql.service
6 启动服务 {#6-%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1}
#执行生成 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 数据源配置 {#7-dataease-%E6%95%B0%E6%8D%AE%E6%BA%90%E9%85%8D%E7%BD%AE}
选择 Mongodb-BI 链接即可