安装相关环境
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ ~]# yum install gcc-c++ |
春风十里,不如你...
1 | # 通过sftp上传压缩包 |
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ ~]# cd /usr/local/ |
clientPort=客户端连接端口
dataDir=data目录(/usr/local/solr-cluster/zookeeper01/data)
server.1=127.0.0.1:2881:3881 (1 myid标识,2881 zookeeper 连接内部通讯端口,3881 选举端口)
1 | # The number of milliseconds of each tick |
1 | # 创建批处理文件 |
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ solr-cluster]# cp /usr/local/tomcat/apache-tomcat-8.5.27.tar.gz /usr/local/solr-cluster/ |
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ solr-cluster]# vim tomcat01/bin/catalina.sh |
1 | # 让zookeeper统一管理配置文件。需要把solrhome/mycore/conf目录上传到zookeeper。上传任意solrhome中的配置文件即可。 |
访问xxxxxx:8090/solr/index.html 报错:SolrCore Initialization Failures
https://segmentfault.com/q/1010000012076404/a-1020000012123299
原因:solr启动的时候会去检测home的collection,但是你那个core1是从单节点拷贝过来的,结构上肯定不一样,单节点上core和collection可以理解成相等的,集群中collection是有分布在不通节点上的core组成的1
2
3
4[root@iZuf6iq8e7ya9v3ix71k0pZ solr-cluster]# rm -rf solrhome01/mycore
[root@iZuf6iq8e7ya9v3ix71k0pZ solr-cluster]# rm -rf solrhome02/mycore
[root@iZuf6iq8e7ya9v3ix71k0pZ solr-cluster]# rm -rf solrhome03/mycore
[root@iZuf6iq8e7ya9v3ix71k0pZ solr-cluster]# rm -rf solrhome04/mycore
补充说明
博文写的很清晰,但是有人难免会不清楚配置到哪里
配置的搜索相关参数
1 | 站点(博客的根目录) /users/xxx/bloghome/blog1/themes/next/_config.xml |
主题的配置文件中开启搜索功能
1 | /users/xxx/bloghome/blog1/themes/next/_config.xml |
1 | # 拷贝环境,如果存在 dump.rdb,记得rm |
https://rubygems.global.ssl.fastly.net/gems/redis-4.0.1.gem1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21sftp> put /Users/niuhesm/Downloads/redis-4.0.1.gem /root
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# yum install ruby
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# gem install redis-4.0.1.gem
ERROR: Error installing redis-4.0.1.gem:
redis requires Ruby version >= 2.2.2.
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]#
# 由于不想更新 yum 源,换个方式更新 ruby 版本
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# yum remove ruby
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# wget https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.gz
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# tar zxvf ruby-2.2.3.tar.gz
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# cd ruby-2.2.3
[root@iZuf6iq8e7ya9v3ix71k0pZ ruby-2.2.3]# ./configure
[root@iZuf6iq8e7ya9v3ix71k0pZ ruby-2.2.3]# make
[root@iZuf6iq8e7ya9v3ix71k0pZ ruby-2.2.3]# sudo make install
[root@iZuf6iq8e7ya9v3ix71k0pZ ruby-2.2.3]# ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
# 重新安装依赖包
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# gem install redis-4.0.1.gem
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ redis-cluster]# cd /usr/local/redis/redis-4.0.8/src/ |
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ redis-cluster]# ./redis-trib.rb create --replicas 1 106.15.191.27:7001 106.15.191.27:7002 106.15.191.27:7003 106.15.191.27:7004 106.15.191.27:7005 106.15.191.27:7006 |
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ redis-cluster]# ./redis-trib.rb create --replicas 1 106.15.191.27:7001 106.15.191.27:7002 106.15.191.27:7003 106.15.191.27:7004 106.15.191.27:7005 106.15.191.27:7006 |
解决:删除相关的 dump.rdb,nodes-700x.conf
1 | <dubbo:application name="taotao-manager"/> |
启动正常
1 | [zk: 106.15.191.27:2181(CONNECTED) 1] ls /dubbo/com.smniuhe.service.ItemService/providers |
发现 192.168.0.28 是本地的 ip 地址
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ bin]# pwd |