首页 文章 精选 留言 我的

精选列表

搜索[文档解析],共10012篇文章
优秀的个人博客,低调大师

zookeeper基本安装文档

zookeeper 检查是否安装JDK rpm -qa|grep -E '^open[jre|jdk]|j[re|dk]' 卸载已安装JDK rpm -qa|grep Java|xargs rpm -e --nodeps yum安装jdk yum search java|grep jdk yum install java-1.8.0-openjdk 检查安装是否成功 java -version java version "1.8.0_101" Java(TM) SE Runtime Environment (build 1.8.0_101-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode) 下载并安装 cd /root wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz tar -xvf zookeeper-3.4.11.tar.gz mv ./zookeeper-3.4.11 /usr/local/zookeeper mkdir /usr/local/zookeeper/var mkdir /usr/local/zookeeper/var/log echo 1 > /usr/local/zookeeper/var/log/myid cp /usr/local/zookeeper/conf/zoo_sample.cfg /usr/local/zookeeper/conf/zoo.cfg 修改配置 vim /usr/local/zookeeper/conf/zoo.cfg tickTime=2000 initLimit=5 syncLimit=2 dataDir=/usr/local/zookeeper/var/log dataLogDir=/usr/local/zookeeper/var/log clientPort=2181 # 多台server在下面配置即可,如果单台服务器构建多个server,则每个server用过的端口不能重复使用 # 格式: server.[n]=[server_ip]:[server与leader交互端口]:[server选举leader端口] # server.1=172.31.9.59:2182:2183 # server.2=172.31.9.60:2182:2183 # server.3=172.31.9.61:2182:2183 maxClientCnxns=60 minSessionTimeout=60 maxSessionTimeout=120 # purgeInterval含义: 0-禁用自动清除 1-使用自动清除 autopurge.purgeInterval=1 ESC :wq 安装zookeeper-c cd /usr/local/zookeeper/src/c ./configure make make install 防火墙开启 systemctl enable firewalld systemctl start firewalld firewall-cmd --zone=public --permanent --add-port=2181/tcp firewall-cmd --zone=public --permanent --add-port=2182/tcp firewall-cmd --zone=public --permanent --add-port=2183/tcp firewall-cmd --reload 单元文件 # 进入单元文件目录 cd /etc/systemd/system # 创建redis单元文件,格式为: [单元文件名].[单元文件类型] vim zookeeper.service [Unit] Description=开机启动zookeeper. After=default.target network.target [Service] User=root Group=root Type=forking PIDFile=/usr/local/zookeeper/var/log/zookeeper_server.pid ExecStart=/usr/local/zookeeper/bin/zkServer.sh start ExecReload=/usr/local/zookeeper/bin/zkServer.sh restart ExecStop=/usr/local/zookeeper/bin/zkServer.sh stop PrivateTmp=false Restart=always [Install] WantedBy=multi-user.target ESC :wq 安装php扩展:zookeeper参考链接 cd /root wget https://pecl.php.net/get/zookeeper-0.4.0.tgz tar -zxvf zookeeper-0.4.0.tgz cd zookeeper-0.4.0/ phpize ./configure make make install 安装php扩展libzookeeper参考链接 cd /root wget https://github.com/Timandes/libzookeeper/archive/v0.7.2.tar.gz tar -xvf v0.7.2.tar.gz cd libzookeeper-0.7.2 phpize ./configure make make install # 用来调起zookeeper-admin,仓库地址: https://github.com/Timandes/zookeeper-admin.git 修改php.ini vim /usr/local/php/lib/php.ini extension=libzookeeper.so extension=zookeeper.so ESC :wq PHP使用进程公共锁 # 出了$zc的作用域之后,锁将不存在 $zc = new \Zookeeper('127.0.0.1:2181'); //或者 //$zc = new \Zookeeper(); //$zc->connect('127.0.0.1:2181'); $zookeeper_key = '/xxx'; if ($zc->exists($zookeeper_key)) { //如果锁存在,则程序正在运行,不运行新的程序 return false; }else{ //如果锁文件不存在,则创建进程锁文件,运行程序 $acl = [ [ 'perms' => \Zookeeper::PERM_ALL,//共享锁(用来跨进程执行某个程序) 'scheme' => 'world', 'id' => 'anyone', ] ]; //尝试创建锁 $zookeeper_key_res = $zc->create($zookeeper_key, null, $acl, \Zookeeper::EPHEMERAL);//临时锁(可共享的) if ($zookeeper_key_res == $zookeeper_key) { //创建锁成功运行程序 //做些什么,比如等待10秒 sleep(10); $zc->delete($zookeeper_key);//其实不执行也会删除,因为这是一个临时锁,且return之后不再能取到$zc return true; } else { //创建锁失败不运行程序 return false; } }

优秀的个人博客,低调大师

官方文档 Upgrading Elasticsearch

