0: jdbc:phoenix:xxx:2181:/hbase> CREATE INDEX MY_INDEX_URL_2 ON "xxx"."xxx" ("fn"."name") INCLUDE("fn"."url","fn"."text");
Error: Operation timed out. (state=TIM01,code=6000)
java.sql.SQLTimeoutException: Operation timed out.
	at org.apache.phoenix.exception.SQLExceptionCode$15.newException(SQLExceptionCode.java:405)
	at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:150)
	at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:1341)
	at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:1239)
	at org.apache.phoenix.iterate.RoundRobinResultIterator.getIterators(RoundRobinResultIterator.java:176)
	at org.apache.phoenix.iterate.RoundRobinResultIterator.next(RoundRobinResultIterator.java:91)
	at org.apache.phoenix.compile.UpsertCompiler$ClientUpsertSelectMutationPlan.execute(UpsertCompiler.java:1301)
	at org.apache.phoenix.compile.DelegateMutationPlan.execute(DelegateMutationPlan.java:31)
	at org.apache.phoenix.compile.PostIndexDDLCompiler$1.execute(PostIndexDDLCompiler.java:117)
	at org.apache.phoenix.query.ConnectionQueryServicesImpl.updateData(ConnectionQueryServicesImpl.java:3664)
	at org.apache.phoenix.schema.MetaDataClient.buildIndex(MetaDataClient.java:1380)
	at org.apache.phoenix.schema.MetaDataClient.createIndex(MetaDataClient.java:1692)
	at org.apache.phoenix.compile.CreateIndexCompiler$1.execute(CreateIndexCompiler.java:85)
	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:408)
	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:391)
	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:389)
	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:378)
	at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1825)
	at sqlline.Commands.execute(Commands.java:822)
	at sqlline.Commands.sql(Commands.java:732)
	at sqlline.SqlLine.dispatch(SqlLine.java:813)
	at sqlline.SqlLine.begin(SqlLine.java:686)
	at sqlline.SqlLine.start(SqlLine.java:398)
	at sqlline.SqlLine.main(SqlLine.java:291)

 在hbase中加入以下参数,超时时间设置,注意CDH版本hbase-site.xml客户端、服务端都配置上

<property>
<name>phoenix.query.timeoutMs</name>
<value>10800000</value>
</property>

注意:配置分为客户端和服务端

phoenix 创建索引超时 Operation timed out_apache

phoenix 创建索引超时 Operation timed out_apache_02

 

其他优化参数,根据个人情况调整

<property>
<name>phoenix.query.timeoutMs</name>
<value>1800000</value>
</property>
<property>
<name>hbase.regionserver.lease.period</name>
<value>1200000</value>
</property>
<property>
<name>hbase.rpc.timeout</name>
<value>1200000</value>
</property>
<property>
<name>hbase.client.scanner.caching</name>
<value>1000</value>
</property>
<property>
<name>hbase.client.scanner.timeout.period</name>
<value>1200000</value>
</property>
<property>
<name>index.builder.threads.keepalivetime</name>
<value>1200000</value>
</property>
<property>
<name>index.write.threads.keepalivetime</name>
<value>1200000</value>
</property>
<property>
<name>hbase.htable.threads.keepalivetime</name>
<value>1200000</value>
</property>