
数据库
PostgreSQL 18.6 安装记录
一、环境 项值主机192.168.6.98系统CentOS Stream 9(x86\64)SELinuxEnforcing防火墙firewalld(active)安装方式PGDG
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.0.tar.gz https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.1.tar.gz tar -zxf elasticsearch-5.3.0.tar.gz mv elasticsearch-5.3.0 /usr/local/elasticsearch
cd /usr/local/elasticsearch/config
vim jvm.options ....... -Xms2g -Xmx2g 改成 -Xms512m -Xmx512m ......
vim elasticsearch.yml ............. # path.data: /usr/local/elasticsearch/data #数据路径 # # Path to log files: # path.logs: /usr/local/elasticsearch/logs #日志路径 ................ network.host: 0.0.0.0 #允许任何IP访问 # # Set a custom port for HTTP: # http.port: 9200 #cd .. #mkdir logs data
#groupadd elk #创建用户组elk #useradd elk -g elk -p 111111 # 创建新用户elk,-g elk 设置其用户组为 elk,-p 111 设置其密码6个1 # cd /usr/local # chown -R elk:elk elasticsearch # cd elasticsearch/bin
#./elasticsearch #启动打印日志 #./elasticsearch -d #后台启动
{
"name" : "iknMFrM",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "rfPgAJQDTEKPPsZDgEBKjA",
"version" : {
"number" : "5.3.0",
"build_hash" : "3adb13b",
"build_date" : "2017-03-23T03:31:50.652Z",
"build_snapshot" : false,
"lucene_version" : "6.4.1"
},
"tagline" : "You Know, for Search"
}
#./elasticsearch
[2019-08-29T20:02:07,957][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.3.0.jar:5.3.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.3.0.jar:5.3.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:58) ~[elasticsearch-5.3.0.jar:5.3.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.3.0.jar:5.3.0]
at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.3.0.jar:5.3.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.3.0.jar:5.3.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.3.0.jar:5.3.0]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.3.0.jar:5.3.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:204) ~[elasticsearch-5.3.0.jar:5.3.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.0.jar:5.3.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.0.jar:5.3.0]
... 6 more
[2019-08-29T20:16:17,312][INFO ][o.e.b.BootstrapChecks ] [iknMFrM] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks ERROR: bootstrap checks failed max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]临时提高了vm.max_map_count的大小,此操作需要root权限:
sudo sysctl -w vm.max_map_count=262144 sysctl -a|grep vm.max_map_count永久修改vm.max_map_count: 解决:切换到root用户修改配置sysctl.conf
vi /etc/sysctl.conf添加下面配置:
vm.max_map_count=655360并执行命令:
sysctl -p然后,重新启动elasticsearch,即可启动成功。
[2019-08-29T20:16:17,312][INFO ][o.e.b.BootstrapCheck ] [SfD5sIh] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks ERROR: bootstrap checks failed initial heap size [536870912] not equal to maximum heap size [1073741824]; this can cause resize pauses and prevents mlockall from locking the entire heap
vi config/jvm.options ###-Xms 和 -Xmx需要配置的相等,不然无法启动成功。 -Xms1024m -Xmx1024m至此,elasticsearch单机安装已经完成。
评论 0