Tencent blue whale cmdb source compiler environment dependent
Environmental envelope Reference: golang > = 1.8 Python > = 2.7 . . 5 NodeJS > = 4.0 . 0 (during compilation need to be connected to download public network dependencies)
Python environment
wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz tar -xf Python-2.7.13.tgz mv Python-2.7.13 /usr/local/python cd /usr/local/python/ 编译 ./configure --prefix=/usr/local/python/ make &&make install ln -s /usr/local/python/bin/python2.7 /usr/bin/python
GO environment
HTTPS wget: // storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz --no-Check-Certificate . -xf the tar Go1 8.3 . Linux-amd64.tar.gz -C / usr / local / 1, editing environment variable vi / etc / Profile Export the PATH = $ the PATH: / usr / local / Go / bin Export GOROOT = / usr / local / Go Source / etc / Profile 2, detects the version go version
NodeJs environment
https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-x64.tar.xz tar -xf node-v10.9.0-linux-x64.tar.xz -C /usr/local ln -s /usr/local/node/bin/npm /usr/local/bin/ ln -s /usr/local/node/bin/node /usr/local/bin/
CNPM mounting (mounting CNPM NPM)
1、npm 安装 cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
ln -s /usr/local/node/bin/cnpm /usr/local/bin/
2、安装bower
npm install bower -g
ln -s /usr/local/node/bin/bower /usr/local/bin/
3、检测查看
ls /usr/local/node/bin
Creating GOPATH compilation directory
1 , the root directory create a working compiler mkdir -p / opt / Work 2 , the address provided GOPATH Export GOPATH = / opt / Work . 3 , the storage path for the new source code GOPATH mkdir -p $ GOPATH / the src
Compile the test:
Method 1: cd $ GOPATH/src git clone HTTPS://github.com/Tencent/bk-cmdb configcenter GOPATH is the root directory Golang writing project, way: you can also directly download the 3.5.20source package wget HTTPS:/ /codeload.github.com/Tencent/bk-cmdb/tar.gz/release-v3.5.20 the tar-CMDB -xf BK-Release-v3.5.20.tar.gz -C / opt / Work /the src Music Videos BK-CMDB configcenter compile the example: 1, into the source root compile: CD $ GOPATH/ the src / configcenter /the src 2, compiled (recommended npm mirror CNPM front-end compiler) the make of nPM=CNPM . 3, packing the make package . 4, the archive default storage position $ GOPATH/src/configcenter/src/bin/pub/cmdb.tar.gz
CMDB deployment examples
tar - XF cmd.tar.gz cd CMDB to create a profile python init.py prompted for the parameter Configuration Reference: python init.py \ --discovery 127.0 . 0.1 : 2181 \ - Database CMDB \ --redis_ip 127.0 . 0.1 \ - -redis_port 6379 \ --redis_pass 1111 \ --mongo_ip 127.0 . 0.1 \ --mongo_port 27017 \ - mongo_user CC \ -CC mongo_pass \ --blueking_cmdb_url HTTP: // 127.0.0.1:8083/ \ --blueking_paas_url HTTP: // paas.domain.com \ # can no --listen_port 8083 \ --auth_scheme Internal \ # or not to set --auth_enabled false \ # or not to set --auth_address HTTPS: // iam.domain.com/ \ # may not be provided - auth_app_code bk_cmdb \ # may not be provided - auth_app_secret xxxxxxx \ # may not be provided - full_text_search OFF \ # or not to set --es_url http : // 127.0.0.1:9200 \ # or not to set --log_level 3
Generate configuration directory:
Start (switch assembly deployed main directory)
./start.sh
Initialize the database
./init_db.sh
The default access port is 8083; http: // ip: 8083