Upgrading Elasticsearch Before upgrading Elasticsearch: Consult thebreaking changesdocs. Use theElasticsearch Migration Pluginto detect potential issues before upgrading. Test upgrades in a dev environment before upgrading your production cluster. Alwaysback up your databefore upgrading. Youcannot roll backto an earlier version unless you have a backup of your data. If you are using custom plugins, check that a compatible version is available. Elasticsearch can usually be upgraded using a rolling upgrade process, resulting in no interruption of service. This section details how to perform both rolling upgrades and upgrades with full cluster restarts. To determine whether a rolling upgrade is supported for your release, please consult this table: Upgrade From Upgrade To Supported Upgrade Type 1.x 5.x Reindex to upgrade 2.x 2.y Rolling upgrade(wherey > x) 2.x 5.x Full cluster restart 5.0.0 pre GA 5.x Full cluster restart 5.x 5.y Rolling upgrade(wherey > x) Indices created in Elasticsearch 1.x or before Elasticsearch is able to read indices created in theprevious major version only. For instance, Elasticsearch 5.x can use indices created in Elasticsearch 2.x, but not those created in Elasticsearch 1.x or before. This condition also applies to indices backed up withsnapshot and restore. If an index was originally created in 1.x, it cannot be restored into a 5.x cluster even if the snapshot was made by a 2.x cluster. Elasticsearch 5.x nodes will fail to start in the presence of too old indices. SeeReindex to upgradefor more information about how to upgrade old indices. !!!回滚升级就是一次升级一个节点!!!! A rolling upgrade allows the Elasticsearch cluster to be upgraded one node at a time, with no downtime for end users. Running multiple versions of Elasticsearch in the same cluster for any length of time beyond that required for an upgrade is not supported, as shards will not be replicated from the more recent version to the older version. Reindex to upgrade Elasticsearch is able to use indices created in the previous major version only. For instance, Elasticsearch 5.x can use indices created in Elasticsearch 2.x, but not those created in Elasticsearch 1.x or before. Elasticsearch 5.x nodes will fail to start in the presence of too old indices. If you are running an Elasticsearch 2.x cluster which contains indices that were created before 2.x, you will either need to delete those old indices or to reindex them before upgrading to 5.x. SeeReindex in place. If you are running an Elasticsearch 1.x cluster, you have two options: First upgrade to Elasticsearch 2.4.x, reindex the old indices, then upgrade to 5.x. SeeReindex in place. Create a new 5.x cluster and use reindex-from-remote to import indices directly from the 1.x cluster. SeeUpgrading with reindex-from-remote. Reindex in place The easiest way to reindex old (1.x) indices in place is to use theElasticsearch Migration Plugin. You will need to upgrade to Elasticsearch 2.3.x or 2.4.x first. Upgrading with reindex-from-remote If you are running a 1.x cluster and would like to migrate directly to 5.x without first migrating to 2.x, you can do so usingreindex-from-remote. 转自:https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html#setup-upgrade 本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/7443844.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

Frida JAVA API 文档

Java Java.available: a boolean specifying whether the current process has the a Java VM loaded, i.e. Dalvik or ART. Do not invoke any other Java properties or methods unless this is the case. Java.enumerateLoadedClasses(callbacks) enumerate classes loaded right now, where callbacks is an object specifying: onMatch: function (className): called for each loaded class with className that may be passed to use() to get a JavaScript wrapper. onComplete: function (): called when all classes have been enumerated. Java.enumerateLoadedClassesSync(): synchronous version of enumerateLoadedClasses() that returns the class names in an array. Java.perform(fn): ensure that the current thread is attached to the VM and call fn. (This isn’t necessary in callbacks from Java.) Java.perform(function () { var Activity = Java.use("android.app.Activity"); Activity.onResume.implementation = function () { send("onResume() got called! Let's call the original implementation"); this.onResume(); }; }); Java.use(className) dynamically get a JavaScript wrapper for className that you can instantiate objects from by calling $new() on it to invoke a constructor. Call $dispose() on an instance to clean it up explicitly (or wait for the JavaScript object to get garbage-collected, or script to get unloaded). Static and non-static methods are available, and you can even replace a method implementation and throw an exception from it: Java.perform(function () { var Activity = Java.use("android.app.Activity"); var Exception = Java.use("java.lang.Exception"); Activity.onResume.implementation = function () { throw Exception.$new("Oh noes!"); }; }); Java.scheduleOnMainThread(fn): run fn on the main thread of the VM. Java.choose(className, callbacks): enumerate live instances of the className class by scanning the Java heap, where callbacks is an object specifying: onMatch: function (instance): called once for each live instance found with a ready-to-use instance just as if you would have called Java.cast() with a raw handle to this particular instance. This function may return the string stop to cancel the enumeration early. onComplete: function (): called when all instances have been enumerated Java.cast(handle, klass): create a JavaScript wrapper given the existing instance at handle of given class klass (as returned from Java.use()). Such a wrapper also has a class property for getting a wrapper for its class, and a $className property for getting a string representation of its class-name. var Activity = Java.use("android.app.Activity"); var activity = Java.cast(ptr("0x1234"), Activity); WeakRef WeakRef.bind(value, fn): monitor value and call the fn callback as soon as value has been garbage-collected, or the script is about to get unloaded. Returns an id that you can pass to WeakRef.unbind() for explicit cleanup. This API is useful if you’re building a language-binding, where you need to free native resources when a JS value is no longer needed. WeakRef.unbind(id): stop monitoring the value passed to WeakRef.bind(value, fn), and call the fn callback immediately.

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册