solr安装
下载:http://archive.apache.org/dist/lucene/solr/5.2.1/
解压:tar -zxvf solr-5.2.1.tgz -C /usr/local/solr
进入bin: cd solr-5.2.1/bin
修改solr.in.sh vi solr.in.sh
ZK_HOST="master.hadoop:2181"
SOLR_HOST="master.hadoop"
# 设置solr的端口,默认是 8983
#可修改端口号
SOLR_PORT=8983
保存退出
启动: bin/solr start
出现的问题:
*** [WARN] *** Your open file limit is currently 1024.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] *** Your Max Processes Limit is currently 3853.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
WARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting.
Please consult the Reference Guide. To override this check, start with argument '-force'
这个是因为由于linux的限制行数,所以出现该问题
解决办法:打开 solr.in.sh 翻到最下面 修改
SOLR_ULIMIT_CHECKS=fasle
启动 cd bin ./solr start -force (这个是用root启动的)
启动完成之后,浏览器:http://10.0.0.7:8983 页面出现,启动成功
Atlas安装
1.下载,网址https://atlas.apache.org/#/Downloads 下载下来之后是apache-atlas-0.8.4-sources.tar.gz,但是这个是源码,是不能够在服务器直接运行的,需要编辑
2.编辑打包:需要在本地有网的机器上下载依赖,打包,这就需要用到maven来下载依赖
下载略过,编译打包命令如下:
使用外部Hbase和solr的打包命令如下:mvn clean -DskipTests package -Pdist
使用Atlas内置的Hbase和Solr打包如下:mvn clean -DskipTests package -Pdist,embedded-hbase-solr
打包完成之后的名称是:apache-atlas-0.8.4-bin.tar.gz 具体位置是在:apache-atlas-sources-2.2.0\distro\target
3.上传解压:tar -zxvf apache-atlas-2.2.0-bin.tar.gz -C atlas
4.修改配置文件:
(1)修改配置文件 下面是需要修改的两个文件完整版
配置文件1:atlas-env.sh
vi atlas-env.sh
export MANAGE_LOCAL_HBASE=false // 使用外部的hbase
export MANAGE_LOCAL_SOLR=false //使用外部的solr
export HBASE_CONF_DIR=/usr/local/atlas/conf/hbase/conf
配置文件2:atlas-application.properties 这里给出全部的,包括hbase/hive/solr/kafka/,ip和端口向自己真实的靠齐
vi atlas-application.properties
> #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
######### Graph Database Configs #########
# Graph Database
#Configures the graph database to use. Defaults to Titan 0.5.4.
#atlas.graphdb.backend=org.apache.atlas.repository.graphdb.titan0.Titan0GraphDatabase
# Graph Storage
atlas.graph.storage.backend=hbase
atlas.graph.storage.hbase.table=apache_atlas_titan
#Hbase
#For standalone mode , specify localhost
#for distributed mode, specify zookeeper quorum here - For more information refer http://s3.thinkaurelius.com/docs/titan/current/hbase.html#_remote_server_mode_2
atlas.graph.storage.hostname=127.0.0.1:2181
atlas.graph.storage.hbase.regions-per-server=1
atlas.graph.storage.lock.wait-time=10000
# Gremlin Query Optimizer
#
# Enables rewriting gremlin queries to maximize performance. This flag is provided as
# a possible way to work around any defects that are found in the optimizer until they
# are resolved.
#atlas.query.gremlinOptimizerEnabled=true
# Delete handler
#
# This allows the default behavior of doing "soft" deletes to be changed.
#
# Allowed Values:
# org.apache.atlas.repository.graph.SoftDeleteHandler - all deletes are "soft" deletes
# org.apache.atlas.repository.graph.HardDeleteHandler - all deletes are "hard" deletes
#
#atlas.DeleteHandler.impl=org.apache.atlas.repository.graph.SoftDeleteHandler
# Entity audit repository
#
# This allows the default behavior of logging entity changes to hbase to be changed.
#
# Allowed Values:
# org.apache.atlas.repository.audit.HBaseBasedAuditRepository - log entity changes to hbase
# org.apache.atlas.repository.audit.NoopEntityAuditRepository - disable the audit repository
#
atlas.EntityAuditRepository.impl=org.apache.atlas.repository.audit.HBaseBasedAuditRepository
# Graph Search Index
atlas.graph.index.search.backend=solr5
#Solr
#Solr cloud mode properties
atlas.graph.index.search.solr.mode=cloud
atlas.graph.index.search.solr.zookeeper-url=127.0.0.1:2181
atlas.graph.index.search.solr.zookeeper-connect-timeout=60000
atlas.graph.index.search.solr.zookeeper-session-timeout=60000
#Solr http mode properties
#atlas.graph.index.search.solr.mode=http
#atlas.graph.index.search.solr.http-urls=http://localhost:8983/solr
# Solr-specific configuration property
atlas.graph.index.search.max-result-set-size=150
######### Notification Configs #########
atlas.notification.embedded=false
atlas.kafka.data=${sys:atlas.home}/data/kafka
atlas.kafka.zookeeper.connect=127.0.0.1:2181
atlas.kafka.bootstrap.servers=127.0.0.1:9092
atlas.kafka.zookeeper.session.timeout.ms=4000
atlas.kafka.zookeeper.connection.timeout.ms=2000
atlas.kafka.zookeeper.sync.time.ms=20
atlas.kafka.auto.commit.interval.ms=1000
atlas.kafka.hook.group.id=atlas
atlas.kafka.enable.auto.commit=true
atlas.kafka.auto.offset.reset=earliest
atlas.kafka.session.timeout.ms=30000
atlas.kafka.poll.timeout.ms=1000
atlas.notification.create.topics=true
atlas.notification.replicas=1
atlas.notification.topics=ATLAS_HOOK,ATLAS_ENTITIES
atlas.notification.log.failed.messages=true
atlas.notification.consumer.retry.interval=500
atlas.notification.hook.retry.interval=1000
# Enable for Kerberized Kafka clusters
#atlas.notification.kafka.service.principal=kafka/_HOST@EXAMPLE.COM
#atlas.notification.kafka.keytab.location=/etc/security/keytabs/kafka.service.keytab
######### Hive Lineage Configs #########
## Schema
atlas.lineage.schema.query.hive_table=hive_table where __guid='%s'\, columns
atlas.lineage.schema.query.Table=Table where __guid='%s'\, columns
## Server port configuration
#atlas.server.http.port=21000
#atlas.server.https.port=21443
######### Security Properties #########
# SSL config
atlas.enableTLS=false
#truststore.file=/path/to/truststore.jks
#cert.stores.credential.provider.path=jceks://file/path/to/credentialstore.jceks
#following only required for 2-way SSL
#keystore.file=/path/to/keystore.jks
# Authentication config
atlas.authentication.method.kerberos=false
atlas.authentication.method.file=true
#### ldap.type= LDAP or AD
atlas.authentication.method.ldap.type=none
#### user credentials file
atlas.authentication.method.file.filename=${sys:atlas.home}/conf/users-credentials.properties
### groups from UGI
#atlas.authentication.method.ldap.ugi-groups=true
######## LDAP properties #########
#atlas.authentication.method.ldap.url=ldap://<ldap server url>:389
#atlas.authentication.method.ldap.userDNpattern=uid={0},ou=People,dc=example,dc=com
#atlas.authentication.method.ldap.groupSearchBase=dc=example,dc=com
#atlas.authentication.method.ldap.groupSearchFilter=(member=uid={0},ou=Users,dc=example,dc=com)
#atlas.authentication.method.ldap.groupRoleAttribute=cn
#atlas.authentication.method.ldap.base.dn=dc=example,dc=com
#atlas.authentication.method.ldap.bind.dn=cn=Manager,dc=example,dc=com
#atlas.authentication.method.ldap.bind.password=<password>
#atlas.authentication.method.ldap.referral=ignore
#atlas.authentication.method.ldap.user.searchfilter=(uid={0})
#atlas.authentication.method.ldap.default.role=<default role>
######### Active directory properties #######
#atlas.authentication.method.ldap.ad.domain=example.com
#atlas.authentication.method.ldap.ad.url=ldap://<AD server url>:389
#atlas.authentication.method.ldap.ad.base.dn=(sAMAccountName={0})
#atlas.authentication.method.ldap.ad.bind.dn=CN=team,CN=Users,DC=example,DC=com
#atlas.authentication.method.ldap.ad.bind.password=<password>
#atlas.authentication.method.ldap.ad.referral=ignore
#atlas.authentication.method.ldap.ad.user.searchfilter=(sAMAccountName={0})
#atlas.authentication.method.ldap.ad.default.role=<default role>
######### JAAS Configuration ########
#atlas.jaas.KafkaClient.loginModuleName = com.sun.security.auth.module.Krb5LoginModule
#atlas.jaas.KafkaClient.loginModuleControlFlag = required
#atlas.jaas.KafkaClient.option.useKeyTab = true
#atlas.jaas.KafkaClient.option.storeKey = true
#atlas.jaas.KafkaClient.option.serviceName = kafka
#atlas.jaas.KafkaClient.option.keyTab = /etc/security/keytabs/atlas.service.keytab
#atlas.jaas.KafkaClient.option.principal = atlas/_HOST@EXAMPLE.COM
######### Server Properties #########
atlas.rest.address=http://127.0.0.1:21000
# If enabled and set to true, this will run setup steps when the server starts
atlas.server.run.setup.on.start=false
######### Entity Audit Configs #########
atlas.audit.hbase.tablename=apache_atlas_entity_audit
atlas.audit.zookeeper.session.timeout.ms=1000
atlas.audit.hbase.zookeeper.quorum=127.0.0.1:2181
######### High Availability Configuration ########
atlas.server.ha.enabled=false
#### Enabled the configs below as per need if HA is enabled #####
#atlas.server.ids=id1
#atlas.server.address.id1=localhost:21000
#atlas.server.ha.zookeeper.connect=localhost:2181
#atlas.server.ha.zookeeper.retry.sleeptime.ms=1000
#atlas.server.ha.zookeeper.num.retries=3
#atlas.server.ha.zookeeper.session.timeout.ms=20000
## if ACLs need to be set on the created nodes, uncomment these lines and set the values ##
#atlas.server.ha.zookeeper.acl=<scheme>:<id>
#atlas.server.ha.zookeeper.auth=<scheme>:<authinfo>
#########POLICY FILE PATH #########
atlas.auth.policy.file=${sys:atlas.home}/conf/policy-store.txt
######### Type Cache Implementation ########
# A type cache class which implements
# org.apache.atlas.typesystem.types.cache.TypeCache.
# The default implementation is org.apache.atlas.typesystem.types.cache.DefaultTypeCache which is a local in-memory type cache.
#atlas.TypeCache.impl=
#########authorizer impl class #########
atlas.authorizer.impl=SIMPLE
######### Performance Configs #########
#atlas.graph.storage.lock.retries=10
#atlas.graph.storage.cache.db-cache-time=120000
######### Business Catalog #########
atlas.taxonomy.default.name=Catalog
######### CSRF Configs #########
atlas.rest-csrf.enabled=true
atlas.rest-csrf.browser-useragents-regex=^Mozilla.*,^Opera.*,^Chrome.*
atlas.rest-csrf.methods-to-ignore=GET,OPTIONS,HEAD,TRACE
atlas.rest-csrf.custom-header=X-XSRF-HEADER
######### Enable Taxonomy #########
atlas.feature.taxonomy.enable=false
############ KNOX Configs ################
#atlas.sso.knox.browser.useragent=Mozilla,Chrome,Opera
#atlas.sso.knox.enabled=true
#atlas.sso.knox.providerurl=https://<knox gateway ip>:8443/gateway/knoxsso/api/v1/websso
#atlas.sso.knox.publicKey=
############ Atlas Metric/Stats configs ################
# Format: atlas.metric.query.<key>.<name>
atlas.metric.query.cache.ttlInSecs=900
#atlas.metric.query.general.typeCount=
#atlas.metric.query.general.typeUnusedCount=
#atlas.metric.query.general.entityCount=
#atlas.metric.query.general.tagCount=
#atlas.metric.query.general.entityDeleted=
#
#atlas.metric.query.entity.typeEntities=
#atlas.metric.query.entity.entityTagged=
#
#atlas.metric.query.tags.entityTags=
######### Compiled Query Cache Configuration #########
# The size of the compiled query cache. Older queries will be evicted from the cache
# when we reach the capacity.
#atlas.CompiledQueryCache.capacity=1000
# Allows notifications when items are evicted from the compiled query
# cache because it has become full. A warning will be issued when
# the specified number of evictions have occurred. If the eviction
# warning threshold <= 0, no eviction warnings will be issued.
#atlas.CompiledQueryCache.evictionWarningThrottle=0
######### Full Text Search Configuration #########
#Set to false to disable full text search.
#atlas.search.fulltext.enable=true
######### Gremlin Search Configuration #########
#Set to false to disable gremlin search.
atlas.search.gremlin.enable=false
########## Add http headers ###########
#atlas.headers.Access-Control-Allow-Origin=*
#atlas.headers.Access-Control-Allow-Methods=GET,OPTIONS,HEAD,PUT,POST
#atlas.headers.<headerName>=<headerValue>
# hive config
atlas.hook.hive.synchronous=false
atlas.hook.hive.numRetries=3
atlas.hook.hive.queueSize=10000
atlas.cluster.name=primary
(2)特别注意Hbase
Atlas集成Hbase时:除了修改atlas-application.properties的文件之外,还需要把Atlas的中的Hbase与外面我们使用的Hbase做个映射,就是可以调到外边Hbase的配置文件
具体命令如下:ln -s /usr/local/hbase/conf/ /usr/local/atlas/conf/hbase/
(3)特别注意Solr
Atlas中的solr要跟外面的solr做交互
cp -r /usr/local/atlas/conf/solr/ /usr/local/solr/
这样的话,外部应用的solr里面还有一个solr,改个名字
cd /usr/local/solr
mv solr atlas_conf
然后启动solr,创建Atlas需要的检索3条命令
bin/solr create -c vertex_index -d /usr/local/solr/atlas_conf -shards 3 -replicationFactor 2
bin/solr create -c edge_index -d /usr/local/solr/atlas_conf -shards 3 -replicationFactor 2
bin/solr create -c fulltext_index -d /usr/local/solr/atlas_conf -shards 3 -replicationFactor 2
解释:
-shards 3 标识该集合有3个分片
-replicationFactor 2 :表示每个分片都有两个副本
vertex_index/edge_index/fulltext_index:表示集合的名称
如果创建错误,可以删除:
bin/solr delete -c vertex_index
创建成功之后,http://10.0.0.7:8983/solr/#/~cloud登录就能看到创建的集合
(4)特别注意kafka
需要创建kafka的topic
cd /usr/local/kafka_2.12-0.11.0.2
bin/kafka-topics.sh --zookeeper master.hadoopL2181 --create --replication-factor 1 --partitions 1 --topic _HOATLASOK
bin/kafka-topics.sh --zookeeper master.hadoopL2181 --create --replication-factor 1 --partitions 1 --topic ATLAS_ENTITIES
这里我启动的是单机,没有集群,所以,数字跟的都是1,这个主要是跟kafka的server.properties中的broker.id=0有关系,集群的话,每台机器这个字段都不一样
(5)特别注意Hive,除了配置文件之外,还需要在hive的配置文件中加入其他的东西,如下:
压缩文件:
zip -u /usr/local/atlas/hook/hive/atlas-plugin-classloader-0.8.4.jar /usr/local/atlas/conf/atlas-application.properties
把Atlas的配置文件拷到外部Hive中:
cp /usr/local/atlas/conf/atlas-application.properties /usr/local/hive/conf/
编辑外部hive的配置文件 hive-site.xml
<property>
<name>hive.exec.post.hooks</name>
<value>org.apache.atlas.hive.hook.HiveHook</value>
</property>
cp -r /usr/local/atlas/hook/hive/所有的文件和目录 /usr/local/hive1.2.1/lib
(6)启动Altas
cd /usr/local/atlas/bin
./atlas_start.py
完成之后,jps出现Atlas,访问页面 http://master.hadoop:21000,页面正常显示,启动成功
(7)第一次导入数据,把hive中的数据,导入到Atlas中
cd /usr/local/atlas/bin
./import-hive.sh
安装git
步骤1:下载:https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.35.1.tar.gz(官网:https://git-scm.com/download/linux)
步骤2:上传 解压 tar -zxvf 压缩包 -C 解压位置
步骤3:安装依赖组件(内网的,就自定去下载安装):
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
步骤4 安装:
cd git-2.35.1
make prefix=/usr/local/git/git-2.35.1/setup all (此处的setup是手动创建的)
make prefix=/usr/local/git/git-2.35.1/setup install
步骤6 设置环境变量:
vi /etc/profile
export GIT_HOME=/usr/local/git/git-2.35.1/setup
export=PATH=$PATH:$GIT_HOME/bin
步骤7 测试:
git --version
出现 2.35.1 成功
安装gitlab
步骤1:下载 ,上传
下载地址:https://packages.gitlab.com/gitlab/gitlab-ce 选择合适的版本,这里下载地址是https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-14.6.7-ce.0.el7.x86_64.rpm 点击右上角的下载
步骤2:解压安装
rpm -ivh gitlab-ce-14.6.7-ce.0.el7.x86_64.rpm
注意:如果这里提示 Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY 这是缺少依赖组件的原因,执行下面的命令安装组件
yum install -y curl policycoreutils-python openssh-server cronie
步骤3:修改配置文件
vi /etc/gitlab/gitlab.rb
external_url 'http://web页面的IP:web页面的端口'
保存退出
步骤4:初始化gitlab
gitlab-ctl reconfigure
注意:如果这里出现下面这样的错误
Error executing action `create` on resource 'account[GitLab user and group]'
There was an error running gitlab-ctl reconfigure:
account[GitLab user and group] (gitlab::users line 28) had an error: Mixlib::ShellOut::ShellCommandFailed: linux_user[GitLab user and group] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/account.rb line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 12], but received '8'
---- Begin output of ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] ----
STDOUT:
STDERR: usermod: user git is currently used by process 11884
---- End output of ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] ----
Ran ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] returned 8
网上的解决办法如下:
vi /etc/gitlab/gitlab.rb
加上如下的配置:
user['username'] = "gitlab"
user['group'] = "gitlab"
保存退出,重新gitlab-ctl reconfigure
步骤5:启动:
gitlab-ctl start
步骤5:访问 访问gitlab.rb文件中 external_url的配置
默认账号密码:
默认账号root
默认密码:/etc/gitlab/initial_root_password 文件里面的密码
安装Mariadb
步骤1:监测服务器上是否有Mariadb的残留文件,全部删除
//查询 rpm -qa | grep -i mariadb
// 删除 rpm -e --nodeps mariadb-*
步骤2:配置Mariadb文件,为了yum下载设置环境
vi /etc/yum.repos.d/MariaDB.repo
// 内容
# MariaDB 10.6.11 CentOS repository list - created 2017-05-05 16:13 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.6.11/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
步骤3:下载
yum install mariadb-server -y
步骤4:操作
// 启动 systemctl start mariadb
// 设置开机启动 systemctl enable mariadb #设置开机启动
// 重启 systemctl restart mariadb
// 停止 systemctl stop mariadb.service
步骤4:登录mysql
mysql -uroot -p // 首次登录没有密码 ,直接回车
// 设置密码 SET PASSWORD = PASSWORD('123456');
// 设置全访问权限:grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
// 刷新权限:flush privileges;